clanCore secrets: add secretStore option
This commit is contained in:
@@ -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: {
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user