diff --git a/flake.nix b/flake.nix index d928964..d294c50 100644 --- a/flake.nix +++ b/flake.nix @@ -71,7 +71,7 @@ ] ++ baseModules; } - ) hosts; + ) (attrsets.filterAttrs (name: info: !(info.isDebian or false)) hosts); attrs_vm_info = listInfoToAttrs (get_info ./hosts/vm) { isVm = true; }; attrs_physique_info = listInfoToAttrs (get_info ./hosts/physiques) { isVm = false; }; attrs_all_info = attrs_physique_info // attrs_vm_info; @@ -79,14 +79,14 @@ (attrsToNixosSystem ./hosts/vm attrs_all_info attrs_vm_info) // (attrsToNixosSystem ./hosts/physiques attrs_all_info attrs_physique_info) // { - cransIso = nixosSystem { - system = "x86_64-linux"; - specialArgs = inputs; - modules = [ - ./hosts/iso - ./modules/crans/locale.nix - ]; - }; + # cransIso = nixosSystem { + # system = "x86_64-linux"; + # specialArgs = inputs; + # modules = [ + # ./hosts/iso + # ./modules/crans/locale.nix + # ]; + # }; }; }; diff --git a/hosts/physiques/cephiroth/info.nix b/hosts/physiques/cephiroth/info.nix index 6c3b5c7..e2f7b28 100644 --- a/hosts/physiques/cephiroth/info.nix +++ b/hosts/physiques/cephiroth/info.nix @@ -3,6 +3,9 @@ description = "Serveur de stockage ceph"; id = 3; + # Sous Nix mais dans une autre branche + isDebian = true; + networking = { adm.enable = true; san.enable = true; @@ -12,7 +15,7 @@ arceus = 12; }; }; - + ilo = { id = 53; switch.salameche = 20; diff --git a/modules/crans/default.nix b/modules/crans/default.nix index d55cf8a..333d11a 100644 --- a/modules/crans/default.nix +++ b/modules/crans/default.nix @@ -6,8 +6,9 @@ let inherit (lib) mkEnableOption mkOption - types mkIf + types + optional ; in { @@ -42,6 +43,13 @@ in description = "Est-ce une machine virtuelle ?"; }; + isDebian = mkOption { + type = types.bool; + default = false; + example = "true"; + description = "Est-ce une machine Debian ?"; + }; + description = mkOption { type = types.str; example = "VM de test"; @@ -77,5 +85,11 @@ in ldap.enable = true; }; }; + + warnings = ( + optional ( + cfg.isVm != (cfg.id >= 100) + ) "${cfg.name}: isVm (${toString cfg.isVm}) est incohérent avec son id (${toString cfg.id})" + ); }; }