Modularize secrets
This commit is contained in:
parent
a1b70baa78
commit
785af695df
3 changed files with 16 additions and 7 deletions
3
example/hosts/secrets/secrets.md
Normal file
3
example/hosts/secrets/secrets.md
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
# Secrets
|
||||||
|
|
||||||
|
This file is for sops-nix and is also where your keys for various secrets will be stored.
|
||||||
0
example/hosts/secrets/secrets.yaml
Normal file
0
example/hosts/secrets/secrets.yaml
Normal file
|
|
@ -6,6 +6,18 @@
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
description = "Enable sops secrets";
|
description = "Enable sops secrets";
|
||||||
};
|
};
|
||||||
|
secrets = lib.mkOption {
|
||||||
|
default = {
|
||||||
|
hub = { };
|
||||||
|
lab = { };
|
||||||
|
${config.conf.username} = { };
|
||||||
|
nextcloud = { };
|
||||||
|
access = { };
|
||||||
|
};
|
||||||
|
example = { };
|
||||||
|
type = with lib.types; attrsOf anything;
|
||||||
|
description = "secrets for sops";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
config = lib.mkIf config.mods.sops.enable
|
config = lib.mkIf config.mods.sops.enable
|
||||||
(lib.optionalAttrs (options ? home.packages) {
|
(lib.optionalAttrs (options ? home.packages) {
|
||||||
|
|
@ -16,13 +28,7 @@
|
||||||
sshKeyPaths = [ ];
|
sshKeyPaths = [ ];
|
||||||
};
|
};
|
||||||
defaultSopsFile = root + /secrets/secrets.yaml;
|
defaultSopsFile = root + /secrets/secrets.yaml;
|
||||||
secrets = {
|
secrets = config.mods.sops.secrets;
|
||||||
hub = { };
|
|
||||||
lab = { };
|
|
||||||
${config.conf.username} = { };
|
|
||||||
nextcloud = { };
|
|
||||||
access = { };
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.services.mbsync.Unit.After = [ "sops-nix.service" ];
|
systemd.user.services.mbsync.Unit.After = [ "sops-nix.service" ];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue