No known key found for this signature in database
GPG Key ID: B4C3BF012D9B26BE
5 changed files with
98 additions and
7 deletions
-
client/default.nix
-
clients.nix
-
flake.nix
-
machines/nfs/nfs.nix
-
sops-config.nix
|
|
@ -1,7 +1,12 @@ |
|
|
|
id: |
|
|
|
|
|
|
|
{ lib, ... }: |
|
|
|
|
|
|
|
with lib; |
|
|
|
|
|
|
|
let |
|
|
|
client = (import ../clients.nix).${id}; |
|
|
|
in |
|
|
|
{ |
|
|
|
imports = [ |
|
|
|
./hardware.nix |
|
|
@ -14,9 +19,15 @@ with lib; |
|
|
|
|
|
|
|
deployment = { |
|
|
|
targetHost = "10.32.45.150"; |
|
|
|
tags = [ "client" ]; |
|
|
|
}; |
|
|
|
|
|
|
|
_module.args = { |
|
|
|
inherit id client; |
|
|
|
}; |
|
|
|
|
|
|
|
networking = { |
|
|
|
hostName = mkForce "client-${id}"; |
|
|
|
useDHCP = mkForce true; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
@ -0,0 +1,15 @@ |
|
|
|
{ |
|
|
|
"01" = { |
|
|
|
mac = ""; |
|
|
|
}; |
|
|
|
"02" = { |
|
|
|
mac = ""; |
|
|
|
}; |
|
|
|
"03" = { |
|
|
|
mac = ""; |
|
|
|
}; |
|
|
|
"04" = { |
|
|
|
mac = ""; |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
@ -53,6 +53,8 @@ |
|
|
|
# List of all machine names as defined in the machines directory |
|
|
|
machines = builtins.attrNames (builtins.readDir ./machines); |
|
|
|
|
|
|
|
clients = builtins.attrNames (import ./clients.nix); |
|
|
|
|
|
|
|
in |
|
|
|
{ |
|
|
|
colmena = { |
|
|
@ -76,15 +78,24 @@ |
|
|
|
|
|
|
|
deployment.replaceUnknownProfiles = false; |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
"client" = ./client; |
|
|
|
|
|
|
|
} // (builtins.listToAttrs (builtins.map |
|
|
|
# Machines |
|
|
|
// (builtins.listToAttrs (builtins.map |
|
|
|
(name: { |
|
|
|
inherit name; |
|
|
|
value = ./machines/${name}; |
|
|
|
}) |
|
|
|
machines)); |
|
|
|
machines)) |
|
|
|
|
|
|
|
# Clients |
|
|
|
// (builtins.listToAttrs (builtins.map |
|
|
|
(id: { |
|
|
|
name = "client-${id}"; |
|
|
|
value = (import ./client) id; |
|
|
|
}) |
|
|
|
clients)) |
|
|
|
; |
|
|
|
|
|
|
|
} // flake-utils.lib.eachDefaultSystem (system: { |
|
|
|
checks = { |
|
|
@ -135,7 +146,8 @@ |
|
|
|
pkgs = nixpkgs.legacyPackages.${system}; |
|
|
|
hive = colmena.lib.makeHive self.outputs.colmena; |
|
|
|
|
|
|
|
in pkgs.linkFarm "linuxlab-testing" (builtins.mapAttrs |
|
|
|
in |
|
|
|
pkgs.linkFarm "linuxlab-testing" (builtins.mapAttrs |
|
|
|
(_: node: node.config.system.build.diskoImages) |
|
|
|
hive.nodes); |
|
|
|
}); |
|
|
|
|
|
@ -1,3 +1,7 @@ |
|
|
|
{ pkgs, lib, ... }: |
|
|
|
|
|
|
|
with lib; |
|
|
|
|
|
|
|
{ |
|
|
|
services.nfs.server = { |
|
|
|
enable = true; |
|
|
@ -9,5 +13,54 @@ |
|
|
|
networking.firewall.allowedTCPPorts = [ |
|
|
|
2049 # NFSv4 |
|
|
|
]; |
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [ |
|
|
|
quota |
|
|
|
]; |
|
|
|
|
|
|
|
disko.devices = { |
|
|
|
disk = genAttrs [ |
|
|
|
"pci-0000:00:17.0-ata-1" |
|
|
|
"pci-0000:00:17.0-ata-2" |
|
|
|
"pci-0000:00:17.0-ata-3" |
|
|
|
"pci-0000:00:17.0-ata-4" |
|
|
|
] |
|
|
|
(path: { |
|
|
|
type = "disk"; |
|
|
|
device = "/dev/disk/by-path/${path}"; |
|
|
|
content = { |
|
|
|
type = "mdraid"; |
|
|
|
name = "home"; |
|
|
|
}; |
|
|
|
}); |
|
|
|
|
|
|
|
mdadm = { |
|
|
|
home = { |
|
|
|
type = "mdadm"; |
|
|
|
level = 5; |
|
|
|
content = { |
|
|
|
type = "gpt"; |
|
|
|
partitions = { |
|
|
|
primary = { |
|
|
|
size = "100%"; |
|
|
|
content = { |
|
|
|
type = "filesystem"; |
|
|
|
format = "ext4"; |
|
|
|
mountpoint = "/home"; |
|
|
|
extraArgs = [ |
|
|
|
"-Oquota" |
|
|
|
"-Equotatype=usrquota" |
|
|
|
]; |
|
|
|
mountOptions = [ |
|
|
|
"defaults" |
|
|
|
"quota" |
|
|
|
]; |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
@ -14,7 +14,7 @@ let |
|
|
|
}; |
|
|
|
|
|
|
|
hosts = { |
|
|
|
"nfs" = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIENsd6EdgIn5jhqXUEyPckoViHLLsYM2on/liwf1IO8p"; |
|
|
|
"nfs" = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMA+Q4wLe0AuZ8OC5BKJLrvmpKcy+6a8Iez9hCSVgtX8"; |
|
|
|
"ldap" = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFhkh5L4jYl/i4E+lBVDppHcoiohR/gDricyV2wY/3Np"; |
|
|
|
"installer" = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOrc58WlxYKaPNO1J8j8KQxOLJooc9fIxp6gZZoB4Y7o"; |
|
|
|
}; |
|
|
|