1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-11 07:10:39 +02:00

chore: automatically get (impure) current system for rekeying.

This commit is contained in:
oddlama 2023-04-17 17:04:47 +02:00
parent 12d840c7bf
commit 3730ae7cf7
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
2 changed files with 5 additions and 1 deletions

View file

@ -27,7 +27,9 @@
extraEncryptionPubkeys
;
forceRekeyOnSystem = "x86_64-linux";
# This is technically impure, but intended. We need to rekey on the
# current system due to yubikey availability.
forceRekeyOnSystem = builtins.extraBuiltins.unsafeCurrentSystem;
hostPubkey = let
pubkeyPath = ../.. + "/${nodeName}/secrets/host.pub";
in

View file

@ -29,4 +29,6 @@ in {
assert assertMsg (builtins.isPath nixFile) "The file to decrypt must be given as a path to prevent impurity.";
assert assertMsg (hasSuffix ".nix.age" nixFile) "The content of the decrypted file must be a nix expression and should therefore end in .nix.age";
exec ([./rage-decrypt-and-cache.sh nixFile] ++ identities);
# currentSystem
unsafeCurrentSystem = exec ["nix" "eval" "--impure" "--expr" "builtins.currentSystem"];
}