2021-03-08 19:59:22 +01:00
|
|
|
{ lib, ... }:
|
2021-02-20 16:20:27 +01:00
|
|
|
|
|
|
|
with lib;
|
|
|
|
let
|
2021-06-12 20:35:28 +02:00
|
|
|
throwOnCanary =
|
|
|
|
let
|
|
|
|
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;
|
2021-02-20 16:20:27 +01:00
|
|
|
in
|
2021-06-12 20:35:28 +02:00
|
|
|
throwOnCanary {
|
2021-02-20 16:20:27 +01:00
|
|
|
options.my.secrets = mkOption {
|
|
|
|
type = types.attrs;
|
|
|
|
};
|
|
|
|
|
|
|
|
config.my.secrets = {
|
|
|
|
# Home-manager secrets go here
|
|
|
|
};
|
|
|
|
}
|