blob: cc880cd96df0dd64c075f69b425496b4b77a77ed (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
{ yourls_config ? "/etc/yourls/config.php", mylibs, stdenv }:
let
withPlugins = plugins: package.overrideAttrs(old: {
name = "${old.name}-with-plugins";
installPhase = old.installPhase +
builtins.concatStringsSep "\n" (
map (value: "ln -s ${value} $out/user/plugins/${value.pluginName}") plugins
);
passthru.plugins = plugins;
passthru.withPlugins = morePlugins: old.withPlugins (morePlugins ++ plugins);
});
package = stdenv.mkDerivation (mylibs.fetchedGithub ./yourls.json // rec {
installPhase = ''
mkdir -p $out
cp -a */ *.php $out/
cp sample-robots.txt $out/robots.txt
ln -sf ${yourls_config} $out/includes/config.php
'';
passthru = {
plugins = [];
inherit withPlugins;
};
});
in package
|