This commit is contained in:
mjallen18
2026-01-27 11:13:58 -06:00
parent 176d0b7311
commit 10fc7820e1
5 changed files with 46 additions and 38 deletions

View File

@@ -44,30 +44,31 @@ in
bootspec.enable = (!isArm);
initrd = {
secrets = {
"/etc/clevis/nuc-nixos.jwe" = (lib.snowfall.fs.get-file "secrets/nuc-nixos.jwe");
};
# secrets = {
# "/etc/clevis/nuc-nixos.jwe" = (lib.snowfall.fs.get-file "secrets/nuc-nixos.jwe");
# };
systemd.services."unlock-disk" = {
enable = true;
path = [
pkgs.clevis
pkgs.bcachefs-tools
];
script = ''
${pkgs.clevis}/bin/clevis decrypt < "/etc/clevis/nuc-nixos.jwe" | ${pkgs.bcachefs-tools}/bin/bcachefs unlock -k session /dev/disk/by-label/disk-main-nuc-nixos-bcachefs-root
'';
wantedBy = [ "initrd-root-fs.target" ];
requiredBy = [ "initrd-root-fs.target" ];
serviceConfig = {
Type = "oneshot";
TimeoutSec = "10s";
};
};
# systemd.services."unlock-disk" = {
# enable = false;
# path = [
# pkgs.clevis
# pkgs.bcachefs-tools
# ];
# script = ''
# ${pkgs.clevis}/bin/clevis decrypt < "/etc/clevis/nuc-nixos.jwe"
# # | ${pkgs.bcachefs-tools}/bin/bcachefs unlock -k session /dev/disk/by-label/disk-main-nuc-nixos-bcachefs-root
# '';
# wantedBy = [ "initrd-root-fs.target" ];
# requiredBy = [ "initrd-root-fs.target" ];
# serviceConfig = {
# Type = "oneshot";
# TimeoutSec = "10s";
# };
# };
clevis = mkIf (config.${namespace}.hardware.disko.filesystem == "bcachefs"){
enable = true;
};
# clevis = mkIf (config.${namespace}.hardware.disko.filesystem == "bcachefs"){
# enable = true;
# };
luks = mkIf cfg.yubikeyEncryption {
devices = {