Skip to content

Commit

Permalink
add: podman
Browse files Browse the repository at this point in the history
  • Loading branch information
KP64 committed Jan 10, 2025
1 parent 8d733a7 commit dadcf07
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 5 deletions.
1 change: 0 additions & 1 deletion hosts/kg/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@
"networkmanager"
"wheel"
"input"
"docker"
"kvm"
"libvirtd"
"audio"
Expand Down
1 change: 0 additions & 1 deletion hosts/rs/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@
"networkmanager"
"wheel"
"input"
"docker"
"kvm"
"libvirtd"
"audio"
Expand Down
1 change: 0 additions & 1 deletion hosts/tp/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@
"networkmanager"
"wheel"
"input"
"docker"
"kvm"
"libvirtd"
"audio"
Expand Down
1 change: 0 additions & 1 deletion hosts/ws/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
"networkmanager"
"wheel"
"input"
"docker"
"kvm"
"libvirtd"
"audio"
Expand Down
1 change: 1 addition & 0 deletions programs/virtualisation/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ in
{
imports = [
./docker.nix
./podman.nix
./virtualbox.nix
];

Expand Down
8 changes: 7 additions & 1 deletion programs/virtualisation/docker.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{ lib, config, ... }:
{
lib,
config,
username,
...
}:
let
cfg = config.virt.docker;
in
Expand All @@ -17,6 +22,7 @@ in
};
};
};
users.users.${username}.extraGroups = [ "docker" ];
})

(lib.mkIf config.isImpermanenceEnabled {
Expand Down
29 changes: 29 additions & 0 deletions programs/virtualisation/podman.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
lib,
config,
username,
...
}:
let
cfg = config.virt.podman;
in
{
options.virt.podman.enable = lib.mkEnableOption "Podman";

config = lib.mkMerge [
(lib.mkIf cfg.enable {
virtualisation.podman = {
enable = true;
dockerCompat = true;
autoPrune.enable = true;
defaultNetwork.settings.dns_enabled = true;
};

users.users.${username}.extraGroups = [ "podman" ];
})

(lib.mkIf config.isImpermanenceEnabled {
environment.persistence."/persist".directories = lib.optional cfg.enable "/var/lib/containers";
})
];
}

0 comments on commit dadcf07

Please sign in to comment.