From 54b53e5026c8315ef50cee62a782e9074dd1e3eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20K=C3=A4nner?= Date: Mon, 20 May 2024 21:33:04 +0200 Subject: [PATCH] 331 current 1970-01-01 01:00:00 23.11.20240518.e7cc617 6.6.30-rt30 * --- hosts/MaxNixosLaptop/configuration.nix | 4 ---- modules/nixos/bootloader.nix | 21 +++++++++++++++++++++ modules/nixos/default.nix | 4 +++- 3 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 modules/nixos/bootloader.nix 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;