Manages Podman containers and networks on NixOS via Quadlet.
Compared to alternatives like virtualisation.oci-containers
or arion
, quadlet-nix
is special in that:
quadlet-nix |
oci-containers |
arion |
|
---|---|---|---|
Supports networks | ✅ | ❌ | ✅ |
Updates / deletes networks on change | ✅ | / | ❌ |
Supports podman-auto-update | ✅ | ✅ | ❌ |
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
quadlet-nix.url = "github:SEIAROTg/quadlet-nix";
quadlet-nix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { nixpkgs, quadlet-nix, ... }@attrs: {
nixosConfigurations.machine = nixpksg.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./configuration.nix
quadlet-nix.nixosModules.quadlet
];
};
};
}
{
# ...
virtualisation.quadlet = {
containers = {
nginx.containerConfig.image = "docker.io/library/nginx:latest";
nginx.containerConfig.networks = [ "host" "internal.network" ];
nginx.serviceConfig.TimeoutStartSec = "60";
};
networks = {
internal.networkConfig.subnets = [ "10.0.123.1/24" ];
};
};
}
See container.nix
and network.nix
for all options.