feat(hive): Add more personalisation for liminix hosts

This commit is contained in:
sinavir 2025-02-06 10:32:06 +01:00
parent 11391dc4f2
commit e8d446d2b0
No known key found for this signature in database
4 changed files with 19 additions and 5 deletions

View file

@ -34,6 +34,7 @@ let
system = node: nodes'.${node}.nixpkgs.system;
category = node: nixpkgs'.categories.${system node};
nodePkgs = node: nixpkgs.${system node}.${version node};
# Builds a patched version of nixpkgs, only as the source
@ -83,7 +84,7 @@ let
meta = (import ./meta) lib;
nodeMeta = meta.nodes.${node};
nodePath = "machines/${category node}/${node}";
nodePath = "machines/${category node}/${nodeMeta.nodeDir}";
};
in
@ -111,12 +112,12 @@ in
args;
defaults =
{ name, ... }:
{ name, nodeMeta, nodePath, ... }:
{
# Import the default modules
imports = [
# Import the base configuration for each node
./machines/liminix/ap-v01/_configuration.nix
./${nodePath}/_configuration.nix
./modules/generic
./modules/${category name}
];

View file

@ -20,10 +20,10 @@ let
mac-2 = "02:5B:6A:${hex (building * 4 + 1)}:${hex floor}:${hex ap-no}";
secrets-1 = {
ssid = "DGNum";
ssid = "DGNum 2G";
};
secrets-2 = {
ssid = "DGNum";
ssid = "DGNum 5G";
};
baseParams = {
country_code = "FR";

View file

@ -27,11 +27,18 @@ let
stateVersion = null;
nodeDir = "ap-v01";
nixpkgs = {
system = "zyxel-nwa50ax";
version = "24.05";
};
deployment = {
tags = [ "ap-dev" ];
targetHost = "10.0.253.1"; # TODO
};
extraNodeSettings = {
inherit building floor ap-no;
vendor-mac = null;

View file

@ -216,6 +216,11 @@ in
default = { };
description = "Freeform attribute set to customize the node";
};
nodeDir = mkOption {
type = str;
description = "Path to access node configuration";
};
};
config = {
@ -234,6 +239,7 @@ in
mkIf (ip != [ ]) (mkDefault (builtins.head ip));
});
nodeDir = mkDefault name;
};
}
)