mirror of
https://github.com/TECHNOFAB11/disko.git
synced 2025-12-12 08:00:05 +01:00
luks: add initrdUnlock option to luks type (#233)
This commit is contained in:
parent
834b7b2a33
commit
13665a836f
1 changed files with 9 additions and 5 deletions
|
|
@ -16,6 +16,11 @@
|
||||||
description = "Path to the key for encryption";
|
description = "Path to the key for encryption";
|
||||||
example = "/tmp/disk.key";
|
example = "/tmp/disk.key";
|
||||||
};
|
};
|
||||||
|
initrdUnlock = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Whether to add a boot.initrd.luks.devices entry for the specified disk.";
|
||||||
|
};
|
||||||
extraFormatArgs = lib.mkOption {
|
extraFormatArgs = lib.mkOption {
|
||||||
type = lib.types.listOf lib.types.str;
|
type = lib.types.listOf lib.types.str;
|
||||||
default = [ ];
|
default = [ ];
|
||||||
|
|
@ -63,11 +68,10 @@
|
||||||
_config = lib.mkOption {
|
_config = lib.mkOption {
|
||||||
internal = true;
|
internal = true;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
default = dev:
|
default = dev: [ ]
|
||||||
[
|
# If initrdUnlock is true, then add a device entry to the initrd.luks.devices config.
|
||||||
# TODO do we need this always in initrd and only there?
|
++ (lib.optional config.initrdUnlock [{ boot.initrd.luks.devices.${config.name}.device = dev; }])
|
||||||
{ boot.initrd.luks.devices.${config.name}.device = dev; }
|
++ (lib.optional (config.content != null) (config.content._config "/dev/mapper/${config.name}"));
|
||||||
] ++ (lib.optional (config.content != null) (config.content._config "/dev/mapper/${config.name}"));
|
|
||||||
description = "NixOS configuration";
|
description = "NixOS configuration";
|
||||||
};
|
};
|
||||||
_pkgs = lib.mkOption {
|
_pkgs = lib.mkOption {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue