mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-06 01:18:30 +09:00
disk encrypto
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
imports = [
|
||||
./power.nix
|
||||
./secure-boot.nix
|
||||
./storage-crypto.nix
|
||||
./uefi.nix
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.my.features.boot.storageCrypto;
|
||||
in
|
||||
{
|
||||
options.my.features.boot.storageCrypto = {
|
||||
enable = lib.mkEnableOption "LUKS decryption via TPM2";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
boot.initrd.systemd.enable = true;
|
||||
|
||||
boot.initrd.luks.devices.cryptroot = {
|
||||
crypttabExtraOpts = [
|
||||
"tpm2-device=auto"
|
||||
];
|
||||
};
|
||||
|
||||
security.tpm2.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
tpm2-tools # TPM2 management tools
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user