Compare commits
2 commits
0acececb31
...
d5e7ea14e7
Author | SHA1 | Date | |
---|---|---|---|
d5e7ea14e7 | |||
c6cc2baa8f |
1 changed files with 22 additions and 0 deletions
22
default.nix
22
default.nix
|
@ -97,11 +97,31 @@ in
|
|||
ln -snf ${terranixConfigFile} config.tf.json
|
||||
exec ${pkgs.lib.getExe pkgs.opentofu} "$@"
|
||||
'')
|
||||
(pkgs.writeShellScriptBin "decryptAndSourceEnvironment" ''
|
||||
set -eo pipefail
|
||||
|
||||
# TODO: don't hardcode me.
|
||||
SECRET_FILE=".credentials/admin-environment.age"
|
||||
IDENTITIES=()
|
||||
for identity in [ "$HOME/.ssh/id_ed25519" "$HOME/.ssh/id_rsa" ]; do
|
||||
test -r "$identity" || continue
|
||||
IDENTITIES+=(-i)
|
||||
IDENTITIES+=("$identity")
|
||||
done
|
||||
|
||||
test "''${#IDENTITIES[@]}" -eq 0 && echo "[agenix-shell] WARNING: no readable identities found!"
|
||||
|
||||
test -f "$SECRET_FILE" || echo "[agenix-shell] WARNING: encrypted environment file $SECRET_FILE not found!"
|
||||
export eval $(${pkgs.lib.getExe pkgs.rage} --decrypt "''${IDENTITIES[@]}" -o - $SECRET_FILE)
|
||||
|
||||
echo "[agenix-shell] Repository-wide secrets loaded in the environment."
|
||||
'')
|
||||
(pkgs.nixos-generators.overrideAttrs (_: {
|
||||
version = "1.8.0-unstable";
|
||||
src = builtins.storePath sources.nixos-generators;
|
||||
}))
|
||||
pkgs.npins
|
||||
pkgs.rage
|
||||
|
||||
(pkgs.callPackage ./lib/colmena { inherit (nix-pkgs) colmena; })
|
||||
(pkgs.callPackage "${sources.agenix}/pkgs/agenix.nix" { })
|
||||
|
@ -111,6 +131,8 @@ in
|
|||
|
||||
shellHook = ''
|
||||
${git-checks.shellHook}
|
||||
# If we want to export these environments, we need to source it, not call it.
|
||||
source $(which decryptAndSourceEnvironment)
|
||||
'';
|
||||
|
||||
preferLocalBuild = true;
|
||||
|
|
Loading…
Reference in a new issue