feat(hive): Add more personalisation for liminix hosts
This commit is contained in:
parent
11391dc4f2
commit
e8d446d2b0
4 changed files with 19 additions and 5 deletions
7
hive.nix
7
hive.nix
|
@ -34,6 +34,7 @@ let
|
||||||
system = node: nodes'.${node}.nixpkgs.system;
|
system = node: nodes'.${node}.nixpkgs.system;
|
||||||
category = node: nixpkgs'.categories.${system node};
|
category = node: nixpkgs'.categories.${system node};
|
||||||
|
|
||||||
|
|
||||||
nodePkgs = node: nixpkgs.${system node}.${version node};
|
nodePkgs = node: nixpkgs.${system node}.${version node};
|
||||||
|
|
||||||
# Builds a patched version of nixpkgs, only as the source
|
# Builds a patched version of nixpkgs, only as the source
|
||||||
|
@ -83,7 +84,7 @@ let
|
||||||
meta = (import ./meta) lib;
|
meta = (import ./meta) lib;
|
||||||
|
|
||||||
nodeMeta = meta.nodes.${node};
|
nodeMeta = meta.nodes.${node};
|
||||||
nodePath = "machines/${category node}/${node}";
|
nodePath = "machines/${category node}/${nodeMeta.nodeDir}";
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|
||||||
|
@ -111,12 +112,12 @@ in
|
||||||
args;
|
args;
|
||||||
|
|
||||||
defaults =
|
defaults =
|
||||||
{ name, ... }:
|
{ name, nodeMeta, nodePath, ... }:
|
||||||
{
|
{
|
||||||
# Import the default modules
|
# Import the default modules
|
||||||
imports = [
|
imports = [
|
||||||
# Import the base configuration for each node
|
# Import the base configuration for each node
|
||||||
./machines/liminix/ap-v01/_configuration.nix
|
./${nodePath}/_configuration.nix
|
||||||
./modules/generic
|
./modules/generic
|
||||||
./modules/${category name}
|
./modules/${category name}
|
||||||
];
|
];
|
||||||
|
|
|
@ -20,10 +20,10 @@ let
|
||||||
mac-2 = "02:5B:6A:${hex (building * 4 + 1)}:${hex floor}:${hex ap-no}";
|
mac-2 = "02:5B:6A:${hex (building * 4 + 1)}:${hex floor}:${hex ap-no}";
|
||||||
|
|
||||||
secrets-1 = {
|
secrets-1 = {
|
||||||
ssid = "DGNum";
|
ssid = "DGNum 2G";
|
||||||
};
|
};
|
||||||
secrets-2 = {
|
secrets-2 = {
|
||||||
ssid = "DGNum";
|
ssid = "DGNum 5G";
|
||||||
};
|
};
|
||||||
baseParams = {
|
baseParams = {
|
||||||
country_code = "FR";
|
country_code = "FR";
|
||||||
|
|
|
@ -27,11 +27,18 @@ let
|
||||||
|
|
||||||
stateVersion = null;
|
stateVersion = null;
|
||||||
|
|
||||||
|
nodeDir = "ap-v01";
|
||||||
|
|
||||||
nixpkgs = {
|
nixpkgs = {
|
||||||
system = "zyxel-nwa50ax";
|
system = "zyxel-nwa50ax";
|
||||||
version = "24.05";
|
version = "24.05";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
deployment = {
|
||||||
|
tags = [ "ap-dev" ];
|
||||||
|
targetHost = "10.0.253.1"; # TODO
|
||||||
|
};
|
||||||
|
|
||||||
extraNodeSettings = {
|
extraNodeSettings = {
|
||||||
inherit building floor ap-no;
|
inherit building floor ap-no;
|
||||||
vendor-mac = null;
|
vendor-mac = null;
|
||||||
|
|
|
@ -216,6 +216,11 @@ in
|
||||||
default = { };
|
default = { };
|
||||||
description = "Freeform attribute set to customize the node";
|
description = "Freeform attribute set to customize the node";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nodeDir = mkOption {
|
||||||
|
type = str;
|
||||||
|
description = "Path to access node configuration";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
@ -234,6 +239,7 @@ in
|
||||||
mkIf (ip != [ ]) (mkDefault (builtins.head ip));
|
mkIf (ip != [ ]) (mkDefault (builtins.head ip));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
nodeDir = mkDefault name;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue