aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorSilas Schöffel <sils@sils.li>2025-01-20 16:04:24 +0100
committerSilas Schöffel <sils@sils.li>2025-01-20 16:11:26 +0100
commit4ef1d52097468264a9c5726dec8365a6271ded47 (patch)
tree950d70f8ba48ab74630f149e0146a6b11de06d17 /modules
parentfeat(treewide): rekey secrets to allow multiple host setup (diff)
downloadnixos-server-4ef1d52097468264a9c5726dec8365a6271ded47.zip
feat(miniflux): init module, host on server2
Diffstat (limited to 'modules')
-rw-r--r--modules/by-name/mi/miniflux/module.nix51
1 files changed, 51 insertions, 0 deletions
diff --git a/modules/by-name/mi/miniflux/module.nix b/modules/by-name/mi/miniflux/module.nix
new file mode 100644
index 0000000..ca6f476
--- /dev/null
+++ b/modules/by-name/mi/miniflux/module.nix
@@ -0,0 +1,51 @@
+{
+ config,
+ lib,
+ ...
+}: let
+ cfg = config.vhack.miniflux;
+in {
+ options.vhack.miniflux = {
+ enable = lib.mkEnableOption "miniflux, an simple web rss reading software";
+ domain = lib.mkOption {
+ type = lib.types.str;
+ description = "The primary domain miniflux should be served on";
+ };
+ extraDomains = lib.mkOption {
+ type = lib.types.listOf lib.types.str;
+ description = "Additional domains to serve miniflux on";
+ default = [];
+ };
+ };
+ config = lib.mkIf cfg.enable {
+ age.secrets = {
+ minifluxAdmin = {
+ file = ./secrets/admin.age;
+ mode = "700";
+ owner = "root";
+ group = "root";
+ };
+ };
+ services.miniflux = {
+ enable = true;
+ config = {
+ LISTEN_ADDR = "127.0.0.1:5892";
+ };
+ adminCredentialsFile = config.age.secrets.minifluxAdmin.path;
+ };
+
+ vhack = {
+ nginx.enable = true;
+ postgresql.enable = true;
+ };
+ services.nginx = {
+ virtualHosts.${cfg.domain} = {
+ locations."/".proxyPass = "http://${config.services.miniflux.config.LISTEN_ADDR}";
+
+ enableACME = true;
+ forceSSL = true;
+ serverAliases = cfg.extraDomains;
+ };
+ };
+ };
+}