From c8d102b94509ec0614cfecefba57378d73031e1d Mon Sep 17 00:00:00 2001 From: Gerg-L Date: Wed, 2 Aug 2023 18:10:06 -0400 Subject: [PATCH] updated boot settings update pre-commit hook --- .githooks/pre-commit | 4 ++-- hosts/gerg-desktop/disko.nix | 2 +- hosts/gerg-desktop/main.nix | 1 - hosts/gerg-desktop/zfs.nix | 2 ++ modules/boot/misc.nix | 6 +++++- modules/boot/stage2patch.nix | 42 ------------------------------------ 6 files changed, 10 insertions(+), 47 deletions(-) delete mode 100644 modules/boot/stage2patch.nix diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 65afbb1..dc54442 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -1,13 +1,13 @@ #!/usr/bin/env bash -STAGED="$(git diff --name-only --cached | grep "**.nix" | tr '\n' ' ')" +STAGED="$(git diff --name-only --cached --diff-filter=d | grep "**.nix" | tr '\n' ' ')" if [ -z "$STAGED" ]; then exit 0 fi for i in $STAGED; do - statix fix -- "$i" + statix fix -- "$i" done deadnix -qe $STAGED diff --git a/hosts/gerg-desktop/disko.nix b/hosts/gerg-desktop/disko.nix index 44f6912..56a0fa5 100644 --- a/hosts/gerg-desktop/disko.nix +++ b/hosts/gerg-desktop/disko.nix @@ -1,4 +1,4 @@ -{disko, ...}: {...}: { +{disko, ...}: _: { imports = [disko.nixosModules.disko]; disko.devices = { disk = { diff --git a/hosts/gerg-desktop/main.nix b/hosts/gerg-desktop/main.nix index 0cadf8e..852cc1d 100644 --- a/hosts/gerg-desktop/main.nix +++ b/hosts/gerg-desktop/main.nix @@ -149,7 +149,6 @@ boot = { kernelModules = ["amdgpu"]; initrd = { - systemd.enable = true; availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; includeDefaultModules = false; }; diff --git a/hosts/gerg-desktop/zfs.nix b/hosts/gerg-desktop/zfs.nix index 17621dd..be6d9f4 100644 --- a/hosts/gerg-desktop/zfs.nix +++ b/hosts/gerg-desktop/zfs.nix @@ -47,9 +47,11 @@ _: { generationsDir.copyKernels = true; #override default systemd-boot.enable = false; + efi.canTouchEfiVariables = false; grub = { enable = true; copyKernels = true; + efiInstallAsRemovable = true; efiSupport = true; mirroredBoots = [ { diff --git a/modules/boot/misc.nix b/modules/boot/misc.nix index 3a5fc2d..9cefdd4 100644 --- a/modules/boot/misc.nix +++ b/modules/boot/misc.nix @@ -42,7 +42,11 @@ "vt.global_cursor_default=0" ]; consoleLogLevel = 3; - initrd.verbose = false; + initrd = { + verbose = false; + + systemd.enable = true; + }; plymouth = { enable = lib.mkDefault true; theme = "breeze"; diff --git a/modules/boot/stage2patch.nix b/modules/boot/stage2patch.nix deleted file mode 100644 index a12c111..0000000 --- a/modules/boot/stage2patch.nix +++ /dev/null @@ -1,42 +0,0 @@ -{unstable, ...}: { - lib, - config, - pkgs, - ... -}: -#TAKEN FROM https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/system/boot/stage-2.nix -let - useHostResolvConf = config.networking.resolvconf.enable && config.networking.useHostResolvConf; - - bootStage2 = pkgs.substituteAll { - src = pkgs.runCommand "stage-2-init.sh" {} '' - sed '2i exec 1<>/dev/null' ${unstable}/nixos/modules/system/boot/stage-2-init.sh > $out - ''; - shellDebug = "${pkgs.bashInteractive}/bin/bash"; - shell = "${pkgs.bash}/bin/bash"; - inherit (config.boot) readOnlyNixStore systemdExecutable extraSystemdUnitPaths; - inherit (config.system.nixos) distroName; - isExecutable = true; - inherit useHostResolvConf; - inherit (config.system.build) earlyMountScript; - path = lib.makeBinPath ([ - pkgs.coreutils - pkgs.util-linux - ] - ++ lib.optional useHostResolvConf pkgs.openresolv); - postBootCommands = - pkgs.writeText "local-cmds" - '' - ${config.boot.postBootCommands} - ${config.powerManagement.powerUpCommands} - ''; - }; -in { - options.local.bootConfig.stage2patch.disable = lib.mkEnableOption ""; - config = - lib.mkIf (!config.local.bootConfig.stage2patch.disable) - { - system.build.bootStage2 = lib.mkForce bootStage2; - }; - _file = ./stage2patch.nix; -}