feat(dgn-secrets): Add a matches option

This option allows specifying regexes tied to options.
When a secret matches a pattern, the the options are applied to it.
This commit is contained in:
Tom Hubrecht 2023-10-02 22:48:18 +02:00
parent 18c1fa1ddd
commit 5622bc3748
9 changed files with 71 additions and 107 deletions

View file

@ -1,9 +1,6 @@
{ config, lib, pkgs, dgn-lib, ... }:
{ config, pkgs, ... }:
let
inherit (dgn-lib) setDefault;
host = "cloud.dgnum.eu";
let host = "cloud.dgnum.eu";
in {
services.nextcloud = {
enable = true;
@ -71,8 +68,5 @@ in {
exif
];
dgn-secrets.options = [
(setDefault { owner = "nextcloud"; }
(builtins.filter (lib.hasPrefix "nextcloud-") config.dgn-secrets.names))
];
dgn-secrets.matches."^nextcloud-.*$" = { owner = "nextcloud"; };
}