summary refs log tree commit diff
path: root/nixos/modules/services/web-apps/tt-rss.nix
diff options
context:
space:
mode:
authorJanne Heß <janne@hess.ooo>2018-06-04 14:14:57 +0200
committerJanne Heß <janne@hess.ooo>2018-06-04 14:14:57 +0200
commit31714e44b755889db2ccf54d4c1f26157a05bf5a (patch)
tree11923eeb5a3625e779e3ab46d99d0f3be20ba1cd /nixos/modules/services/web-apps/tt-rss.nix
parent19332e4d527e0cc8ae98923126217cc7c9fba0b1 (diff)
downloadnixpkgs-31714e44b755889db2ccf54d4c1f26157a05bf5a.tar
nixpkgs-31714e44b755889db2ccf54d4c1f26157a05bf5a.tar.gz
nixpkgs-31714e44b755889db2ccf54d4c1f26157a05bf5a.tar.bz2
nixpkgs-31714e44b755889db2ccf54d4c1f26157a05bf5a.tar.lz
nixpkgs-31714e44b755889db2ccf54d4c1f26157a05bf5a.tar.xz
nixpkgs-31714e44b755889db2ccf54d4c1f26157a05bf5a.tar.zst
nixpkgs-31714e44b755889db2ccf54d4c1f26157a05bf5a.zip
nixos/tt-rss: Support plugins and themes
The extra config is required to configure some plugins.
Diffstat (limited to 'nixos/modules/services/web-apps/tt-rss.nix')
-rw-r--r--nixos/modules/services/web-apps/tt-rss.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/nixos/modules/services/web-apps/tt-rss.nix b/nixos/modules/services/web-apps/tt-rss.nix
index 610c6463a5e..1646ee5964f 100644
--- a/nixos/modules/services/web-apps/tt-rss.nix
+++ b/nixos/modules/services/web-apps/tt-rss.nix
@@ -76,6 +76,8 @@ let
       define('SMTP_FROM_NAME', '${escape ["'" "\\"] cfg.email.fromName}');
       define('SMTP_FROM_ADDRESS', '${escape ["'" "\\"] cfg.email.fromAddress}');
       define('DIGEST_SUBJECT', '${escape ["'" "\\"] cfg.email.digestSubject}');
+
+      ${cfg.extraConfig}
   '';
 
  in {
@@ -431,6 +433,26 @@ let
         '';
       };
 
+      pluginPackages = mkOption {
+        type = types.listOf types.package;
+        default = [];
+        description = ''
+          List of plugins to install. The list elements are expected to
+          be derivations. All elements in this derivation are automatically
+          copied to the <literal>plugins.local</literal> directory.
+        '';
+      };
+
+      themePackages = mkOption {
+        type = types.listOf types.package;
+        default = [];
+        description = ''
+          List of themes to install. The list elements are expected to
+          be derivations. All elements in this derivation are automatically
+          copied to the <literal>themes.local</literal> directory.
+        '';
+      };
+
       logDestination = mkOption {
         type = types.enum ["" "sql" "syslog"];
         default = "sql";
@@ -441,6 +463,14 @@ let
           error.log).
         '';
       };
+
+      extraConfig = mkOption {
+        type = types.lines;
+        default = "";
+        description = ''
+          Additional lines to append to <literal>config.php</literal>.
+        '';
+      };
     };
   };
 
@@ -517,6 +547,16 @@ let
           rm -rf "${cfg.root}/*"
           mkdir -m 755 -p "${cfg.root}"
           cp -r "${pkgs.tt-rss}/"* "${cfg.root}"
+          ${optionalString (cfg.pluginPackages != []) ''
+            for plugin in ${concatStringsSep " " cfg.pluginPackages}; do
+              cp -r "$plugin"/* "${cfg.root}/plugins.local/"
+            done
+          ''}
+          ${optionalString (cfg.themePackages != []) ''
+            for theme in ${concatStringsSep " " cfg.themePackages}; do
+              cp -r "$theme"/* "${cfg.root}/themes.local/"
+            done
+          ''}
           ln -sf "${tt-rss-config}" "${cfg.root}/config.php"
           chown -R "${cfg.user}" "${cfg.root}"
           chmod -R 755 "${cfg.root}"