home: secrets: clean-up 'default.nix'

This commit is contained in:
Bruno BELANYI 2021-06-12 20:35:28 +02:00
parent a4cce8a561
commit ecae28a72f

View file

@ -2,13 +2,17 @@
with lib; with lib;
let let
canaryHash = builtins.hashFile "sha256" ./canary; throwOnCanary =
expectedHash = let
"9df8c065663197b5a1095122d48e140d3677d860343256abd5ab6e4fb4c696ab"; canaryHash = builtins.hashFile "sha256" ./canary;
expectedHash =
"9df8c065663197b5a1095122d48e140d3677d860343256abd5ab6e4fb4c696ab";
in
if canaryHash != expectedHash
then throw "Secrets are not readable. Have you run `git-crypt unlock`?"
else id;
in in
if canaryHash != expectedHash then throwOnCanary {
abort "Secrets are not readable. Have you run `git-crypt unlock`?"
else {
options.my.secrets = mkOption { options.my.secrets = mkOption {
type = types.attrs; type = types.attrs;
}; };