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;
}
) 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
# ];
# };
};
};

View File

@ -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;

View File

@ -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})"
);
};
}