infrastructure/meta/nodes/liminix.nix
Elias Coppens 0c3062a5c5
Some checks failed
Check meta / check_meta (pull_request) Successful in 15s
Check meta / check_dns (pull_request) Successful in 16s
Check workflows / check_workflows (pull_request) Failing after 16s
Build all the nodes / netcore02 (pull_request) Successful in 21s
Run pre-commit on all files / pre-commit (push) Successful in 27s
Build all the nodes / ap01 (pull_request) Failing after 31s
Build the shell / build-shell (pull_request) Successful in 24s
Run pre-commit on all files / pre-commit (pull_request) Successful in 24s
Build all the nodes / hypervisor03 (pull_request) Successful in 1m54s
Build all the nodes / bridge01 (pull_request) Successful in 1m55s
Build all the nodes / tower01 (pull_request) Successful in 1m54s
Build all the nodes / rescue01 (pull_request) Successful in 1m57s
Build all the nodes / build01 (pull_request) Successful in 2m44s
Build all the nodes / hypervisor02 (pull_request) Successful in 2m47s
Build all the nodes / storage01 (pull_request) Successful in 3m1s
Build all the nodes / hypervisor01 (pull_request) Successful in 3m9s
Build all the nodes / geo02 (pull_request) Successful in 3m11s
Build all the nodes / geo01 (pull_request) Successful in 3m41s
Build all the nodes / vault01 (pull_request) Successful in 3m40s
Build all the nodes / web03 (pull_request) Successful in 3m29s
Build all the nodes / compute01 (pull_request) Successful in 3m46s
Build all the nodes / web01 (pull_request) Successful in 3m45s
Build all the nodes / web02 (pull_request) Successful in 3m39s
refactor(liminix): Refactor liminix meta nodes
2025-02-06 11:02:44 +01:00

90 lines
2.2 KiB
Nix

# SPDX-FileCopyrightText: 2024 Tom Hubrecht <tom.hubrecht@dgnum.eu>
# SPDX-FileContributor: Ryan Lahfa <ryan.lahfa@dgnum.eu>
#
# SPDX-License-Identifier: EUPL-1.2
###
# File specifying all the deployement options for the nodes administrated by the dgnum.
#
# Node metadata template is:
#
# NODE_NAME = {
# adminGroups = []; # List of groups that have root access
# admins = []; # List of individuals that have root access
# deployment = {}; # Colmena deployment options
# nixpkgs = "unstable" or "22.11"; # nixpkgs version
# }
let
nix-lib = import ../../lib/nix-lib;
inherit (nix-lib) mapFuse;
mkAP' = building: floor: ap-no: {
"ap-v01-${builtins.toString building}-${builtins.toString floor}-${builtins.toString ap-no}" = {
site = "unknown";
adminGroups = [ "fai" ];
hashedPassword = "$y$j9T$DMOQEWOYFHjNS0myrXp4x/$MG33VSdXGvib.99eN.AbvyVdNNJw4ERjAwK4.ULJe/A";
stateVersion = null;
nixpkgs = {
system = "zyxel-nwa50ax";
version = "24.05";
};
extraNodeSettings = {
inherit building floor ap-no;
vendor-mac = null;
};
};
};
/*
Generate all APs nodes for a building. It takes a building definition and returns
an attributes set containing all nodes of the AP for the building.
Building definition:
* building-no is the index of the building
* floors is the range {from, to{ of floors that contains an AP
* ap-nos is the range [from, to{ of AP numbers
Type: AttrSet -> AttrSet
*/
mkAPs-building =
{
building-no,
floors,
ap-nos,
}:
mapFuse (f: mapFuse (mkAP' building-no f) (mkRange ap-nos)) (mkRange floors);
APs = {
hypnos-1 = {
building-no = 0;
floors = {
from = 0;
to = 3;
};
ap-nos = {
from = 1;
to = 7;
};
};
hypnos-2 = {
building-no = 1;
floors = {
from = 0;
to = 3;
};
ap-nos = {
from = 1;
to = 3;
};
};
};
mkRange = { from, to }: builtins.genList (x: x + from) (to - from);
in
{ }
// builtins.foldl' (nodes: building: nodes // mkAPs-building building) { } (builtins.attrValues APs)