modules: services: miniflux: use 'credentialsFiles'

In preparation for the migration to agenix.
This commit is contained in:
Bruno BELANYI 2021-09-25 12:59:24 +02:00
parent da63787874
commit 9d8da4d2b2
2 changed files with 10 additions and 17 deletions

View file

@ -70,7 +70,10 @@ in
};
miniflux = {
enable = true;
password = my.secrets.miniflux.password;
credentialsFiles = builtins.toFile "miniflux-creds.txt" ''
ADMIN_USERNAME=Ambroisie
ADMIN_PASSWORD=${my.secrets.miniflux.password}
'';
};
# Various monitoring dashboards
monitoring = {

View file

@ -7,17 +7,12 @@ in
options.my.services.miniflux = with lib; {
enable = mkEnableOption "Miniflux feed reader";
username = mkOption {
credentialsFiles = mkOption {
type = types.str;
default = "Ambroisie";
example = "username";
description = "Name of the admin user";
};
password = mkOption {
type = types.str;
example = "password";
description = "Password of the admin user";
example = "/var/lib/miniflux/creds.env";
description = ''
Credential file as an 'EnvironmentFile' (see `systemd.exec(5)`)
'';
};
port = mkOption {
@ -33,12 +28,7 @@ in
services.miniflux = {
enable = true;
adminCredentialsFile =
# Insecure, I don't care.
builtins.toFile "credentials.env" ''
ADMIN_USERNAME=${cfg.username}
ADMIN_PASSWORD=${cfg.password}
'';
adminCredentialsFile = cfg.credentialsFiles;
config = {
# Virtual hosts settings