Files
platform/clusters/stokes/default.nix
2022-08-19 14:59:44 +02:00

99 lines
2.2 KiB
Nix

let
# Pin the deployment package-set to a specific version of nixpkgs
# pkgs = import (builtins.fetchTarball {
# url = "https://github.com/NixOS/nixpkgs/archive/e6377ff35544226392b49fa2cf05590f9f0c4b43.tar.gz";
# sha256 = "1fra9wwy5gvj5ibayqkzqpwdf715bggc0qbmrfch4fghwvl5m70l";
# }) {};
pkgs = import <nixpkgs> {};
nodes = import ./nodes.nix;
compute = {
# deployment.tags = [ "compute" ];
fileSystems = {
"/stokes" = {
device = "10.1.63.100:/home";
fsType = "nfs4";
options = [
"soft"
"defaults"
"noauto"
"x-systemd.automount"
];
};
};
systemd.automounts = [
{
where = "/stokes";
wantedBy = [ "default.target" ];
}
];
};
mkCompute = host:
let
ipoib = builtins.replaceStrings [".61."] [".63."] host.address;
hw = ./hw + "/${host.name}.nix";
in {
"${host.name}" = {
features = {
inherit host;
os.externalInterface = "eno33";
hpc.compute = true;
# k8s = { inherit etcdCluster; };
};
deployment.targetHost = host.address;
# services.udev.extraRules = ''
# KERNEL=="ibp65s0", SUBSYSTEM=="net", ATTR{create_child}:="0x2222"
# '';
node = {
# i40efix = true;
};
networking = {
useDHCP = false;
interfaces.eno33 = {
useDHCP = false;
ipv4.addresses = [ {
address = host.address;
prefixLength = 24;
} ];
ipv4.routes = [ {
address = "10.1.62.2";
prefixLength = 32;
via = "10.1.61.100";
} ];
};
interfaces.ibp65s0 = {
useDHCP = false;
ipv4.addresses = [ {
address = ipoib;
prefixLength = 24;
} ];
};
};
imports = [ ./cluster.nix hw ];
}
// compute;
};
in builtins.foldl' (a: n: a // mkCompute n) {} nodes
#{
## morph
# network = {
# inherit pkgs;
# description = "stokes";
# ordering = {
# tags = [ "frontend" "compute" ];
# };
# };
# inherit stokes;
#} // builtins.foldl' (a: n: a // mkCompute n) {} nodes