2024-01-19 10:41:57 +00:00
|
|
|
{
|
2024-02-05 13:13:44 +00:00
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
imports = [
|
|
|
|
# Include the results of the hardware scan.
|
|
|
|
./hardware.nix
|
|
|
|
];
|
2024-01-19 10:41:57 +00:00
|
|
|
|
|
|
|
age.secrets.k3s-token = {
|
|
|
|
file = ../../secrets/k3s-token.age;
|
|
|
|
owner = "root";
|
|
|
|
};
|
|
|
|
|
|
|
|
boot = {
|
2024-02-05 13:13:44 +00:00
|
|
|
supportedFilesystems = ["nfs"];
|
|
|
|
kernelParams = ["cgroup_enable=memory" "cgroup_enable=cpuset" "cgroup_memory=1"];
|
2024-01-19 10:41:57 +00:00
|
|
|
loader = {
|
|
|
|
systemd-boot.enable = true;
|
|
|
|
efi.canTouchEfiVariables = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
swapDevices = [
|
|
|
|
{
|
|
|
|
device = "/var/lib/swapfile";
|
2024-02-05 13:13:44 +00:00
|
|
|
size = 8 * 1024;
|
2024-01-19 10:41:57 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
nix = {
|
|
|
|
settings = {
|
|
|
|
auto-optimise-store = true;
|
|
|
|
experimental-features = ["nix-command" "flakes"];
|
|
|
|
};
|
|
|
|
gc = {
|
|
|
|
automatic = true;
|
|
|
|
dates = "weekly";
|
|
|
|
options = "--delete-older-than 30d";
|
|
|
|
};
|
|
|
|
# Free up to 1GiB whenever there is less than 100MiB left.
|
|
|
|
extraOptions = ''
|
|
|
|
min-free = ${toString (100 * 1024 * 1024)}
|
|
|
|
max-free = ${toString (1024 * 1024 * 1024)}
|
2024-02-05 13:13:44 +00:00
|
|
|
'';
|
2024-01-19 10:41:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
hostName = "proxmox-node-1";
|
|
|
|
domain = "gmem.ca";
|
|
|
|
firewall = {
|
|
|
|
trustedInterfaces = ["tailscale0"];
|
|
|
|
checkReversePath = "loose";
|
2024-02-05 13:13:44 +00:00
|
|
|
allowedUDPPorts = [41641];
|
|
|
|
allowedTCPPorts = [22 80 443 6443 10250];
|
2024-01-19 10:41:57 +00:00
|
|
|
enable = false;
|
|
|
|
};
|
|
|
|
nftables.enable = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
time.timeZone = "Europe/London";
|
|
|
|
|
|
|
|
users.users.gsimmer = {
|
|
|
|
isNormalUser = true;
|
2024-02-05 13:13:44 +00:00
|
|
|
extraGroups = ["wheel"];
|
2024-01-19 10:41:57 +00:00
|
|
|
packages = with pkgs; [
|
|
|
|
tree
|
|
|
|
];
|
|
|
|
openssh.authorizedKeys.keys = let
|
|
|
|
authorizedKeys = pkgs.fetchurl {
|
|
|
|
url = "https://gmem.ca/ssh";
|
|
|
|
hash = "sha256-7PpFDgWVfp26c9PuW+2s3O8MBAODtHr4q7WU/l3BoG4=";
|
|
|
|
};
|
2024-02-05 13:13:44 +00:00
|
|
|
in
|
|
|
|
pkgs.lib.splitString "\n" (builtins.readFile
|
|
|
|
authorizedKeys);
|
2024-01-19 10:41:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
vim
|
|
|
|
wget
|
|
|
|
htop
|
|
|
|
git
|
|
|
|
screen
|
|
|
|
nix-output-monitor
|
|
|
|
tailscale
|
|
|
|
nfs-utils
|
|
|
|
];
|
|
|
|
|
|
|
|
services = {
|
|
|
|
rpcbind.enable = true;
|
|
|
|
openssh.enable = true;
|
|
|
|
tailscale.enable = true;
|
|
|
|
k3s = {
|
|
|
|
enable = true;
|
|
|
|
role = "agent";
|
|
|
|
serverAddr = "https://100.77.43.133:6443";
|
|
|
|
tokenFile = config.age.secrets.k3s-token.path;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
system.stateVersion = "23.11"; # dId YoU rEaD tHe CoMmEnT?
|
|
|
|
}
|