my nix configs for my servers and desktop

Compare changes

Choose any two refs to compare.

+67
common/python-cuda-dev.nix
···
···
+
{
+
description = "A Nix-flake-based PyTorch development environment";
+
+
# CUDA binaries are cached by the community.
+
nixConfig = {
+
extra-substituters = [
+
"https://nix-community.cachix.org"
+
];
+
extra-trusted-public-keys = [
+
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
+
];
+
};
+
+
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz";
+
+
outputs = {
+
self,
+
nixpkgs,
+
}: let
+
supportedSystems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
+
forEachSupportedSystem = f:
+
nixpkgs.lib.genAttrs supportedSystems (system:
+
f {
+
pkgs = import nixpkgs {
+
inherit system;
+
config.allowUnfree = true;
+
};
+
});
+
in {
+
devShells = forEachSupportedSystem ({pkgs}: let
+
libs = [
+
# PyTorch and Numpy depends on the following libraries.
+
pkgs.cudaPackages.cudatoolkit
+
pkgs.cudaPackages.cudnn
+
pkgs.stdenv.cc.cc.lib
+
pkgs.zlib
+
+
# PyTorch also needs to know where your local "lib/libcuda.so" lives.
+
# If you're not on NixOS, you should provide the right path (likely
+
# another one).
+
"/run/opengl-driver"
+
];
+
in {
+
default = pkgs.mkShell {
+
packages = [
+
pkgs.python312
+
pkgs.python312Packages.venvShellHook
+
];
+
+
env = {
+
CC = "${pkgs.gcc}/bin/gcc"; # For `torch.compile`.
+
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath libs;
+
};
+
+
venvDir = ".venv";
+
postVenvCreation = ''
+
# This is run only when creating the virtual environment.
+
pip install torch==2.5.1 numpy==2.2.2
+
'';
+
postShellHook = ''
+
# This is run every time you enter the devShell.
+
python3 -c "import torch; print('CUDA available' if torch.cuda.is_available() else 'CPU only')"
+
'';
+
};
+
});
+
};
+
}
+1
common/services.nix
···
nixos-generators
sqlite
bun
];
services.openssh.enable = true;
···
nixos-generators
sqlite
bun
+
unzip
];
services.openssh.enable = true;
+150 -50
flake.lock
···
"systems": "systems"
},
"locked": {
-
"lastModified": 1750173260,
-
"narHash": "sha256-9P1FziAwl5+3edkfFcr5HeGtQUtrSdk/MksX39GieoA=",
"owner": "ryantm",
"repo": "agenix",
-
"rev": "531beac616433bac6f9e2a19feb8e99a22a66baf",
"type": "github"
},
"original": {
···
"nixpkgs": "nixpkgs_2"
},
"locked": {
-
"lastModified": 1751880463,
-
"narHash": "sha256-aSQllMKqsTYAUp4yhpspZn0Hj5yIj7Mh4UD5iyk5iMM=",
"owner": "catppuccin",
"repo": "nix",
-
"rev": "9474347c69e93e392f194dda7a57c641ba4b998e",
"type": "github"
},
"original": {
···
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems_2"
···
},
"flake-utils_3": {
"inputs": {
-
"systems": "systems_4"
},
"locked": {
"lastModified": 1681202837,
···
]
},
"locked": {
-
"lastModified": 1751824240,
-
"narHash": "sha256-aDDC0CHTlL7QDKWWhdbEgVPK6KwWt+ca0QkmHYZxMzI=",
"owner": "nix-community",
"repo": "home-manager",
-
"rev": "fd9e55f5fac45a26f6169310afca64d56b681935",
"type": "github"
},
"original": {
···
]
},
"locked": {
-
"lastModified": 1743604125,
-
"narHash": "sha256-ZD61DNbsBt1mQbinAaaEqKaJk2RFo9R/j+eYWeGMx7A=",
"owner": "nix-community",
"repo": "home-manager",
-
"rev": "180fd43eea296e62ae68e079fcf56aba268b9a1a",
"type": "github"
},
"original": {
···
"lix": {
"flake": false,
"locked": {
-
"lastModified": 1746827285,
-
"narHash": "sha256-hsFe4Tsqqg4l+FfQWphDtjC79WzNCZbEFhHI8j2KJzw=",
-
"rev": "47aad376c87e2e65967f17099277428e4b3f8e5a",
"type": "tarball",
-
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/47aad376c87e2e65967f17099277428e4b3f8e5a.tar.gz?rev=47aad376c87e2e65967f17099277428e4b3f8e5a"
},
"original": {
"type": "tarball",
-
"url": "https://git.lix.systems/lix-project/lix/archive/2.93.0.tar.gz"
}
},
"lix-module": {
···
]
},
"locked": {
-
"lastModified": 1746838955,
-
"narHash": "sha256-11R4K3iAx4tLXjUs+hQ5K90JwDABD/XHhsM9nkeS5N8=",
-
"rev": "cd2a9c028df820a83ca2807dc6c6e7abc3dfa7fc",
"type": "tarball",
-
"url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/cd2a9c028df820a83ca2807dc6c6e7abc3dfa7fc.tar.gz"
},
"original": {
"type": "tarball",
-
"url": "https://git.lix.systems/lix-project/nixos-module/archive/2.93.0.tar.gz"
}
},
"microvm": {
···
"spectrum": "spectrum"
},
"locked": {
-
"lastModified": 1751732733,
-
"narHash": "sha256-MuaFFGHdShvGdHKrd3PUI2om+njixdG/1dGlglRdK8Q=",
"owner": "astro",
"repo": "microvm.nix",
-
"rev": "9d3d845ccb1a3f81747d027e95b110d4637468d0",
"type": "github"
},
"original": {
···
},
"nixos-hardware": {
"locked": {
-
"lastModified": 1751432711,
-
"narHash": "sha256-136MeWtckSHTN9Z2WRNRdZ8oRP3vyx3L8UxeBYE+J9w=",
"owner": "nixos",
"repo": "nixos-hardware",
-
"rev": "497ae1357f1ac97f1aea31a4cb74ad0d534ef41f",
"type": "github"
},
"original": {
···
},
"nixpkgs": {
"locked": {
-
"lastModified": 1745391562,
-
"narHash": "sha256-sPwcCYuiEopaafePqlG826tBhctuJsLx/mhKKM5Fmjo=",
"owner": "NixOS",
"repo": "nixpkgs",
-
"rev": "8a2f738d9d1f1d986b5a4cd2fd2061a7127237d7",
"type": "github"
},
"original": {
"owner": "NixOS",
-
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
-
"lastModified": 1750776420,
-
"narHash": "sha256-/CG+w0o0oJ5itVklOoLbdn2dGB0wbZVOoDm4np6w09A=",
"owner": "NixOS",
"repo": "nixpkgs",
-
"rev": "30a61f056ac492e3b7cdcb69c1e6abdcf00e39cf",
"type": "github"
},
"original": {
···
},
"nixpkgs_4": {
"locked": {
-
"lastModified": 1751637120,
-
"narHash": "sha256-xVNy/XopSfIG9c46nRmPaKfH1Gn/56vQ8++xWA8itO4=",
"owner": "nixos",
"repo": "nixpkgs",
-
"rev": "1fd8bada0b6117e6c7eb54aad5813023eed37ccb",
"type": "github"
},
"original": {
"owner": "nixos",
-
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
···
"type": "indirect"
}
},
"root": {
"inputs": {
"agenix": "agenix",
···
"microvm": "microvm",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_4",
"vscode-server": "vscode-server",
"zen-browser": "zen-browser"
}
···
"spectrum": {
"flake": false,
"locked": {
-
"lastModified": 1751265943,
-
"narHash": "sha256-XoHSo6GEElzRUOYAEg/jlh5c8TDsyDESFIux3nU/NMc=",
"ref": "refs/heads/main",
-
"rev": "37c8663fab86fdb202fece339ef7ac7177ffc201",
-
"revCount": 904,
"type": "git",
"url": "https://spectrum-os.org/git/spectrum"
},
···
"type": "github"
}
},
"vscode-server": {
"inputs": {
"flake-utils": "flake-utils_3",
"nixpkgs": "nixpkgs_5"
},
"locked": {
-
"lastModified": 1750353031,
-
"narHash": "sha256-Bx7DOPLhkr8Z60U9Qw4l0OidzHoqLDKQH5rDV5ef59A=",
"owner": "nix-community",
"repo": "nixos-vscode-server",
-
"rev": "4ec4859b12129c0436b0a471ed1ea6dd8a317993",
"type": "github"
},
"original": {
···
]
},
"locked": {
-
"lastModified": 1751858709,
-
"narHash": "sha256-xghd1GDPRSa6aD6tEk2JCuQDZWdHITlCA/stwSVoZJQ=",
"owner": "0xc000022070",
"repo": "zen-browser-flake",
-
"rev": "216dd333fa41aa013bf8aab9322d7c1a2aee5b4a",
"type": "github"
},
"original": {
···
"systems": "systems"
},
"locked": {
+
"lastModified": 1760836749,
+
"narHash": "sha256-wyT7Pl6tMFbFrs8Lk/TlEs81N6L+VSybPfiIgzU8lbQ=",
"owner": "ryantm",
"repo": "agenix",
+
"rev": "2f0f812f69f3eb4140157fe15e12739adf82e32a",
"type": "github"
},
"original": {
···
"nixpkgs": "nixpkgs_2"
},
"locked": {
+
"lastModified": 1760953099,
+
"narHash": "sha256-sOKx2YcHa+lWEvaEOIGqLN2WWk1Wf5z6KM02tdfhMtw=",
"owner": "catppuccin",
"repo": "nix",
+
"rev": "f5b21876888265d2fee7fb0640d1b66a1c1c6503",
"type": "github"
},
"original": {
···
"type": "github"
}
},
+
"flake-compat": {
+
"locked": {
+
"lastModified": 1696426674,
+
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
+
"owner": "edolstra",
+
"repo": "flake-compat",
+
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
+
"type": "github"
+
},
+
"original": {
+
"owner": "edolstra",
+
"repo": "flake-compat",
+
"type": "github"
+
}
+
},
"flake-utils": {
"inputs": {
"systems": "systems_2"
···
},
"flake-utils_3": {
"inputs": {
+
"systems": "systems_5"
},
"locked": {
"lastModified": 1681202837,
···
]
},
"locked": {
+
"lastModified": 1761235135,
+
"narHash": "sha256-cux9xeceLIER1lBxUa1gMafkz7gg5ntcUmJBynWdBWI=",
"owner": "nix-community",
"repo": "home-manager",
+
"rev": "0adf9ba3f567da2d53af581a857aacf671aaa547",
"type": "github"
},
"original": {
···
]
},
"locked": {
+
"lastModified": 1752603129,
+
"narHash": "sha256-S+wmHhwNQ5Ru689L2Gu8n1OD6s9eU9n9mD827JNR+kw=",
"owner": "nix-community",
"repo": "home-manager",
+
"rev": "e8c19a3cec2814c754f031ab3ae7316b64da085b",
"type": "github"
},
"original": {
···
"lix": {
"flake": false,
"locked": {
+
"lastModified": 1753223229,
+
"narHash": "sha256-tkT4aCZZE6IEmjYotOzKKa2rV3pGpH3ZREeQn7ACgdU=",
+
"rev": "7ac20fc47cf2f1b7469c7a2f379e5a3a51a6789a",
"type": "tarball",
+
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/7ac20fc47cf2f1b7469c7a2f379e5a3a51a6789a.tar.gz?rev=7ac20fc47cf2f1b7469c7a2f379e5a3a51a6789a"
},
"original": {
"type": "tarball",
+
"url": "https://git.lix.systems/lix-project/lix/archive/release-2.93.tar.gz"
}
},
"lix-module": {
···
]
},
"locked": {
+
"lastModified": 1753282722,
+
"narHash": "sha256-KYMUrTV7H/RR5/HRnjV5R3rRIuBXMemyJzTLi50NFTs=",
+
"rev": "46a9e8fcfe4be72b4c7c8082ee11d2c42da1e873",
"type": "tarball",
+
"url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/46a9e8fcfe4be72b4c7c8082ee11d2c42da1e873.tar.gz?rev=46a9e8fcfe4be72b4c7c8082ee11d2c42da1e873"
},
"original": {
"type": "tarball",
+
"url": "https://git.lix.systems/lix-project/nixos-module/archive/2.93.3-1.tar.gz"
}
},
"microvm": {
···
"spectrum": "spectrum"
},
"locked": {
+
"lastModified": 1760574296,
+
"narHash": "sha256-S3gIp6Wd9vQ2RYDxcbHM2CIYgDtogbwzSdu38WABKaQ=",
"owner": "astro",
"repo": "microvm.nix",
+
"rev": "42628f7c61b02d385ce2cb1f66f9be333ac20140",
"type": "github"
},
"original": {
···
},
"nixos-hardware": {
"locked": {
+
"lastModified": 1760958188,
+
"narHash": "sha256-2m1S4jl+GEDtlt2QqeHil8Ny456dcGSKJAM7q3j/BFU=",
"owner": "nixos",
"repo": "nixos-hardware",
+
"rev": "d6645c340ef7d821602fd2cd199e8d1eed10afbc",
"type": "github"
},
"original": {
···
},
"nixpkgs": {
"locked": {
+
"lastModified": 1754028485,
+
"narHash": "sha256-IiiXB3BDTi6UqzAZcf2S797hWEPCRZOwyNThJIYhUfk=",
"owner": "NixOS",
"repo": "nixpkgs",
+
"rev": "59e69648d345d6e8fef86158c555730fa12af9de",
"type": "github"
},
"original": {
"owner": "NixOS",
+
"ref": "nixos-25.05",
+
"repo": "nixpkgs",
+
"type": "github"
+
}
+
},
+
"nixpkgs-stable": {
+
"locked": {
+
"lastModified": 1748437600,
+
"narHash": "sha256-hYKMs3ilp09anGO7xzfGs3JqEgUqFMnZ8GMAqI6/k04=",
+
"owner": "NixOS",
"repo": "nixpkgs",
+
"rev": "7282cb574e0607e65224d33be8241eae7cfe0979",
"type": "github"
+
},
+
"original": {
+
"id": "nixpkgs",
+
"ref": "nixos-25.05",
+
"type": "indirect"
+
}
+
},
+
"nixpkgs-unstable": {
+
"locked": {
+
"lastModified": 1723637854,
+
"narHash": "sha256-med8+5DSWa2UnOqtdICndjDAEjxr5D7zaIiK4pn0Q7c=",
+
"owner": "NixOS",
+
"repo": "nixpkgs",
+
"rev": "c3aa7b8938b17aebd2deecf7be0636000d62a2b9",
+
"type": "github"
+
},
+
"original": {
+
"id": "nixpkgs",
+
"ref": "nixos-unstable",
+
"type": "indirect"
}
},
"nixpkgs_2": {
"locked": {
+
"lastModified": 1760524057,
+
"narHash": "sha256-EVAqOteLBFmd7pKkb0+FIUyzTF61VKi7YmvP1tw4nEw=",
"owner": "NixOS",
"repo": "nixpkgs",
+
"rev": "544961dfcce86422ba200ed9a0b00dd4b1486ec5",
"type": "github"
},
"original": {
···
},
"nixpkgs_4": {
"locked": {
+
"lastModified": 1761016216,
+
"narHash": "sha256-G/iC4t/9j/52i/nm+0/4ybBmAF4hzR8CNHC75qEhjHo=",
"owner": "nixos",
"repo": "nixpkgs",
+
"rev": "481cf557888e05d3128a76f14c76397b7d7cc869",
"type": "github"
},
"original": {
"owner": "nixos",
+
"ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}
···
"type": "indirect"
}
},
+
"proxmox-nixos": {
+
"inputs": {
+
"flake-compat": "flake-compat",
+
"nixpkgs-stable": "nixpkgs-stable",
+
"nixpkgs-unstable": "nixpkgs-unstable",
+
"utils": "utils"
+
},
+
"locked": {
+
"lastModified": 1758650077,
+
"narHash": "sha256-ZeRtJimtk0Faiq7DPZEQNGipda3TaR4QXp0TAzu934Q=",
+
"owner": "SaumonNet",
+
"repo": "proxmox-nixos",
+
"rev": "ce8768f43b4374287cd8b88d8fa9c0061e749d9a",
+
"type": "github"
+
},
+
"original": {
+
"owner": "SaumonNet",
+
"repo": "proxmox-nixos",
+
"type": "github"
+
}
+
},
"root": {
"inputs": {
"agenix": "agenix",
···
"microvm": "microvm",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_4",
+
"proxmox-nixos": "proxmox-nixos",
"vscode-server": "vscode-server",
"zen-browser": "zen-browser"
}
···
"spectrum": {
"flake": false,
"locked": {
+
"lastModified": 1759482047,
+
"narHash": "sha256-H1wiXRQHxxPyMMlP39ce3ROKCwI5/tUn36P8x6dFiiQ=",
"ref": "refs/heads/main",
+
"rev": "c5d5786d3dc938af0b279c542d1e43bce381b4b9",
+
"revCount": 996,
"type": "git",
"url": "https://spectrum-os.org/git/spectrum"
},
···
"type": "github"
}
},
+
"systems_5": {
+
"locked": {
+
"lastModified": 1681028828,
+
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+
"owner": "nix-systems",
+
"repo": "default",
+
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+
"type": "github"
+
},
+
"original": {
+
"owner": "nix-systems",
+
"repo": "default",
+
"type": "github"
+
}
+
},
+
"utils": {
+
"inputs": {
+
"systems": "systems_4"
+
},
+
"locked": {
+
"lastModified": 1710146030,
+
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
+
"owner": "numtide",
+
"repo": "flake-utils",
+
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
+
"type": "github"
+
},
+
"original": {
+
"owner": "numtide",
+
"repo": "flake-utils",
+
"type": "github"
+
}
+
},
"vscode-server": {
"inputs": {
"flake-utils": "flake-utils_3",
"nixpkgs": "nixpkgs_5"
},
"locked": {
+
"lastModified": 1753541826,
+
"narHash": "sha256-foGgZu8+bCNIGeuDqQ84jNbmKZpd+JvnrL2WlyU4tuU=",
"owner": "nix-community",
"repo": "nixos-vscode-server",
+
"rev": "6d5f074e4811d143d44169ba4af09b20ddb6937d",
"type": "github"
},
"original": {
···
]
},
"locked": {
+
"lastModified": 1761180075,
+
"narHash": "sha256-V4WLeUQ4gCGZiVihlXWBOZ/1FNcL0jM4zgTY1haJLvY=",
"owner": "0xc000022070",
"repo": "zen-browser-flake",
+
"rev": "771a2604606905d8c0ffe3b818dc2cc5bd1405d8",
"type": "github"
},
"original": {
+17 -3
flake.nix
···
# flake.nix
{
inputs = {
-
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:nixos/nixos-hardware/master";
lix-module = {
-
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.93.0.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
};
···
./hosts/valefar
lix-module.nixosModules.default
vscode-server.nixosModules.default
-
microvm.nixosModules.host
{ imports = builtins.attrValues nixosModules; }
];
};
···
# flake.nix
{
inputs = {
+
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
nixos-hardware.url = "github:nixos/nixos-hardware/master";
+
proxmox-nixos.url = "github:SaumonNet/proxmox-nixos";
+
lix-module = {
+
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.93.3-1.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
};
···
./hosts/valefar
lix-module.nixosModules.default
vscode-server.nixosModules.default
+
proxmox-nixos.nixosModules.proxmox-ve
+
+
({ pkgs, lib, ... }: {
+
services.proxmox-ve = {
+
enable = true;
+
ipAddress = "10.0.0.30";
+
};
+
+
nixpkgs.overlays = [
+
proxmox-nixos.overlays.x86_64-linux
+
];
+
})
+
{ imports = builtins.attrValues nixosModules; }
];
};
+16
hosts/baal/default.nix
···
networkmanager.enable = true;
};
virtualisation.docker = {
enable = true;
enableOnBoot = true;
···
networkmanager.enable = true;
};
+
services.fail2ban = {
+
enable = true;
+
# Ban IP after 5 failures
+
maxretry = 5;
+
ignoreIP = [
+
"10.0.0.0/8" "172.16.0.0/12" "192.168.0.0/16" "100.64.0.0/10"
+
];
+
bantime = "24h"; # Ban IPs for one day on the first ban
+
bantime-increment = {
+
enable = true; # Enable increment of bantime after each violation
+
multipliers = "1 2 4 8 16 32 64";
+
maxtime = "168h"; # Do not ban for more than 1 week
+
overalljails = true; # Calculate the bantime based on all the violations
+
};
+
};
+
virtualisation.docker = {
enable = true;
enableOnBoot = true;
+16
hosts/buer/default.nix
···
useDHCP = false;
};
# Static IP configuration via systemd-networkd
systemd.network = {
enable = true;
···
useDHCP = false;
};
+
services.fail2ban = {
+
enable = true;
+
# Ban IP after 5 failures
+
maxretry = 5;
+
ignoreIP = [
+
"10.0.0.0/8" "172.16.0.0/12" "192.168.0.0/16" "100.64.0.0/10"
+
];
+
bantime = "24h"; # Ban IPs for one day on the first ban
+
bantime-increment = {
+
enable = true; # Enable increment of bantime after each violation
+
multipliers = "1 2 4 8 16 32 64";
+
maxtime = "168h"; # Do not ban for more than 1 week
+
overalljails = true; # Calculate the bantime based on all the violations
+
};
+
};
+
# Static IP configuration via systemd-networkd
systemd.network = {
enable = true;
-3
hosts/focalor/default.nix
···
virtualisation.docker = {
enable = true;
enableOnBoot = true;
-
package = pkgs.docker.override {
-
buildGoModule = pkgs.buildGo123Module;
-
};
};
# =============================================================================
···
virtualisation.docker = {
enable = true;
enableOnBoot = true;
};
# =============================================================================
-7
hosts/focalor/vfio.nix
···
package = pkgs.qemu_kvm;
runAsRoot = true;
swtpm.enable = true;
-
ovmf = {
-
enable = true;
-
packages = [(pkgs.OVMF.override {
-
secureBoot = true;
-
tpmSupport = true;
-
}).fd];
-
};
};
hooks.qemu = {
win11 = ./scripts/vm-win11-hook.sh;
···
package = pkgs.qemu_kvm;
runAsRoot = true;
swtpm.enable = true;
};
hooks.qemu = {
win11 = ./scripts/vm-win11-hook.sh;
+29 -10
hosts/valefar/default.nix
···
# IMPORTS
# =============================================================================
imports = [
-
# Host-specific hardware
./hardware.nix
./secrets.nix
../../common/nvidia.nix
-
# Common secrets
../../host-secrets.nix
-
# Common modules shared across hosts
../../common/system.nix
../../common/users.nix
../../common/services.nix
../../common/efi.nix
-
# Hardware-specific (commented out)
../../common/nvidia.nix
];
···
networking.hostId = "2a07da90";
networking.firewall.enable = false;
systemd.network.networks."10-lan" = {
-
matchConfig.Name = ["enp6s0" "vm-*"];
networkConfig = {
-
Bridge = "br0";
};
};
systemd.network.netdevs."br0" = {
netdevConfig = {
-
Name = "br0";
Kind = "bridge";
};
};
systemd.network.networks."10-lan-bridge" = {
-
matchConfig.Name = "br0";
networkConfig = {
Address = ["10.0.0.30/24" "2601:5c2:8400:26c0::30/64"];
Gateway = "10.0.0.1";
···
nodejsPackage = pkgs.nodejs_20;
};
# =============================================================================
# VIRTUALIZATION
# =============================================================================
virtualisation.docker = {
enable = true;
enableOnBoot = true;
-
package = pkgs.docker.override {
-
buildGoModule = pkgs.buildGo123Module;
};
};
···
# IMPORTS
# =============================================================================
imports = [
./hardware.nix
./secrets.nix
../../common/nvidia.nix
../../host-secrets.nix
../../common/system.nix
../../common/users.nix
../../common/services.nix
../../common/efi.nix
../../common/nvidia.nix
];
···
networking.hostId = "2a07da90";
networking.firewall.enable = false;
+
services.proxmox-ve.bridges = [ "vmbr0" ];
+
systemd.network.networks."10-lan" = {
+
matchConfig.Name = ["enp6s0"];
networkConfig = {
+
Bridge = "vmbr0";
};
};
systemd.network.netdevs."br0" = {
netdevConfig = {
+
Name = "vmbr0";
Kind = "bridge";
};
};
systemd.network.networks."10-lan-bridge" = {
+
matchConfig.Name = "vmbr0";
networkConfig = {
Address = ["10.0.0.30/24" "2601:5c2:8400:26c0::30/64"];
Gateway = "10.0.0.1";
···
nodejsPackage = pkgs.nodejs_20;
};
+
services.ollama = {
+
enable = true;
+
loadModels = ["deepseek-r1:1.5b" "gemma3:12b"];
+
acceleration = "cuda";
+
};
+
+
services.open-webui.enable = true;
+
# =============================================================================
# VIRTUALIZATION
# =============================================================================
virtualisation.docker = {
enable = true;
enableOnBoot = true;
+
};
+
+
services.fail2ban = {
+
enable = true;
+
# Ban IP after 5 failures
+
maxretry = 5;
+
ignoreIP = [
+
"10.0.0.0/8" "172.16.0.0/12" "192.168.0.0/16" "100.64.0.0/10"
+
];
+
bantime = "24h"; # Ban IPs for one day on the first ban
+
bantime-increment = {
+
enable = true; # Enable increment of bantime after each violation
+
multipliers = "1 2 4 8 16 32 64";
+
maxtime = "168h"; # Do not ban for more than 1 week
+
overalljails = true; # Calculate the bantime based on all the violations
};
};
-80
hosts/valefar/gamevm.nix
···
-
{ config, lib, pkgs, modulesPath, microvm, inputs, ... }:
-
-
{
-
# =============================================================================
-
# IMPORTS
-
# =============================================================================
-
imports = [
-
# Common modules shared across hosts
-
../../common/system.nix
-
../../common/users.nix
-
../../common/services.nix
-
];
-
-
system.stateVersion = "25.05";
-
networking.hostName = "gameservers";
-
-
virtualisation.docker = {
-
enable = true;
-
enableOnBoot = true;
-
};
-
-
systemd.network.networks."20-lan" = {
-
matchConfig.Type = "ether";
-
networkConfig = {
-
Address = [
-
"10.0.0.31/24"
-
"2601:5c2:8400:26c0::31/64"
-
];
-
Gateway = "10.0.0.1";
-
DNS = [
-
"10.0.0.210"
-
"1.1.1.1"
-
"1.0.0.1"
-
];
-
IPv6AcceptRA = true;
-
DHCP = "no";
-
};
-
};
-
-
systemd.network.networks."19-docker" = {
-
matchConfig.Name = "veth*";
-
linkConfig = {
-
Unmanaged = true;
-
};
-
};
-
-
microvm = {
-
interfaces = [
-
{
-
type = "tap";
-
id = "vm-test1";
-
mac = "02:00:00:00:00:01";
-
}
-
];
-
-
shares = [
-
{
-
source = "/nix/store";
-
mountPoint = "/nix/.ro-store";
-
tag = "ro-store";
-
proto = "virtiofs";
-
}
-
{
-
source = "/etc/ssh";
-
mountPoint = "/etc/ssh";
-
tag = "ssh";
-
proto = "virtiofs";
-
}
-
{
-
source = "/home/regent/gamedata";
-
mountPoint = "/root/gamedata";
-
tag = "gamedata";
-
proto = "virtiofs";
-
}
-
];
-
-
vcpu = 4;
-
mem = 8192;
-
};
-
}
···