clanCore secrets: add secretStore option

This commit is contained in:
lassulus
2023-09-06 16:08:36 +02:00
committed by Mic92
parent a043368ed6
commit 3f6fa0eeca
2 changed files with 8 additions and 1 deletions

View File

@@ -1,5 +1,12 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
options.clanCore.secretStore = lib.mkOption {
type = lib.types.enum [ "sops" "password-store" "custom" ];
default = "sops";
description = ''
method to store secrets
'';
};
options.clanCore.secrets = lib.mkOption { options.clanCore.secrets = lib.mkOption {
type = lib.types.attrsOf type = lib.types.attrsOf
(lib.types.submodule (secret: { (lib.types.submodule (secret: {

View File

@@ -21,7 +21,7 @@ let
secrets = filterDir containsMachineOrGroups secretsDir; secrets = filterDir containsMachineOrGroups secretsDir;
in in
{ {
config = { config = lib.mkIf (config.clanCore.secretStore == "sops") {
system.clan.generateSecrets = pkgs.writeScript "generate-secrets" '' system.clan.generateSecrets = pkgs.writeScript "generate-secrets" ''
#!/bin/sh #!/bin/sh
set -efu set -efu