initial configs for ekman
This commit is contained in:
97
nixops/ekman/default.nix
Normal file
97
nixops/ekman/default.nix
Normal file
@@ -0,0 +1,97 @@
|
||||
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 = {
|
||||
"/frontend" = {
|
||||
device = "10.255.241.100:/home";
|
||||
fsType = "nfs4";
|
||||
options = [
|
||||
"soft"
|
||||
"defaults"
|
||||
"noauto"
|
||||
"x-systemd.automount"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
systemd.automounts = [
|
||||
{
|
||||
where = "/frontend";
|
||||
wantedBy = [ "default.target" ];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
mkCompute = host:
|
||||
let
|
||||
ipoib = builtins.replaceStrings [".241."] [".243."] host.address;
|
||||
hw = ./hw + "/${host.name}.nix";
|
||||
in {
|
||||
"${host.name}" = {
|
||||
features = {
|
||||
inherit host;
|
||||
os.externalInterface = "enp33s0f0np0";
|
||||
hpc.compute = true;
|
||||
# k8s = { inherit etcdCluster; };
|
||||
};
|
||||
|
||||
deployment.targetHost = host.address;
|
||||
|
||||
# services.udev.extraRules = ''
|
||||
# KERNEL=="ibp65s0", SUBSYSTEM=="net", ATTR{create_child}:="0x2222"
|
||||
# '';
|
||||
|
||||
node = {
|
||||
};
|
||||
|
||||
networking = {
|
||||
useDHCP = false;
|
||||
interfaces.enp33s0f0np0 = {
|
||||
useDHCP = false;
|
||||
ipv4.addresses = [ {
|
||||
address = host.address;
|
||||
prefixLength = 24;
|
||||
} ];
|
||||
ipv4.routes = [ {
|
||||
address = "10.255.242.2";
|
||||
prefixLength = 32;
|
||||
via = "10.1.241.100";
|
||||
} ];
|
||||
|
||||
};
|
||||
interfaces.ibp1s0 = {
|
||||
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 = "ekman";
|
||||
# ordering = {
|
||||
# tags = [ "frontend" "compute" ];
|
||||
# };
|
||||
# };
|
||||
|
||||
# inherit ekman;
|
||||
# } // builtins.foldl' (a: n: a // mkCompute n) {} nodes
|
||||
|
||||
Reference in New Issue
Block a user