diff --git a/nixos/common/modules/bootloader.nix b/nixos/common/modules/bootloader.nix new file mode 100644 index 00000000..3ef99ca4 --- /dev/null +++ b/nixos/common/modules/bootloader.nix @@ -0,0 +1,7 @@ +{ config, pkgs, ... }: { + # Bootloader + boot.loader.efi.canTouchEfiVariables = true; + boot.tmp.cleanOnBoot = true; + boot.initrd.systemd.enable = true; + boot.kernelParams = ["quiet"]; + } \ No newline at end of file diff --git a/nixos/common/modules/secureboot.nix b/nixos/common/modules/secureboot.nix index 1f0d16a8..70582248 100644 --- a/nixos/common/modules/secureboot.nix +++ b/nixos/common/modules/secureboot.nix @@ -1,4 +1,8 @@ { lib, config, pkgs, ...}: { + + imports = [ ./bootloader.nix ]; + # SecureBoot + boot.loader.systemd-boot.enable = lib.mkForce false; boot.lanzaboote.enable = true; boot.lanzaboote.pkiBundle = "/etc/secureboot"; @@ -7,4 +11,10 @@ # https://github.com/adi1090x/plymouth-themes boot.plymouth.theme = "red_loader"; boot.plymouth.themePackages = [ pkgs.adi1090x-plymouth-themes ]; + + # Bootloader + boot.loader.efi.canTouchEfiVariables = true; + boot.tmp.cleanOnBoot = true; + boot.initrd.systemd.enable = true; + boot.kernelParams = ["quiet"]; } \ No newline at end of file diff --git a/nixos/default.nix b/nixos/default.nix index 8cbc8554..1c1832d0 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -24,15 +24,6 @@ ./hosts/${hostname} ] ++ lib.optional (builtins.isString desktop) ./common/desktops/${desktop}; - # Bootloader - boot.loader.efi.canTouchEfiVariables = true; - boot.tmp.cleanOnBoot = true; - boot.initrd.systemd.enable = true; - boot.kernelParams = ["quiet"]; - - # SecureBoot - boot.loader.systemd-boot.enable = lib.mkForce false; - # List packages installed in system profile environment.systemPackages = with pkgs; [ sbctl diff --git a/nixos/hosts/nixos-vm-02/default.nix b/nixos/hosts/nixos-vm-02/default.nix index 31b82a32..e72c783d 100644 --- a/nixos/hosts/nixos-vm-02/default.nix +++ b/nixos/hosts/nixos-vm-02/default.nix @@ -1,5 +1,9 @@ { config, lib, pkgs, modulesPath, desktop, username, ... }: { - imports = [ ./disks.nix ]; + imports = [ + # This machine won't be using secureboot + ../../common/modules/bootloader.nix + ./disks.nix + ]; nixpkgs.config.allowUnfree = false; boot.initrd.availableKernelModules = [ "ata_piix" "ohci_pci" "ehci_pci" "ahci" "sd_mod" "sr_mod" ];