Rework of the personal profile. Whittled down trusted.

This commit is contained in:
kat witch 2021-08-29 01:15:00 +01:00
parent cee19f8d3b
commit a55342d0a4
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
16 changed files with 338 additions and 45 deletions

View file

@ -1,15 +1,33 @@
{ config, lib, ... }:
{ config, lib, nixos, ... }:
with lib;
let
secretType = types.submodule ({ name, ... }: {
options = {
source = mkOption {
type = types.path;
};
text = mkOption {
type = types.str;
};
};
});
in
{
options.kw = {
secrets = mkOption {
type = types.nullOr (types.listOf types.str);
default = null;
};
repoSecrets = mkOption {
type = types.nullOr (types.attrsOf secretType);
default = null;
};
};
config = mkIf (config.kw.secrets != null) {
deploy.tf.variables = genAttrs config.kw.secrets (n: { externalSecret = true; });
kw.repoSecrets = nixos.kw.repoSecrets;
};
}

View file

@ -2,12 +2,28 @@
with lib;
let
secretType = types.submodule ({ name, ... }: {
options = {
source = mkOption {
type = types.path;
};
text = mkOption {
type = types.str;
};
};
});
in
{
options.kw = {
secrets = mkOption {
type = types.nullOr (types.listOf types.str);
default = null;
};
repoSecrets = mkOption {
type = types.nullOr (types.attrsOf secretType);
default = null;
};
};
config = mkIf (config.kw.secrets != null) {
deploy.tf.variables = genAttrs config.kw.secrets (n: { externalSecret = true; });