mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
meta: Avoid building rbw-bitw for all hosts
This commit is contained in:
parent
a23c94f597
commit
b154039b72
5 changed files with 28 additions and 54 deletions
5
config/modules/meta/secrets.nix
Normal file
5
config/modules/meta/secrets.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{ config, lib, ... }: with lib; {
|
||||
options.kw.secrets.command = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, ... }:
|
||||
{ config, lib, meta, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
|
|
@ -22,14 +22,12 @@ let
|
|||
};
|
||||
};
|
||||
});
|
||||
mcfg = meta.kw.secrets;
|
||||
cfg = config.kw.secrets;
|
||||
in
|
||||
{
|
||||
options.kw = {
|
||||
secrets = {
|
||||
command = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
variables = mkOption {
|
||||
type = types.attrsOf secretType;
|
||||
default = { };
|
||||
|
|
@ -48,7 +46,7 @@ in
|
|||
deploy.tf.variables = mapAttrs'
|
||||
(name: content:
|
||||
nameValuePair name ({
|
||||
value.shellCommand = "${cfg.command} ${content.path}" + optionalString (content.field != "") " -f ${content.field}";
|
||||
value.shellCommand = "${mcfg.command} ${content.path}" + optionalString (content.field != "") " -f ${content.field}";
|
||||
type = "string";
|
||||
sensitive = true;
|
||||
})
|
||||
|
|
|
|||
|
|
@ -8,10 +8,4 @@
|
|||
persistentRoot = "/var/lib/kat/secrets";
|
||||
external = true;
|
||||
};
|
||||
|
||||
kw.secrets.command =
|
||||
let
|
||||
bitw = pkgs.writeShellScriptBin "bitw" ''${pkgs.rbw-bitw}/bin/bitw -p gpg://${config.kw.secrets.repo.bitw.source} "$@"'';
|
||||
in
|
||||
"${bitw}/bin/bitw get";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue