]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - pkgs/webapps/yourls/default.nix
Add iridologie via spip
[perso/Immae/Config/Nix.git] / pkgs / webapps / yourls / default.nix
CommitLineData
b44b42a1
IB
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 );
e6abbae2
IB
9 passthru = old.passthru // {
10 inherit plugins;
11 withPlugins = morePlugins: old.withPlugins (morePlugins ++ plugins);
12 };
b44b42a1
IB
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