my nix configs for my servers and desktop
1{ config, lib, pkgs, modulesPath, microvm, inputs, ... }: 2 3{ 4 # ============================================================================= 5 # IMPORTS 6 # ============================================================================= 7 imports = [ 8 # Common modules shared across hosts 9 ../../common/system.nix 10 ../../common/users.nix 11 ../../common/services.nix 12 ]; 13 14 system.stateVersion = "25.05"; 15 networking.hostName = "gameservers"; 16 17 virtualisation.docker = { 18 enable = true; 19 enableOnBoot = true; 20 }; 21 22 systemd.network.networks."20-lan" = { 23 matchConfig.Type = "ether"; 24 networkConfig = { 25 Address = [ 26 "10.0.0.31/24" 27 "2601:5c2:8400:26c0::31/64" 28 ]; 29 Gateway = "10.0.0.1"; 30 DNS = [ 31 "10.0.0.210" 32 "1.1.1.1" 33 "1.0.0.1" 34 ]; 35 IPv6AcceptRA = true; 36 DHCP = "no"; 37 }; 38 }; 39 40 systemd.network.networks."19-docker" = { 41 matchConfig.Name = "veth*"; 42 linkConfig = { 43 Unmanaged = true; 44 }; 45 }; 46 47 microvm = { 48 interfaces = [ 49 { 50 type = "tap"; 51 id = "vm-test1"; 52 mac = "02:00:00:00:00:01"; 53 } 54 ]; 55 56 shares = [ 57 { 58 source = "/nix/store"; 59 mountPoint = "/nix/.ro-store"; 60 tag = "ro-store"; 61 proto = "virtiofs"; 62 } 63 { 64 source = "/etc/ssh"; 65 mountPoint = "/etc/ssh"; 66 tag = "ssh"; 67 proto = "virtiofs"; 68 } 69 { 70 source = "/home/regent/gamedata"; 71 mountPoint = "/root/gamedata"; 72 tag = "gamedata"; 73 proto = "virtiofs"; 74 } 75 ]; 76 77 vcpu = 4; 78 mem = 8192; 79 }; 80}