diff options
author | Azat Bahawi <azat@bahawi.net> | 2022-08-12 22:53:53 +0300 |
---|---|---|
committer | Azat Bahawi <azat@bahawi.net> | 2022-08-12 22:53:53 +0300 |
commit | 61b94f0dd06cac0f7dcd38cce80f2a7ab8376098 (patch) | |
tree | b703a9fe11eae6c4cae4e4682f02caf0caa171d0 /modules/nixfiles/podman.nix |
2022-08-12
Diffstat (limited to 'modules/nixfiles/podman.nix')
-rw-r--r-- | modules/nixfiles/podman.nix | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/modules/nixfiles/podman.nix b/modules/nixfiles/podman.nix new file mode 100644 index 0000000..6c8b7e5 --- /dev/null +++ b/modules/nixfiles/podman.nix @@ -0,0 +1,35 @@ +{ + config, + lib, + inputs, + pkgs, + ... +}: +with lib; let + cfg = config.nixfiles.modules.podman; +in { + options.nixfiles.modules.podman.enable = + mkEnableOption "Whether to enable Podman."; + + config = mkIf cfg.enable { + secrets.containers-auth = { + file = "${inputs.self}/secrets/containers-auth"; + path = "${config.dirs.config}/containers/auth.json"; + owner = my.username; + }; + + virtualisation.podman.enable = true; + + environment.systemPackages = with pkgs; [podman-compose]; + + my.extraGroups = ["podman"]; + + hm.programs.bash = { + shellAliases.p = "${pkgs.podman}/bin/podman"; + + initExtra = mkAfter '' + _complete_alias p __start_podman podman + ''; + }; + }; +} |