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.
This commit is contained in:
Florian Klink
2025-07-04 22:03:37 +03:00
parent 6951112e1d
commit e47cbf3942

View File

@@ -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}
''
];