my nix configs for my servers and desktop
1# hosts/buer/configuration.nix (or default.nix)
2{ config, lib, pkgs, modulesPath, inputs, ... }:
3{
4 # =============================================================================
5 # IMPORTS
6 # =============================================================================
7 imports = [
8 # Host-specific hardware
9 ./hardware.nix
10 ./secrets.nix
11
12 # Common modules shared across hosts
13 ../../common/system.nix
14 ../../common/users.nix
15 ../../common/services.nix
16
17 # Common secrets
18 ../../host-secrets.nix
19 ];
20
21 # =============================================================================
22 # SYSTEM CONFIGURATION
23 # =============================================================================
24 system.stateVersion = "24.11";
25 nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
26
27 # Intel microcode updates
28 hardware.cpu.intel.updateMicrocode = lib.mkDefault
29 config.hardware.enableRedistributableFirmware;
30
31 # =============================================================================
32 # CUSTOM MODULES
33 # =============================================================================
34 modules.garage.enable = true;
35 modules.seaweedfs.clusters.default = {
36 package = pkgs.seaweedfs;
37
38 masters.main = {
39 openFirewall = true;
40 ip = "fs.nkp.pet";
41 volumePreallocate = true;
42
43 defaultReplication = {
44 dataCenter = 0;
45 rack = 0;
46 server = 0;
47 };
48 };
49 };
50
51 # =============================================================================
52 # BOOT CONFIGURATION
53 # =============================================================================
54 boot.loader.grub = {
55 enable = true;
56 device = "/dev/vda";
57 };
58
59 # =============================================================================
60 # NETWORKING
61 # =============================================================================
62 networking = {
63 hostName = "buer";
64 hostId = "1418d29e";
65 firewall.enable = false;
66 useDHCP = false;
67 };
68
69 # Static IP configuration via systemd-networkd
70 systemd.network = {
71 enable = true;
72 networks."10-wan" = {
73 matchConfig.Name = "ens3";
74 address = [
75 "103.251.165.107/24"
76 "2a04:52c0:0135:48d1::2/48"
77 ];
78 gateway = [
79 "103.251.165.1"
80 "2a04:52c0:0135::1"
81 ];
82 dns = [
83 "2a01:6340:1:20:4::10"
84 "2a04:52c0:130:2a5c::10"
85 "185.31.172.240"
86 "5.255.125.240"
87 ];
88 };
89 };
90
91 # =============================================================================
92 # VIRTUALIZATION
93 # =============================================================================
94 virtualisation.docker = {
95 enable = true;
96 enableOnBoot = true;
97 };
98
99 # =============================================================================
100 # PACKAGES
101 # =============================================================================
102 environment.systemPackages = with pkgs; [
103 inputs.agenix.packages.x86_64-linux.default
104 ];
105
106 # =============================================================================
107 # COMMENTED OUT / DISABLED
108 # =============================================================================
109 # ZFS support (not needed for this VPS)
110 # boot.supportedFilesystems = [ "zfs" ];
111 # boot.kernelModules = [ "nct6775" "coretemp" ];
112 # services.zfs.autoScrub.enable = true;
113 # services.zfs.trim.enable = true;
114
115 # Additional packages (not needed)
116 # lm_sensors
117 # code-server
118}