1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-15 19:23:01 +03:00
mobile-nixos/modules/luks.nix
Samuel Dionne-Riel a28cd3a293 modules/luks: Init
This, with the upcoming luks task allows encrypted drives to work!
2020-11-07 18:26:47 -05:00

28 lines
583 B
Nix

{ config, lib, pkgs, ... }:
let
inherit (config.boot.initrd) luks;
in
lib.mkIf (luks.devices != {} || luks.forceLuksSupportInInitrd) {
mobile.boot.stage-1 = {
bootConfig = {
luksDevices = luks.devices;
};
kernel = {
modules = [
"dm_mod" "dm_crypt" "cryptd" "input_leds"
] ++ luks.cryptoModules
;
};
extraUtils = [
{ package = pkgs.cryptsetup; }
# dmsetup is required for device mapper stuff to work in stage-1.
{ package = lib.getBin pkgs.lvm2; binaries = [
"lvm" "dmsetup"
];}
];
};
}