feat: minize the deploy.nodes code.

This commit is contained in:
CronyAkatsuki 2026-01-18 01:07:19 +01:00
parent 0d71737039
commit 426abb144a
2 changed files with 14 additions and 10 deletions

View file

@ -156,6 +156,8 @@
chaotic, chaotic,
... ...
} @ inputs: let } @ inputs: let
hostsData = import ./hosts.nix;
serversOnly = nixpkgs.lib.filterAttrs (n: v: v.type == "server") hostsData;
mkDeployNode = hostname: arch: { mkDeployNode = hostname: arch: {
inherit hostname; inherit hostname;
profiles.system = { profiles.system = {
@ -165,14 +167,16 @@
}; };
}; };
in { in {
deploy.nodes = nixpkgs.lib.mapAttrs' ( deploy.nodes =
hostname: meta: let nixpkgs.lib.mapAttrs' (
arch = meta.arch; hostname: meta: let
in { arch = meta.arch;
name = hostname; in {
value = mkDeployNode hostname arch; name = hostname;
} value = mkDeployNode hostname arch;
) (import ./hosts.nix); }
)
serversOnly;
nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration { nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration {
modules = [inputs.stylix.nixOnDroidModules.stylix ./hosts/andronix/configuration.nix]; modules = [inputs.stylix.nixOnDroidModules.stylix ./hosts/andronix/configuration.nix];

View file

@ -20,9 +20,9 @@
arch = "aarch64-linux"; arch = "aarch64-linux";
}; };
tyr = { tyr = {
type = "client"; type = "server";
arch = "x86_64-linux"; arch = "x86_64-linux";
extraModules = [./modules/servers/tyr]; # extraModules = [./modules/servers/tyr];
}; };
ymir = { ymir = {
type = "client"; type = "client";