secrets: move nextcloud secrets to agenix

This commit is contained in:
Antoine Martin 2022-03-11 18:42:51 +01:00
parent 2908bbb887
commit 4cc2f41066
8 changed files with 19 additions and 5 deletions

View file

@ -117,6 +117,7 @@ in
nextcloud = {
enable = true;
adminpassFile = config.age.secrets."nextcloud/admin-pass".path;
};
nuage = {

View file

@ -17,6 +17,10 @@
owner = "matrix-synapse";
};
"nextcloud/admin-pass" = {
owner = "nextcloud";
};
"restic-backup/poseidon-credentials" = {};
"restic-backup/poseidon-password" = {};

Binary file not shown.

View file

@ -17,6 +17,8 @@ in
"matrix-synapse/secret-config.age".publicKeys = [ poseidon ];
"nextcloud/admin-pass.age".publicKeys = [ poseidon ];
"restic-backup/boreal-password.age".publicKeys = [ alarsyo boreal ];
"restic-backup/boreal-credentials.age".publicKeys = [ alarsyo boreal ];
"restic-backup/poseidon-password.age".publicKeys = [ alarsyo poseidon ];

View file

@ -11,8 +11,6 @@ in {
config.my.secrets = {
miniflux-admin-credentials = fileContents ./miniflux-admin-credentials.secret;
nextcloud-admin-pass = ./nextcloud-admin-pass.secret;
nextcloud-admin-user = fileContents ./nextcloud-admin-user.secret;
paperless = import ./paperless { inherit lib; };
};

Binary file not shown.

Binary file not shown.

View file

@ -6,6 +6,7 @@ let
inherit (lib)
mkEnableOption
mkIf
mkOption
;
cfg = config.my.services.nextcloud;
@ -14,8 +15,16 @@ let
dbName = "nextcloud";
in
{
options.my.services.nextcloud = {
options.my.services.nextcloud = let inherit (lib) types; in {
enable = mkEnableOption "NextCloud";
adminpassFile = mkOption {
type = types.path;
description = ''
Path to a file containing the admin's password, must be readable by
'nextcloud' user.
'';
};
};
config = mkIf cfg.enable {
@ -62,8 +71,8 @@ in
dbname = dbName;
dbhost = "/run/postgresql";
adminuser = my.secrets.nextcloud-admin-user;
adminpassFile = "${my.secrets.nextcloud-admin-pass}";
adminuser = "admin";
adminpassFile = cfg.adminpassFile;
};
};