]> git.immae.eu Git - perso/Immae/Config/Nix/NUR.git/blob - pkgs/webapps/yourls/default.nix
Initial commit published for NUR
[perso/Immae/Config/Nix/NUR.git] / pkgs / webapps / yourls / default.nix
1 { yourls_config ? "/etc/yourls/config.php", mylibs, stdenv }:
2 let
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 });
26 in package