miniflux: move into module
This commit is contained in:
parent
3c3868c88b
commit
8f4ffd1d45
23 changed files with 114 additions and 64 deletions
39
nixos/modules/miniflux.nix
Normal file
39
nixos/modules/miniflux.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.dadada.miniflux;
|
||||
domain = "miniflux.${config.networking.domain}";
|
||||
adminCredentialsFile = "miniflux-admin-credentials";
|
||||
in
|
||||
{
|
||||
|
||||
options.dadada.miniflux = {
|
||||
enable = lib.mkEnableOption "Enable miniflux RSS aggregator";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.miniflux = {
|
||||
enable = true;
|
||||
config = {
|
||||
CLEANUP_FREQUENCY = "48";
|
||||
LISTEN_ADDR = "localhost:8080";
|
||||
};
|
||||
adminCredentialsFile = config.age.secrets.${adminCredentialsFile}.path;
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts.${domain} = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
|
||||
locations."/".extraConfig = ''
|
||||
proxy_pass http://localhost:8080/;
|
||||
'';
|
||||
};
|
||||
|
||||
age.secrets.${adminCredentialsFile} = {
|
||||
file = "${config.dadada.secrets.path}/${adminCredentialsFile}.age";
|
||||
owner = config.systemd.services.miniflux.serviceConfig.User;
|
||||
group = "root";
|
||||
mode = "0700";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue