Fix physiques et warning id

hosts-v2
Pyjacpp 2026-09-06 15:11:55 +02:00
parent fefefa84ea
commit 2641ecf224
No known key found for this signature in database
GPG Key ID: ED479A5A26930939
3 changed files with 28 additions and 11 deletions

View File

@ -71,7 +71,7 @@
] ]
++ baseModules; ++ baseModules;
} }
) hosts; ) (attrsets.filterAttrs (name: info: !(info.isDebian or false)) hosts);
attrs_vm_info = listInfoToAttrs (get_info ./hosts/vm) { isVm = true; }; attrs_vm_info = listInfoToAttrs (get_info ./hosts/vm) { isVm = true; };
attrs_physique_info = listInfoToAttrs (get_info ./hosts/physiques) { isVm = false; }; attrs_physique_info = listInfoToAttrs (get_info ./hosts/physiques) { isVm = false; };
attrs_all_info = attrs_physique_info // attrs_vm_info; attrs_all_info = attrs_physique_info // attrs_vm_info;
@ -79,14 +79,14 @@
(attrsToNixosSystem ./hosts/vm attrs_all_info attrs_vm_info) (attrsToNixosSystem ./hosts/vm attrs_all_info attrs_vm_info)
// (attrsToNixosSystem ./hosts/physiques attrs_all_info attrs_physique_info) // (attrsToNixosSystem ./hosts/physiques attrs_all_info attrs_physique_info)
// { // {
cransIso = nixosSystem { # cransIso = nixosSystem {
system = "x86_64-linux"; # system = "x86_64-linux";
specialArgs = inputs; # specialArgs = inputs;
modules = [ # modules = [
./hosts/iso # ./hosts/iso
./modules/crans/locale.nix # ./modules/crans/locale.nix
]; # ];
}; # };
}; };
}; };

View File

@ -3,6 +3,9 @@
description = "Serveur de stockage ceph"; description = "Serveur de stockage ceph";
id = 3; id = 3;
# Sous Nix mais dans une autre branche
isDebian = true;
networking = { networking = {
adm.enable = true; adm.enable = true;
san.enable = true; san.enable = true;

View File

@ -6,8 +6,9 @@ let
inherit (lib) inherit (lib)
mkEnableOption mkEnableOption
mkOption mkOption
types
mkIf mkIf
types
optional
; ;
in in
{ {
@ -42,6 +43,13 @@ in
description = "Est-ce une machine virtuelle ?"; description = "Est-ce une machine virtuelle ?";
}; };
isDebian = mkOption {
type = types.bool;
default = false;
example = "true";
description = "Est-ce une machine Debian ?";
};
description = mkOption { description = mkOption {
type = types.str; type = types.str;
example = "VM de test"; example = "VM de test";
@ -77,5 +85,11 @@ in
ldap.enable = true; 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})"
);
}; };
} }