feat: minize the deploy.nodes code.
This commit is contained in:
parent
0d71737039
commit
426abb144a
2 changed files with 14 additions and 10 deletions
20
flake.nix
20
flake.nix
|
|
@ -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];
|
||||||
|
|
|
||||||
|
|
@ -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";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue