1 { yourls_config ? "/etc/yourls/config.php", fetchFromGitHub, callPackage, lib, stdenv }:
3 pluginNames = [ "ldap" ];
4 allPlugins = lib.attrsets.genAttrs pluginNames
5 (name: callPackage (./plugins + "/${name}") {});
6 toPassthru = pkg: plugins: {
7 inherit plugins allPlugins;
8 withPlugins = withPlugins pkg;
10 withPlugins = pkg: toPlugins:
12 plugins = toPlugins allPlugins;
13 toInstallPlugin = n: "ln -s ${n} $out/user/plugins/${n.pluginName}";
14 newYourls = pkg.overrideAttrs(old: {
15 installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallPlugin plugins);
16 passthru = toPassthru newYourls (pkg.plugins ++ plugins);
19 package = stdenv.mkDerivation (rec {
22 src = fetchFromGitHub {
25 rev = "077018822d3594229daa8343310d0b40804b9ddc";
26 sha256 = "1av6h619rwqn0yn0kjn2s2h3gmrhmxaaa9hd5ns4ralxgg731imd";
27 fetchSubmodules = true;
32 cp sample-robots.txt $out/robots.txt
33 ln -sf ${yourls_config} $out/includes/config.php
35 passthru = toPassthru package [];