my nix configs for my servers and desktop
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{ config, lib, pkgs, modulesPath, ... }:
5
6{
7 imports =
8 [ (modulesPath + "/installer/scan/not-detected.nix")
9 ];
10
11 boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "uas" "usbhid" "sd_mod" ];
12# boot.initrd.kernelModules = [ "vfio" "vfio_iommu_type1" "vfio_pci" ];
13 boot.kernelModules = [ "kvm-amd" ];
14 boot.kernelParams = [
15 "amd_iommu=on"
16# "vfio-pci.ids=10de:2484,10de228b,1022:149c,15b7:5045,1dbe:5236,1022:149c"
17 ];
18 boot.extraModulePackages = [ ];
19
20 fileSystems."/" =
21 { device = "/dev/disk/by-uuid/5d42a325-ba0d-4d40-906b-d28603b433ef";
22 fsType = "ext4";
23 };
24
25 fileSystems."/boot" =
26 { device = "/dev/disk/by-uuid/404A-728D";
27 fsType = "vfat";
28 options = [ "fmask=0022" "dmask=0022" ];
29 };
30
31 swapDevices = [ ];
32
33 # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
34 # (the default) this is the recommended approach. When using systemd-networkd it's
35 # still possible to use this option, but it's recommended to use it in conjunction
36 # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
37 # networking.useDHCP = lib.mkDefault true;
38 # networking.interfaces.enp5s0.useDHCP = lib.mkDefault true;
39 # networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true;
40
41 nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
42 hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
43}