From 1a478ba01ebda90efad04ad1a355f771cedbe840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20K=C3=A4nner?= Date: Sat, 28 Dec 2024 23:09:48 +0100 Subject: [PATCH] create podman module --- hosts/MaxNixosLaptop/configuration.nix | 5 ----- modules/nixos/default.nix | 3 ++- modules/nixos/podman.nix | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 modules/nixos/podman.nix diff --git a/hosts/MaxNixosLaptop/configuration.nix b/hosts/MaxNixosLaptop/configuration.nix index b343d07..7a67eb6 100644 --- a/hosts/MaxNixosLaptop/configuration.nix +++ b/hosts/MaxNixosLaptop/configuration.nix @@ -87,11 +87,6 @@ environment.sessionVariables.NIXOS_OZONE_WL = "1"; virtualisation = { - podman = { - enable = true; - dockerCompat = true; - defaultNetwork.settings.dns_enabled = true; - }; libvirtd = { enable = true; qemu = { diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 1a25226..fe36a3d 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -5,7 +5,7 @@ }: let cfg = config.myConfig; in { - imports = [./bootloader.nix ./locale.nix ./greetd.nix ./rebuild.nix ./sops.nix ./sway.nix ./wifi.nix ./music.nix ./cups.nix ./gpu/amd.nix ./touch.nix ./cache.nix ./nix.nix ./update.nix]; + imports = [./bootloader.nix ./locale.nix ./greetd.nix ./rebuild.nix ./sops.nix ./sway.nix ./wifi.nix ./music.nix ./cups.nix ./gpu/amd.nix ./touch.nix ./cache.nix ./nix.nix ./update.nix ./podman.nix]; options.myConfig = { enable = lib.mkEnableOption "my custom config"; @@ -26,6 +26,7 @@ in { rebuild.enable = true; cache.enable = true; autoUpdate.enable = true; + podman.enable = true; greetd.enable = lib.mkIf cfg.desktop true; sway.enable = lib.mkIf cfg.desktop true; diff --git a/modules/nixos/podman.nix b/modules/nixos/podman.nix new file mode 100644 index 0000000..5dcea4d --- /dev/null +++ b/modules/nixos/podman.nix @@ -0,0 +1,20 @@ +{ + lib, + config, + ... +}: let + cfg = config.myConfig.podman; +in { + options.myConfig.podman = { + enable = lib.mkEnableOption "podman"; + }; + + config = lib.mkIf cfg.enable { + virtualisation. + podman = { + enable = true; + dockerCompat = true; + defaultNetwork.settings.dns_enabled = true; + }; + }; +}