diff --git a/flake.nix b/flake.nix index ba63f07..9faccb1 100644 --- a/flake.nix +++ b/flake.nix @@ -98,12 +98,16 @@ nginx = nixpkgs.lib.nixosSystem { inherit system; modules = [ + "${inputs.nixpkgs}/nixos/modules/virtualisation/proxmox-lxc.nix" "${inputs.self}/services" { networking.hostName = "nginx"; services.vm_nginx = { enable = true; }; + services.ct = { + enable = true; + }; } ]; }; @@ -131,12 +135,16 @@ redis = nixpkgs.lib.nixosSystem { inherit system; modules = [ + "${inputs.nixpkgs}/nixos/modules/virtualisation/proxmox-lxc.nix" "${inputs.self}/services" { networking.hostName = "redis"; services.vm_redis = { enable = true; }; + services.ct = { + enable = true; + }; } ]; }; diff --git a/services/minimalConfig/default.nix b/services/minimalConfig/default.nix index 9185289..810fb55 100644 --- a/services/minimalConfig/default.nix +++ b/services/minimalConfig/default.nix @@ -1,5 +1,8 @@ { config, pkgs, lib, inputs, modulesPath, ... }: { + + imports = [ ./lxc.nix ]; + nix = { settings.experimental-features = [ "nix-command" "flakes" ]; settings.trusted-users = [ "root" "@wheel" ]; diff --git a/systems/lxc.nix b/services/minimalConfig/lxc.nix similarity index 66% rename from systems/lxc.nix rename to services/minimalConfig/lxc.nix index a505e17..2fa9e3a 100644 --- a/systems/lxc.nix +++ b/services/minimalConfig/lxc.nix @@ -1,19 +1,16 @@ -{ inputs, lib, config, modulesPath, ... }: +{lib, config, modulesPath, ...}: let - cfg = config.services.vm; + cfg = config.services.ct; in { options.services.ct = { enable = lib.mkEnableOption "Enable LXC container config"; }; config = lib.mkIf cfg.enable { - - imports = [ (modulesPath + "/virtualisation/proxmox-lxc.nix") ]; systemd.suppressedSystemUnits = [ "dev-mqueue.mount" "sys-kernel-debug.mount" "sys-fs-fuse-connections.mount" ]; - }; } diff --git a/systems/default.nix b/systems/default.nix index 33c1d8b..1c27987 100644 --- a/systems/default.nix +++ b/systems/default.nix @@ -2,6 +2,5 @@ { imports = [ ./microvm.nix - ./lxc.nix ]; } diff --git a/systems/microvm.nix b/systems/microvm.nix index 9dbc77f..d7ef82a 100644 --- a/systems/microvm.nix +++ b/systems/microvm.nix @@ -1,11 +1,8 @@ -{ inputs, lib, config, microvm, modulesPath, ... }: +{ inputs, lib, config, microvm, ... }: let cfg = config.services.vm; in { - options.services.ct = { - enable = lib.mkEnableOption "Enable LXC container config"; - }; options.services.vm = { enable = lib.mkEnableOption "Enable NixOS microvm config"; hostname = lib.mkOption {