modules/system/settei: add settei.programs.podman module
This commit is contained in:
parent
40cc61c620
commit
04e85bfc01
3 changed files with 42 additions and 0 deletions
|
@ -15,6 +15,7 @@
|
|||
(import ./sane-defaults.nix {inherit isLinux;})
|
||||
(import ./flake-qol.nix {inherit perInput;})
|
||||
./user.nix
|
||||
(import ./programs {inherit isLinux;})
|
||||
];
|
||||
|
||||
options.settei = with lib; {
|
||||
|
|
7
modules/system/settei/programs/default.nix
Normal file
7
modules/system/settei/programs/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{isLinux}: {
|
||||
_file = ./default.nix;
|
||||
|
||||
imports = [
|
||||
(import ./podman.nix {inherit isLinux;})
|
||||
];
|
||||
}
|
34
modules/system/settei/programs/podman.nix
Normal file
34
modules/system/settei/programs/podman.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{isLinux}: {
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
sharedConfig = {
|
||||
environment.systemPackages = [pkgs.podman-compose];
|
||||
};
|
||||
|
||||
linuxConfig = lib.optionalAttrs isLinux {
|
||||
virtualisation.podman = {
|
||||
enable = true;
|
||||
dockerCompat = lib.mkDefault true;
|
||||
defaultNetwork.settings.dns_enabled = lib.mkDefault true;
|
||||
};
|
||||
};
|
||||
|
||||
darwinConfig = lib.optionalAttrs (!isLinux) {
|
||||
environment.systemPackages = [pkgs.podman];
|
||||
};
|
||||
|
||||
finalConfig = lib.mkMerge [
|
||||
sharedConfig
|
||||
linuxConfig
|
||||
darwinConfig
|
||||
];
|
||||
in {
|
||||
_file = ./podman.nix;
|
||||
|
||||
options.settei.programs.podman.enable = lib.mkEnableOption "Podman";
|
||||
|
||||
config = lib.mkIf config.settei.programs.podman.enable finalConfig;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue