secrets: clean-up 'default.nix'
This commit is contained in:
parent
aec2e08062
commit
a4cce8a561
|
@ -1,14 +1,18 @@
|
||||||
{ lib, pkgs, ... }:
|
{ lib, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
|
throwOnCanary =
|
||||||
|
let
|
||||||
canaryHash = builtins.hashFile "sha256" ./canary;
|
canaryHash = builtins.hashFile "sha256" ./canary;
|
||||||
expectedHash =
|
expectedHash =
|
||||||
"9df8c065663197b5a1095122d48e140d3677d860343256abd5ab6e4fb4c696ab";
|
"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;
|
||||||
};
|
};
|
||||||
|
@ -50,6 +54,6 @@ else {
|
||||||
root.hashedPassword = fileContents ./users/root/password.txt;
|
root.hashedPassword = fileContents ./users/root/password.txt;
|
||||||
};
|
};
|
||||||
|
|
||||||
wireguard = pkgs.callPackage ./wireguard { };
|
wireguard = import ./wireguard { inherit lib; };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue