summaryrefslogtreecommitdiff
path: root/pkgs/webapps/yourls/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/webapps/yourls/default.nix')
-rw-r--r--pkgs/webapps/yourls/default.nix26
1 files changed, 26 insertions, 0 deletions
diff --git a/pkgs/webapps/yourls/default.nix b/pkgs/webapps/yourls/default.nix
new file mode 100644
index 00000000..4bcfa4cc
--- /dev/null
+++ b/pkgs/webapps/yourls/default.nix
@@ -0,0 +1,26 @@
1{ yourls_config ? "/etc/yourls/config.php", mylibs, stdenv }:
2let
3 withPlugins = plugins: package.overrideAttrs(old: {
4 name = "${old.name}-with-plugins";
5 installPhase = old.installPhase +
6 builtins.concatStringsSep "\n" (
7 map (value: "ln -s ${value} $out/user/plugins/${value.pluginName}") plugins
8 );
9 passthru = old.passthru // {
10 inherit plugins;
11 withPlugins = morePlugins: old.withPlugins (morePlugins ++ plugins);
12 };
13 });
14 package = stdenv.mkDerivation (mylibs.fetchedGithub ./yourls.json // rec {
15 installPhase = ''
16 mkdir -p $out
17 cp -a */ *.php $out/
18 cp sample-robots.txt $out/robots.txt
19 ln -sf ${yourls_config} $out/includes/config.php
20 '';
21 passthru = {
22 plugins = [];
23 inherit withPlugins;
24 };
25 });
26in package