diff options
Diffstat (limited to 'modules/podman.nix')
-rw-r--r-- | modules/podman.nix | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/modules/podman.nix b/modules/podman.nix new file mode 100644 index 0000000..bb4fda5 --- /dev/null +++ b/modules/podman.nix @@ -0,0 +1,48 @@ +{ + config, + inputs, + lib, + pkgs, + ... +}: +with lib; +let + cfg = config.nixfiles.modules.podman; +in +{ + options.nixfiles.modules.podman.enable = mkEnableOption "Podman"; + + config = mkIf cfg.enable { + assertions = [ + { + assertion = cfg.enable -> !config.nixfiles.modules.docker.enable; + message = "Pick only one!"; + } + ]; + + nixfiles.modules.common.shell.aliases.p = "podman"; + + secrets.containers-auth = { + file = "${inputs.self}/secrets/containers-auth"; + path = "${config.dirs.config}/containers/auth.json"; + owner = my.username; + inherit (config.my) group; + }; + + virtualisation.podman.enable = true; + + environment.systemPackages = with pkgs; [ podman-compose ]; + + my.extraGroups = [ "podman" ]; + + hm.xdg.configFile = { + "containers/registries.conf".source = pkgs.writers.writeTOML "containers-registries.toml" { + registries.search.registries = [ "docker.io" ]; + }; + + "containers/storage.conf".source = pkgs.writers.writeTOML "containers-storage.toml" { + storage.driver = "overlay"; + }; + }; + }; +} |