my nixos/home-manager configuration
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

add server nixos config

youn 542ce888 e3a17f86

+157
+21
flake.lock
··· 61 61 "type": "github" 62 62 } 63 63 }, 64 + "disko": { 65 + "inputs": { 66 + "nixpkgs": [ 67 + "nixpkgs" 68 + ] 69 + }, 70 + "locked": { 71 + "lastModified": 1751854533, 72 + "narHash": "sha256-U/OQFplExOR1jazZY4KkaQkJqOl59xlh21HP9mI79Vc=", 73 + "owner": "nix-community", 74 + "repo": "disko", 75 + "rev": "16b74a1e304197248a1bc663280f2548dbfcae3c", 76 + "type": "github" 77 + }, 78 + "original": { 79 + "owner": "nix-community", 80 + "repo": "disko", 81 + "type": "github" 82 + } 83 + }, 64 84 "flake-parts": { 65 85 "inputs": { 66 86 "nixpkgs-lib": [ ··· 235 255 "inputs": { 236 256 "agenix": "agenix", 237 257 "betterfox": "betterfox", 258 + "disko": "disko", 238 259 "home-manager": "home-manager_2", 239 260 "nixos-hardware": "nixos-hardware", 240 261 "nixpkgs": "nixpkgs",
+12
flake.nix
··· 11 11 inputs.nixpkgs.follows = "nixpkgs"; 12 12 }; 13 13 14 + disko = { 15 + url = "github:nix-community/disko"; 16 + inputs.nixpkgs.follows = "nixpkgs"; 17 + }; 18 + 14 19 nur = { 15 20 url = "github:nix-community/nur"; 16 21 inputs.nixpkgs.follows = "nixpkgs"; ··· 39 44 nixpkgs-graalvm-21, 40 45 nixos-hardware, 41 46 home-manager, 47 + disko, 42 48 nur, 43 49 agenix, 44 50 ... ··· 121 127 specialArgs = { 122 128 inherit inputs; 123 129 inherit user; 130 + inherit ssh; 124 131 inherit fonts; 125 132 }; 126 133 ··· 157 164 "laptop" = mkNixosSystem [ 158 165 ./nixos/laptop 159 166 nixos-hardware.nixosModules.framework-12th-gen-intel 167 + ]; 168 + # 169 + "server" = mkNixosSystem [ 170 + disko.nixosModules.disko 171 + ./nixos/server 160 172 ]; 161 173 "clever-cloud" = mkNixosSystem [ 162 174 ./nixos/clever-cloud
+32
nixos/server/default.nix
··· 1 + { 2 + modulesPath, 3 + pkgs, 4 + lib, 5 + ssh, 6 + ... 7 + }: 8 + 9 + { 10 + imports = [ 11 + ./hardware-configuration.nix 12 + (modulesPath + "/installer/scan/not-detected.nix") 13 + (modulesPath + "/profiles/qemu-guest.nix") 14 + ./disk-config.nix 15 + ]; 16 + boot.loader.grub = { 17 + # no need to set devices, disko will add all devices that have a EF02 partition to the list already 18 + # devices = [ ]; 19 + efiSupport = true; 20 + efiInstallAsRemovable = true; 21 + }; 22 + services.openssh.enable = true; 23 + 24 + environment.systemPackages = map lib.lowPrio [ 25 + pkgs.curl 26 + pkgs.gitMinimal 27 + ]; 28 + 29 + users.users.root.openssh.authorizedKeys.keys = [ ssh.public.text ]; 30 + 31 + system.stateVersion = "25.05"; 32 + }
+56
nixos/server/disk-config.nix
··· 1 + { lib, ... }: 2 + 3 + { 4 + disko.devices = { 5 + disk.disk1 = { 6 + device = lib.mkDefault "/dev/sda"; 7 + type = "disk"; 8 + content = { 9 + type = "gpt"; 10 + partitions = { 11 + boot = { 12 + name = "boot"; 13 + size = "1M"; 14 + type = "EF02"; 15 + }; 16 + esp = { 17 + name = "ESP"; 18 + size = "500M"; 19 + type = "EF00"; 20 + content = { 21 + type = "filesystem"; 22 + format = "vfat"; 23 + mountpoint = "/boot"; 24 + }; 25 + }; 26 + root = { 27 + name = "root"; 28 + size = "100%"; 29 + content = { 30 + type = "lvm_pv"; 31 + vg = "pool"; 32 + }; 33 + }; 34 + }; 35 + }; 36 + }; 37 + lvm_vg = { 38 + pool = { 39 + type = "lvm_vg"; 40 + lvs = { 41 + root = { 42 + size = "100%FREE"; 43 + content = { 44 + type = "filesystem"; 45 + format = "ext4"; 46 + mountpoint = "/"; 47 + mountOptions = [ 48 + "defaults" 49 + ]; 50 + }; 51 + }; 52 + }; 53 + }; 54 + }; 55 + }; 56 + }
+36
nixos/server/hardware-configuration.nix
··· 1 + # Do not modify this file! It was generated by ‘nixos-generate-config’ 2 + # and may be overwritten by future invocations. Please make changes 3 + # to /etc/nixos/configuration.nix instead. 4 + { 5 + config, 6 + lib, 7 + modulesPath, 8 + ... 9 + }: 10 + 11 + { 12 + imports = [ 13 + (modulesPath + "/installer/scan/not-detected.nix") 14 + ]; 15 + 16 + boot.initrd.availableKernelModules = [ 17 + "ehci_pci" 18 + "ahci" 19 + "usbhid" 20 + "sd_mod" 21 + ]; 22 + boot.initrd.kernelModules = [ ]; 23 + boot.kernelModules = [ "kvm-intel" ]; 24 + boot.extraModulePackages = [ ]; 25 + 26 + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking 27 + # (the default) this is the recommended approach. When using systemd-networkd it's 28 + # still possible to use this option, but it's recommended to use it in conjunction 29 + # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`. 30 + networking.useDHCP = lib.mkDefault true; 31 + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; 32 + # networking.interfaces.eno2.useDHCP = lib.mkDefault true; 33 + 34 + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; 35 + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 36 + }