From e47cbf3942da373f1b0cba256ad08d38eab1ec6b Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 4 Jul 2025 22:03:37 +0300 Subject: [PATCH] nixos/systemd/repart: add extraArgs option There's lots of options regarding dm-crypt, dm-verity and TPMs. Creating individual NixOS options for all of them would be infeasible. --- nixos/modules/system/boot/systemd/repart.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nixos/modules/system/boot/systemd/repart.nix b/nixos/modules/system/boot/systemd/repart.nix index b7ca00cf6a03..1240ee3244d1 100644 --- a/nixos/modules/system/boot/systemd/repart.nix +++ b/nixos/modules/system/boot/systemd/repart.nix @@ -85,6 +85,16 @@ in ''; default = true; }; + + extraArgs = lib.mkOption { + description = '' + Extra command-line arguments to pass to systemd-repart. + + See {manpage}`systemd-repart(8)` for all available options. + ''; + type = lib.types.listOf lib.types.str; + default = [ ]; + }; }; systemd.repart = { @@ -177,6 +187,7 @@ in --dry-run=no \ --empty=${initrdCfg.empty} \ --discard=${lib.boolToString initrdCfg.discard} \ + ${utils.escapeSystemdExecArgs initrdCfg.extraArgs} \ ${lib.optionalString (initrdCfg.device != null) initrdCfg.device} '' ];