forked from aylac.top/nixcfg
this repo has no description
1{ 2 config, 3 lib, 4 self, 5 ... 6}: let 7 name = "miniflux"; 8 cfg = config.myNixOS.services.${name}; 9 10 network = config.mySnippets.tailnet; 11 service = network.networkMap.${name}; 12in { 13 options.myNixOS.services.${name} = { 14 enable = lib.mkEnableOption "${name} server"; 15 autoProxy = lib.mkOption { 16 default = true; 17 example = false; 18 description = "${name} auto proxy"; 19 type = lib.types.bool; 20 }; 21 }; 22 23 config = lib.mkIf cfg.enable { 24 age.secrets.miniflux.file = "${self.inputs.secrets}/miniflux.age"; 25 26 services = { 27 caddy.virtualHosts."${service.vHost}".extraConfig = lib.mkIf cfg.autoProxy '' 28 bind tailscale/${name} 29 encode zstd gzip 30 reverse_proxy ${service.hostName}:${toString service.port} 31 ''; 32 33 miniflux = { 34 enable = true; 35 adminCredentialsFile = config.age.secrets.miniflux.path; 36 config = { 37 BATCH_SIZE = 100; 38 CLEANUP_FREQUENCY_HOURS = 48; 39 LISTEN_ADDR = "${service.hostName}:${toString service.port}"; 40 BASE_URL = "https://${service.vHost}"; 41 WEBAUTHN = "enabled"; 42 }; 43 }; 44 }; 45 }; 46}