From ced6f23a46314b7c2c14b38c80bbed24a143aa91 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Sat, 29 Jun 2024 01:08:28 +0530 Subject: [PATCH] convert rico1 to generic efi boot --- flake.lock | 17 ----------------- flake.nix | 3 --- hosts/rico1/hardware/default.nix | 15 +++++++-------- hosts/rico1/hardware/filesystem.nix | 10 +++++----- hosts/rico1/hardware/kernel.nix | 14 +++++++++++++- hosts/skipper/hardware/kernel.nix | 2 +- 6 files changed, 26 insertions(+), 35 deletions(-) diff --git a/flake.lock b/flake.lock index cffbc0b..985568e 100644 --- a/flake.lock +++ b/flake.lock @@ -434,22 +434,6 @@ "type": "github" } }, - "nixos-hardware": { - "locked": { - "lastModified": 1719487696, - "narHash": "sha256-pCsl9qFCuIuhIfGH03CiBOsy1LNwITC6VMb6/5tz+Qc=", - "owner": "NixOS", - "repo": "nixos-hardware", - "rev": "14aadcba1a26c8c142453839f888afd0db8b2041", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "master", - "repo": "nixos-hardware", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1718541509, @@ -597,7 +581,6 @@ "lanzaboote": "lanzaboote", "lix-module": "lix-module", "neovim-nightly": "neovim-nightly", - "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs_3", "sops-nix": "sops-nix", "varnam-nix": "varnam-nix" diff --git a/flake.nix b/flake.nix index 7f16182..598ee16 100644 --- a/flake.nix +++ b/flake.nix @@ -24,7 +24,6 @@ }; impermanence.url = "github:nix-community/impermanence?ref=master"; lanzaboote.url = "github:nix-community/lanzaboote?ref=master"; - nixos-hardware.url = "github:NixOS/nixos-hardware?ref=master"; sops-nix.url = "github:Mic92/sops-nix?ref=master"; flake-utils.url = "github:numtide/flake-utils"; neovim-nightly.url = "github:nix-community/neovim-nightly-overlay?ref=master"; @@ -38,7 +37,6 @@ , home-manager , impermanence , lanzaboote - , nixos-hardware , sops-nix , flake-utils , neovim-nightly @@ -105,7 +103,6 @@ } lix-module.nixosModules.default sops-nix.nixosModules.sops - nixos-hardware.nixosModules.raspberry-pi-4 ./common ./hosts/rico1 ]; diff --git a/hosts/rico1/hardware/default.nix b/hosts/rico1/hardware/default.nix index 57c26a5..cdacf9a 100644 --- a/hosts/rico1/hardware/default.nix +++ b/hosts/rico1/hardware/default.nix @@ -1,14 +1,13 @@ _: { imports = [ ./filesystem.nix ./kernel.nix ]; - hardware = { - deviceTree = { - enable = true; - }; - raspberry-pi."4" = { - apply-overlays-dtmerge.enable = true; - poe-plus-hat.enable = true; - xhci.enable = true; + hardware.enableRedistributableFirmware = true; + + boot = { + loader = { + efi.canTouchEfiVariables = true; + systemd-boot.enable = true; }; + supportedFilesystems = [ "vfat" "btrfs" "ext4" ]; }; } diff --git a/hosts/rico1/hardware/filesystem.nix b/hosts/rico1/hardware/filesystem.nix index 23c61fb..44dc339 100644 --- a/hosts/rico1/hardware/filesystem.nix +++ b/hosts/rico1/hardware/filesystem.nix @@ -1,34 +1,34 @@ _: { fileSystems = { "/" = { - device = "/dev/disk/by-label/RICO1_ROOT"; + device = "/dev/disk/by-partlabel/RICO1_ROOT"; fsType = "btrfs"; options = [ "subvol=@root" "compress-force=zstd" "noatime" ]; neededForBoot = true; }; "/nix" = { - device = "/dev/disk/by-label/RICO1_ROOT"; + device = "/dev/disk/by-partlabel/RICO1_ROOT"; fsType = "btrfs"; options = [ "subvol=@nix" "compress-force=zstd" "noatime" ]; neededForBoot = true; }; "/persist" = { - device = "/dev/disk/by-label/RICO1_ROOT"; + device = "/dev/disk/by-partlabel/RICO1_ROOT"; fsType = "btrfs"; options = [ "subvol=@persist" "compress-force=zstd" "noatime" ]; neededForBoot = true; }; "/mnt/system" = { - device = "/dev/disk/by-label/RICO1_ROOT"; + device = "/dev/disk/by-partlabel/RICO1_ROOT"; fsType = "btrfs"; options = [ "subvol=/" "compress-force=zstd" "noatime" ]; }; "/boot" = { - device = "/dev/disk/by-label/RICO1_BOOT"; + device = "/dev/disk/by-partlabel/RICO1_BOOT"; fsType = "vfat"; options = [ "fmask=0022" "dmask=0022" ]; }; diff --git a/hosts/rico1/hardware/kernel.nix b/hosts/rico1/hardware/kernel.nix index 799e38c..7445cf6 100644 --- a/hosts/rico1/hardware/kernel.nix +++ b/hosts/rico1/hardware/kernel.nix @@ -1,6 +1,18 @@ { lib +, pkgs , ... }: { - boot.supportedFilesystems = lib.mkForce [ "vfat" "btrfs" "ext4" ]; + boot = { + consoleLogLevel = 3; + kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; + kernel.sysctl = { + "vm.swappiness" = 10; + "vm.dirty_ratio" = 3; + }; + initrd = { + availableKernelModules = ["xhci_pci"]; + systemd.enable = true; + }; + }; powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; } diff --git a/hosts/skipper/hardware/kernel.nix b/hosts/skipper/hardware/kernel.nix index 10fe5ae..b5376e1 100644 --- a/hosts/skipper/hardware/kernel.nix +++ b/hosts/skipper/hardware/kernel.nix @@ -15,7 +15,7 @@ systemd.enable = true; }; kernelModules = [ "kvm-intel" ]; - kernelPackages = lib.mkDefault pkgs.linuxKernel.packages.linux_zen; + kernelPackages = lib.mkDefault pkgs.linuxPackages_zen; kernelParams = [ "quiet" ]; kernel.sysctl = { "vm.swappiness" = 10;