diff options
| author | Collin Williams <96917990+bluedragon1221@users.noreply.github.com> | 2025-12-30 10:23:03 -0600 |
|---|---|---|
| committer | Collin Williams <96917990+bluedragon1221@users.noreply.github.com> | 2025-12-30 10:23:03 -0600 |
| commit | 2c121c5411a78a5e8fc98b145c9667c8528e238c (patch) | |
| tree | 6b2a2e3dd330bbb22ab5bc293bddc2d3f44fea90 /modules/secrets | |
| parent | 098f38e12ccc6317d7fe101e7de3e0d62c84cc86 (diff) | |
new secrets-management system
Diffstat (limited to 'modules/secrets')
| -rw-r--r-- | modules/secrets/nixos/default.nix | 17 | ||||
| -rw-r--r-- | modules/secrets/options.nix | 32 |
2 files changed, 49 insertions, 0 deletions
diff --git a/modules/secrets/nixos/default.nix b/modules/secrets/nixos/default.nix new file mode 100644 index 0000000..e5e6662 --- /dev/null +++ b/modules/secrets/nixos/default.nix @@ -0,0 +1,17 @@ +{ + inputs, + config, + ... +}: let + cfg = config.collinux.secrets; +in { + imports = [ + inputs.agenix.nixosModules.default + ]; + + age = { + identityPaths = ["/etc/ssh/ssh_host_ed25519_key"]; + secretsDir = "/run/secrets.d"; + secrets = cfg; + }; +} diff --git a/modules/secrets/options.nix b/modules/secrets/options.nix new file mode 100644 index 0000000..de15f50 --- /dev/null +++ b/modules/secrets/options.nix @@ -0,0 +1,32 @@ +{lib, ...}: let + inherit (lib) mkOption; +in { + options = { + collinux.secrets = lib.mkOption { + type = lib.types.attrsOf ( + lib.types.submodule ({config, ...}: { + options = { + name = mkOption { + type = lib.types.str; + default = config._module.args.name; + }; + file = mkOption {type = lib.types.path;}; + mode = mkOption { + type = lib.types.str; + default = "0400"; + }; + owner = mkOption { + type = lib.types.str; + default = "0"; + }; + path = mkOption { + type = lib.types.str; + default = "/run/secrets.d/${config.name}"; + }; + }; + }) + ); + default = {}; + }; + }; +} |
