summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornikstur <nikstur@outlook.com>2025-07-27 23:49:14 +0200
committernikstur <nikstur@outlook.com>2025-08-10 22:43:34 +0200
commit9e0ac0c7e644b03836180d2f791f8d60b80c5a2d (patch)
treeee3a673af2146241813e7e6cddc9d57fccdaf76c
parentnixos/bash: re-introduce enable option (diff)
downloadnixpkgs-9e0ac0c7e644b03836180d2f791f8d60b80c5a2d.tar.gz
nixos/kexec: add enable option
It is still enabled by default but now you can actively exclude it if you don't need it.
-rw-r--r--nixos/modules/system/boot/kexec.nix19
1 files changed, 17 insertions, 2 deletions
diff --git a/nixos/modules/system/boot/kexec.nix b/nixos/modules/system/boot/kexec.nix
index 580ccab5e29e..9a4818d874dd 100644
--- a/nixos/modules/system/boot/kexec.nix
+++ b/nixos/modules/system/boot/kexec.nix
@@ -1,7 +1,22 @@
-{ pkgs, lib, ... }:
+{
+ config,
+ pkgs,
+ lib,
+ ...
+}:
+let
+ cfg = config.boot.kexec;
+in
{
- config = lib.mkIf (lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.kexec-tools) {
+ options.boot.kexec = {
+ enable = lib.mkEnableOption "kexec" // {
+ default = lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.kexec-tools;
+ defaultText = lib.literalExpression ''lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.kexec-tools'';
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
environment.systemPackages = [ pkgs.kexec-tools ];
systemd.services.prepare-kexec = {