diff --git a/README.md b/README.md index ef1a4ed..26e72c5 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,6 @@ osbmModules = { disko = { enable = true; fileSystem = "zfs"; # options: "zfs", "ext4" - systemd-boot = true; initrd-ssh = { enable = true; ethernetDrivers = [ "igc" ]; diff --git a/hosts/nixos/apollo/configuration.nix b/hosts/nixos/apollo/configuration.nix index 50c9f16..65008b1 100644 --- a/hosts/nixos/apollo/configuration.nix +++ b/hosts/nixos/apollo/configuration.nix @@ -34,7 +34,6 @@ disko = { enable = true; fileSystem = "zfs"; - systemd-boot = true; initrd-ssh = { enable = true; diff --git a/hosts/nixos/tartarus/configuration.nix b/hosts/nixos/tartarus/configuration.nix index 1e5406e..e950159 100644 --- a/hosts/nixos/tartarus/configuration.nix +++ b/hosts/nixos/tartarus/configuration.nix @@ -16,10 +16,6 @@ hardware.sound.enable = true; }; - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - networking.hostName = "tartarus"; # Define your hostname. # Enable networking diff --git a/hosts/nixos/wallfacer/configuration.nix b/hosts/nixos/wallfacer/configuration.nix index 265861e..6026ef1 100644 --- a/hosts/nixos/wallfacer/configuration.nix +++ b/hosts/nixos/wallfacer/configuration.nix @@ -14,8 +14,6 @@ services.cloudflared.enable = true; }; - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; i18n.inputMethod.enable = lib.mkForce false; networking.hostName = "wallfacer"; system.stateVersion = "25.05"; diff --git a/hosts/nixos/ymir/configuration.nix b/hosts/nixos/ymir/configuration.nix index d1e3813..6268864 100644 --- a/hosts/nixos/ymir/configuration.nix +++ b/hosts/nixos/ymir/configuration.nix @@ -21,10 +21,6 @@ i18n.enable = true; }; - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - networking.hostName = "ymir"; # Define your hostname. networking.firewall.allowedTCPPorts = [ diff --git a/modules/nixos/hardware/boot.nix b/modules/nixos/hardware/boot.nix new file mode 100644 index 0000000..18673f0 --- /dev/null +++ b/modules/nixos/hardware/boot.nix @@ -0,0 +1,8 @@ +{config, lib, ...}: + +{ + config = lib.mkIf (config.osbmModules.hardware.systemd-boot.enable) { + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + }; +} \ No newline at end of file diff --git a/modules/nixos/hardware/default.nix b/modules/nixos/hardware/default.nix index d8c30a8..c803909 100644 --- a/modules/nixos/hardware/default.nix +++ b/modules/nixos/hardware/default.nix @@ -1,5 +1,6 @@ { imports = [ + ./boot.nix ./sound.nix ./nvidia.nix ./hibernation.nix diff --git a/modules/nixos/hardware/disko.nix b/modules/nixos/hardware/disko.nix index b8c3324..cba32d1 100644 --- a/modules/nixos/hardware/disko.nix +++ b/modules/nixos/hardware/disko.nix @@ -7,7 +7,6 @@ }: let cfg = config.osbmModules.hardware.disko; - inherit (config.networking) hostName; # Default authorized keys for initrd SSH defaultAuthorizedKeys = [ @@ -27,12 +26,6 @@ in ]; config = lib.mkMerge [ - # Systemd-boot setup - (lib.mkIf (cfg.enable && cfg.systemd-boot) { - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - }) - # Initrd SSH for remote unlocking (lib.mkIf (cfg.enable && cfg.initrd-ssh.enable) { boot.initrd.network.enable = true; diff --git a/modules/nixos/options.nix b/modules/nixos/options.nix index 1b566c3..419e06d 100644 --- a/modules/nixos/options.nix +++ b/modules/nixos/options.nix @@ -185,6 +185,12 @@ }; }; + systemd-boot.enable = lib.mkOption { + type = lib.types.bool; + default = true; + description = "Use systemd-boot bootloader"; + }; + # Disko configuration (inspired by ZFS.nix) disko = { enable = lib.mkOption { @@ -208,12 +214,6 @@ description = "Root filesystem type"; }; - systemd-boot = lib.mkOption { - type = lib.types.bool; - default = true; - description = "Use systemd-boot bootloader"; - }; - initrd-ssh = { enable = lib.mkOption { type = lib.types.bool;