# Written by hand from the CachyOS install, in the shape nixos-generate-config # produces. During the install, compare it with the output of # nixos-generate-config --show-hardware-config --root /mnt # and keep the generated one if they differ. # # Disk layout: the existing btrfs partition is kept. NixOS gets subvolumes of # its own (@nixos for /, @nix for /nix, @nixos-log for /var/log) next to # CachyOS's, and /home is CachyOS's @home, so your files stay where they are. # See MIGRATION.md. { config, lib, modulesPath, ... }: let btrfs = "/dev/disk/by-uuid/6e57f546-3dd3-43f6-9d1b-1c57f3b489ad"; subvol = name: [ "subvol=${name}" "noatime" "compress=zstd" ]; in { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; boot.kernelModules = [ "kvm-amd" ]; fileSystems."/" = { device = btrfs; fsType = "btrfs"; options = subvol "@nixos"; }; fileSystems."/nix" = { device = btrfs; fsType = "btrfs"; options = subvol "@nix"; }; fileSystems."/var/log" = { device = btrfs; fsType = "btrfs"; options = subvol "@nixos-log"; neededForBoot = true; }; fileSystems."/home" = { device = btrfs; fsType = "btrfs"; options = subvol "@home"; }; fileSystems."/boot" = { device = "/dev/disk/by-uuid/DDCE-5209"; fsType = "vfat"; options = [ "fmask=0077" "dmask=0077" ]; }; # The second drive (sdb, ext4) was commented out in CachyOS's fstab too. # fileSystems."/home/vizie/Games" = { # device = "/dev/disk/by-uuid/deadbeef-b2a7-406c-9704-4d07e2f38996"; # fsType = "ext4"; # }; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; }