123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- {
- config,
- pkgs,
- lib,
- modulesPath,
- inputs,
- username,
- ...
- }:
- {
- imports = [
- (modulesPath + "/installer/scan/not-detected.nix")
- inputs.lanzaboote.nixosModules.lanzaboote
- ];
- boot = {
- # Lanzaboote currently replaces the systemd-boot module.
- # This setting is usually set to true in configuration.nix
- # generated at installation time. So we force it to false
- # for now.
- loader = {
- systemd-boot.enable = lib.mkForce false;
- systemd-boot.configurationLimit = 5;
- efi.canTouchEfiVariables = true;
- efi.efiSysMountPoint = "/boot";
- };
- lanzaboote = {
- enable = true;
- pkiBundle = "/etc/secureboot";
- };
- kernelPackages = lib.mkForce inputs.chaotic.packages.${pkgs.system}.linuxPackages_cachyos;
- initrd.availableKernelModules = [
- "nvme"
- "xhci_pci"
- "ahci"
- "usb_storage"
- "usbhid"
- "sd_mod"
- ];
- initrd.kernelModules = [
- "amdgpu"
- "bcachefs"
- "dm-snapshot"
- ];
- kernelModules = [ "kvm-amd" ];
- extraModulePackages = [ ];
- supportedFilesystems = [
- "bcachefs"
- "ntfs"
- "xfs"
- ];
- };
- fileSystems =
- let
- inherit username;
- userHome = "/home/${username}";
- in
- {
- "${userHome}/Media" = {
- device = "/dev/disk/by-uuid/9f731a8a-1d76-4b74-ad60-cb2e245d4224";
- fsType = "bcachefs";
- options = [
- # Enable discard/TRIM support
- "discard"
- # foreground compression with zstd
- "compression=zstd"
- # background compression with zstd
- "background_compression=zstd"
- ];
- };
- # "${userHome}/WinE" = {
- # device = "/dev/disk/by-label/WinE";
- # fsType = "ntfs";
- # options = [
- # "uid=1000"
- # "gid=100"
- # "rw"
- # "user"
- # "exec"
- # "umask=000"
- # "nofail"
- # ];
- # };
- "/" = {
- device = "none";
- fsType = "tmpfs";
- options = [
- "defaults"
- "size=2G"
- "mode=755"
- ];
- };
- "/boot" = {
- device = "/dev/disk/by-label/BOOT";
- fsType = "vfat";
- };
- "/nix" = {
- device = "/dev/disk/by-partlabel/Store";
- fsType = "bcachefs";
- options = [
- # Enable discard/TRIM support
- "discard"
- # foreground compression with zstd
- "compression=zstd"
- # background compression with zstd
- "background_compression=zstd"
- ];
- };
- "/home" = {
- device = "/dev/disk/by-partlabel/Home";
- fsType = "bcachefs";
- options = [
- # Enable discard/TRIM support
- "discard"
- # foreground compression with zstd
- "compression=zstd"
- # background compression with zstd
- "background_compression=zstd"
- ];
- neededForBoot = true;
- };
- "/persist" = {
- device = "/dev/disk/by-label/Persist";
- fsType = "xfs";
- neededForBoot = true;
- };
- "/etc/nixos" = {
- device = "/persist/etc/nixos";
- fsType = "none";
- options = [ "bind" ];
- };
- "/var/log" = {
- device = "/persist/var/log";
- fsType = "none";
- options = [ "bind" ];
- };
- };
- swapDevices = [ { device = "/dev/disk/by-label/Swap"; } ];
- # slows down boot time
- systemd.services.NetworkManager-wait-online.enable = false;
- nix.settings.max-jobs = lib.mkDefault 4;
- nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
- # powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
- hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
- }
|