diff --git a/hosts/MaxNixosLaptop/configuration.nix b/hosts/MaxNixosLaptop/configuration.nix index b00bb4f..1383310 100644 --- a/hosts/MaxNixosLaptop/configuration.nix +++ b/hosts/MaxNixosLaptop/configuration.nix @@ -32,10 +32,6 @@ ]; }; - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - networking.hostName = "MaxNixosLaptop"; # Define your hostname. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. diff --git a/modules/nixos/bootloader.nix b/modules/nixos/bootloader.nix new file mode 100644 index 0000000..1257483 --- /dev/null +++ b/modules/nixos/bootloader.nix @@ -0,0 +1,21 @@ +{ + lib, + config, + ... +}: let + cfg = config.myConfig.bootloader; +in { + options.myConfig.bootloader = { + enable = lib.mkEnableOption "enable systemd bootloader"; + }; + + config = lib.mkIf cfg.enable { + boot.loader = { + timeout = 0; + systemd-boot.enable = true; + systemd-boot.memtest86.enable = true; + systemd-boot.editor = false; + efi.canTouchEfiVariables = true; + }; + }; +} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index bdad4fe..295aa0e 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -5,14 +5,16 @@ }: let cfg = config.myConfig; in { + imports = [./bootloader.nix ./greetd.nix ./rebuild.nix ./sops.nix ./sway.nix ./wifi.nix ./music.nix]; + options.myConfig = { enable = lib.mkEnableOption "my custom config"; desktop = lib.mkEnableOption "custom config with desktop support"; laptop = lib.mkEnableOption "extra stuff for laptops like wifi"; }; - imports = [./greetd.nix ./rebuild.nix ./sops.nix ./sway.nix ./wifi.nix ./music.nix]; config.myConfig = lib.mkIf cfg.enable { + bootloader.enable = true; rebuild.enable = true; greetd.enable = lib.mkIf cfg.desktop true;