feat(ap01): WIP
This commit is contained in:
parent
c9dc36ed08
commit
9a4f9c2ca3
14 changed files with 79 additions and 16 deletions
4
hive.nix
4
hive.nix
|
@ -111,12 +111,12 @@ in
|
|||
args;
|
||||
|
||||
defaults =
|
||||
{ name, nodePath, ... }:
|
||||
{ name, ... }:
|
||||
{
|
||||
# Import the default modules
|
||||
imports = [
|
||||
# Import the base configuration for each node
|
||||
./${nodePath}/_configuration.nix
|
||||
./machines/liminix/ap-v01/_configuration.nix
|
||||
./modules/generic
|
||||
./modules/${category name}
|
||||
];
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
{
|
||||
modulesPath,
|
||||
sourcePkgs,
|
||||
name,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
@ -39,6 +40,6 @@
|
|||
(import "${modulesPath}/../devices/zyxel-nwa50ax").module
|
||||
];
|
||||
|
||||
hostname = "ap01-prototype";
|
||||
hostname = name;
|
||||
nixpkgs.source = sourcePkgs.path;
|
||||
}
|
|
@ -6,10 +6,19 @@
|
|||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
nodeMeta,
|
||||
...
|
||||
}:
|
||||
let
|
||||
svc = config.system.service;
|
||||
|
||||
inherit (nodeMeta.extraNodeSettings) building floor ap-no;
|
||||
|
||||
hex = x: lib.fixedWidthString 2 "0" (lib.toHexString x);
|
||||
|
||||
mac-1 = "02:5B:6A:${hex (building * 4)}:${hex floor}:${hex ap-no}";
|
||||
mac-2 = "02:5B:6A:${hex (building * 4 + 1)}:${hex floor}:${hex ap-no}";
|
||||
|
||||
secrets-1 = {
|
||||
ssid = "DGNum";
|
||||
};
|
||||
|
@ -89,6 +98,10 @@ let
|
|||
};
|
||||
in
|
||||
{
|
||||
hardware.wlanMacAddresses = {
|
||||
wlan0 = mac-1;
|
||||
wlan1 = mac-2;
|
||||
};
|
||||
services = {
|
||||
# wlan0 is the 2.4GHz interface.
|
||||
hostap-1 = mkWifiSta (
|
|
@ -15,18 +15,61 @@
|
|||
# nixpkgs = "unstable" or "22.11"; # nixpkgs version
|
||||
# }
|
||||
|
||||
{
|
||||
ap01 = {
|
||||
site = "unknown";
|
||||
adminGroups = [ "fai" ];
|
||||
let
|
||||
lib = import ../../lib/nix-lib;
|
||||
inherit (lib) mapFuse;
|
||||
|
||||
hashedPassword = "$y$j9T$DMOQEWOYFHjNS0myrXp4x/$MG33VSdXGvib.99eN.AbvyVdNNJw4ERjAwK4.ULJe/A";
|
||||
mkAP = building: floor: ap-no: {
|
||||
"ap-v01-${builtins.toString building}-${builtins.toString floor}-${builtins.toString ap-no}" = {
|
||||
site = "unknown";
|
||||
adminGroups = [ "fai" ];
|
||||
|
||||
stateVersion = null;
|
||||
hashedPassword = "$y$j9T$DMOQEWOYFHjNS0myrXp4x/$MG33VSdXGvib.99eN.AbvyVdNNJw4ERjAwK4.ULJe/A";
|
||||
|
||||
nixpkgs = {
|
||||
system = "zyxel-nwa50ax";
|
||||
version = "24.05";
|
||||
stateVersion = null;
|
||||
|
||||
nixpkgs = {
|
||||
system = "zyxel-nwa50ax";
|
||||
version = "24.05";
|
||||
};
|
||||
|
||||
extraNodeSettings = {
|
||||
inherit building floor ap-no;
|
||||
vendor-mac = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
in
|
||||
{ }
|
||||
//
|
||||
mapFuse
|
||||
(
|
||||
floor:
|
||||
mapFuse (mkAP 0 floor) [
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
]
|
||||
)
|
||||
[
|
||||
0
|
||||
1
|
||||
2
|
||||
] # Hypnos-1
|
||||
//
|
||||
mapFuse
|
||||
(
|
||||
floor:
|
||||
mapFuse (mkAP 1 floor) [
|
||||
1
|
||||
2
|
||||
]
|
||||
)
|
||||
[
|
||||
0
|
||||
1
|
||||
2
|
||||
] # Hypnos-2
|
||||
|
|
|
@ -210,6 +210,12 @@ in
|
|||
default = null;
|
||||
description = "VM cluster where the VM is located";
|
||||
};
|
||||
|
||||
extraNodeSettings = mkOption {
|
||||
type = attrs;
|
||||
default = { };
|
||||
description = "Freeform attribute set to customize the node";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
|
|
@ -153,10 +153,10 @@
|
|||
"type": "Git",
|
||||
"url": "https://git.dgnum.eu/DGNum/liminix"
|
||||
},
|
||||
"branch": "main",
|
||||
"revision": "1322de1ee0cdb19fead79e12ab279ee0b575019a",
|
||||
"branch": "mdebray/mac-personalisation",
|
||||
"revision": "b129f775b2f58a820d09b11f17363ef477669668",
|
||||
"url": null,
|
||||
"hash": "07nk6nik97k8a57cf17dcj3gn2lbhw1myymrxpqc2aqa3haj754k"
|
||||
"hash": "17vryhcd4d7ghjin03bnqnzrra17698hd12k1afkjpi2j0ag0p3z"
|
||||
},
|
||||
"linkal": {
|
||||
"type": "Git",
|
||||
|
|
Loading…
Add table
Reference in a new issue