nixos: enrollment is optional

This commit is contained in:
Raito Bezarius 2022-11-25 11:29:56 +01:00
parent 49519cb289
commit a99646bb01
1 changed files with 5 additions and 3 deletions

View File

@ -37,9 +37,11 @@ in
enable = true; enable = true;
passBootspec = true; passBootspec = true;
installHook = "${pkgs.writeShellScriptBin "bootinstall" '' installHook = "${pkgs.writeShellScriptBin "bootinstall" ''
${optionalString cfg.enrollKeys ''
mkdir -p /tmp/pki mkdir -p /tmp/pki
cp -r ${cfg.pkiBundle}/* /tmp/pki cp -r ${cfg.pkiBundle}/* /tmp/pki
${sbctlWithPki}/bin/sbctl enroll-keys --yes-this-might-brick-my-machine ${sbctlWithPki}/bin/sbctl enroll-keys --yes-this-might-brick-my-machine
''}
${cfg.package}/bin/lanzatool install --pki-bundle ${cfg.pkiBundle} --public-key ${cfg.publicKeyFile} --private-key ${cfg.privateKeyFile} "$@" ${cfg.package}/bin/lanzatool install --pki-bundle ${cfg.pkiBundle} --public-key ${cfg.publicKeyFile} --private-key ${cfg.privateKeyFile} "$@"
''}/bin/bootinstall"; ''}/bin/bootinstall";
# ${cfg.package}/bin/lanzatool install ${optionalString cfg.enrollKeys "--auto-enroll"} --pki-bundle ${cfg.pkiBundle} # ${cfg.package}/bin/lanzatool install ${optionalString cfg.enrollKeys "--auto-enroll"} --pki-bundle ${cfg.pkiBundle}