diff --git a/README.md b/README.md index 1482d71..bc603dd 100644 --- a/README.md +++ b/README.md @@ -57,11 +57,11 @@ Add a symlink as the global configuration sudo mkdir -p /mnt/etc/nixos/ sudo ln -s /mnt/home/simon/nixos/machines/nunotaba/configuration.nix /mnt/etc/nixos/configuration.nix -Generate hardware configuration and link it to the installation system -(symlinking required because of absolute paths) +Generate hardware configuration and copy hardware configuration to machine +configuration sudo nixos-generate-config --root /mnt/ - sudo ln -s /mnt/etc/nixos/hardware-configuration.nix /etc/nixos/hardware-configuration.nix + sudo cp /mnt/etc/nixos/hardware-configuration.nix /mnt/home/simon/nixos/machines/nunotaba/hardware-configuration.nix Install NixOS and reboot (if you do not have another machine, omit `--no-root-passwd`) @@ -74,12 +74,11 @@ didn’t work, first open the luks partition like in the setup script, run `sudo vgchange -ay` to scan for LVM VGs and then mount the other filesystems like in the script. -SSH into the machine (or login locally if you set a root password), fix the -`configuration.nix` symlink, set a user password and clone the dotfiles +SSH into the machine (or login locally if you set a root password), set a user +password and clone the dotfiles ssh root@machine rm /etc/nixos/configuration.nix - ln -s /home/simon/nixos/machines/nunotaba/configuration.nix /etc/nixos/configuration.nix passwd simon ^D ssh simon@machine diff --git a/machines/nunotaba/configuration.nix b/machines/nunotaba/configuration.nix index 9276d11..da5a5de 100644 --- a/machines/nunotaba/configuration.nix +++ b/machines/nunotaba/configuration.nix @@ -3,7 +3,7 @@ { imports = [ - /etc/nixos/hardware-configuration.nix + ./hardware-configuration.nix ../../modules/restic.nix ../../modules/texlive.nix ../../profiles/base.nix diff --git a/machines/nunotaba/hardware-configuration.nix b/machines/nunotaba/hardware-configuration.nix new file mode 100644 index 0000000..d637a6f --- /dev/null +++ b/machines/nunotaba/hardware-configuration.nix @@ -0,0 +1,33 @@ +{ config, lib, pkgs, ... }: + +{ + imports = + [ + + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = []; + + fileSystems."/" = + { + device = "/dev/disk/by-uuid/8937d1ac-23cb-456f-9c16-e348acc66bb7"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { + device = "/dev/disk/by-uuid/da2e90cc-1e0c-4691-8807-5d2f4858df6e"; + fsType = "ext2"; + }; + + swapDevices = + [ + { device = "/dev/disk/by-uuid/b9ad2d56-fee0-49df-98c1-00d93d991b9f"; } + ]; + + nix.maxJobs = lib.mkDefault 4; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; +}