Handle locked secret.nix
This commit is contained in:
parent
2033cecc11
commit
b88c4c7bf6
16
flake.lock
generated
16
flake.lock
generated
@ -257,20 +257,18 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_4": {
|
"nixpkgs_4": {
|
||||||
"info": {
|
"info": {
|
||||||
"lastModified": 1587452212,
|
"lastModified": 1588110642,
|
||||||
"narHash": "sha256-Sn9xtMrUYmXCT33yQjNh0tWFwY7jF5x4vCUrkcXDMCE="
|
"narHash": "sha256-A5Sqy2PAJOYaTIjHOTo3ZFbUtd1r6uZf9ymcbSyMh9Q="
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"owner": "nixos",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs-channels",
|
"repo": "nixpkgs",
|
||||||
"rev": "22a3bf9fb9edad917fb6cd1066d58b5e426ee975",
|
"rev": "a0ebabf60a3febbd0ba4b401b13503e1fae24934",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"id": "nixpkgs",
|
||||||
"ref": "nixos-unstable",
|
"type": "indirect"
|
||||||
"repo": "nixpkgs-channels",
|
|
||||||
"type": "github"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_5": {
|
"nixpkgs_5": {
|
||||||
|
@ -5,12 +5,6 @@
|
|||||||
edition = 201909;
|
edition = 201909;
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs = {
|
|
||||||
type = "github";
|
|
||||||
owner = "nixos";
|
|
||||||
repo = "nixpkgs-channels";
|
|
||||||
ref = "nixos-unstable";
|
|
||||||
};
|
|
||||||
NUR = {
|
NUR = {
|
||||||
type = "github";
|
type = "github";
|
||||||
owner = "nix-community";
|
owner = "nix-community";
|
||||||
|
@ -89,8 +89,9 @@ in rec {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
config = let
|
config = let
|
||||||
|
unlocked = import (pkgs.runCommand "check-secret" {} "set +e; grep -qI . ${../secret.nix}; echo $? > $out") == 0;
|
||||||
secretnix = import ../secret.nix;
|
secretnix = import ../secret.nix;
|
||||||
secrets = if isNull secretnix then
|
secrets = if ! unlocked || isNull secretnix then
|
||||||
mapAttrs (n: v: null) options.secrets
|
mapAttrs (n: v: null) options.secrets
|
||||||
else
|
else
|
||||||
secretnix;
|
secretnix;
|
||||||
|
Loading…
Reference in New Issue
Block a user