diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-07 09:06:29 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-07 10:19:52 +0200 |
commit | b44b42a15197813060bf9405d5a07b8b2c699af5 (patch) | |
tree | 4f424a145aa0064653f62de04ddba6bb2c31f49a /pkgs/webapps/yourls | |
parent | 6213b17b751fcc6ccd7df9a773dc29d9e8f22c21 (diff) | |
download | Nix-b44b42a15197813060bf9405d5a07b8b2c699af5.tar.gz Nix-b44b42a15197813060bf9405d5a07b8b2c699af5.tar.zst Nix-b44b42a15197813060bf9405d5a07b8b2c699af5.zip |
Move yourls to pkgs
Diffstat (limited to 'pkgs/webapps/yourls')
-rw-r--r-- | pkgs/webapps/yourls/default.nix | 24 | ||||
-rw-r--r-- | pkgs/webapps/yourls/plugins/ldap/default.nix | 8 | ||||
-rw-r--r-- | pkgs/webapps/yourls/plugins/ldap/ldap.json | 15 | ||||
-rw-r--r-- | pkgs/webapps/yourls/yourls.json | 15 |
4 files changed, 62 insertions, 0 deletions
diff --git a/pkgs/webapps/yourls/default.nix b/pkgs/webapps/yourls/default.nix new file mode 100644 index 0000000..cc880cd --- /dev/null +++ b/pkgs/webapps/yourls/default.nix | |||
@@ -0,0 +1,24 @@ | |||
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.plugins = plugins; | ||
10 | passthru.withPlugins = morePlugins: old.withPlugins (morePlugins ++ plugins); | ||
11 | }); | ||
12 | package = stdenv.mkDerivation (mylibs.fetchedGithub ./yourls.json // rec { | ||
13 | installPhase = '' | ||
14 | mkdir -p $out | ||
15 | cp -a */ *.php $out/ | ||
16 | cp sample-robots.txt $out/robots.txt | ||
17 | ln -sf ${yourls_config} $out/includes/config.php | ||
18 | ''; | ||
19 | passthru = { | ||
20 | plugins = []; | ||
21 | inherit withPlugins; | ||
22 | }; | ||
23 | }); | ||
24 | in package | ||
diff --git a/pkgs/webapps/yourls/plugins/ldap/default.nix b/pkgs/webapps/yourls/plugins/ldap/default.nix new file mode 100644 index 0000000..01dc6fb --- /dev/null +++ b/pkgs/webapps/yourls/plugins/ldap/default.nix | |||
@@ -0,0 +1,8 @@ | |||
1 | { stdenv, mylibs }: | ||
2 | stdenv.mkDerivation (mylibs.fetchedGithub ./ldap.json // rec { | ||
3 | installPhase = '' | ||
4 | mkdir -p $out | ||
5 | cp plugin.php $out | ||
6 | ''; | ||
7 | passthru.pluginName = "ldap"; | ||
8 | }) | ||
diff --git a/pkgs/webapps/yourls/plugins/ldap/ldap.json b/pkgs/webapps/yourls/plugins/ldap/ldap.json new file mode 100644 index 0000000..9411e4a --- /dev/null +++ b/pkgs/webapps/yourls/plugins/ldap/ldap.json | |||
@@ -0,0 +1,15 @@ | |||
1 | { | ||
2 | "tag": "2a3cb03-master", | ||
3 | "meta": { | ||
4 | "name": "yourls-ldap-plugin", | ||
5 | "url": "https://github.com/k3a/yourls-ldap-plugin", | ||
6 | "branch": "master" | ||
7 | }, | ||
8 | "github": { | ||
9 | "owner": "k3a", | ||
10 | "repo": "yourls-ldap-plugin", | ||
11 | "rev": "2a3cb0334b8a6b81b284a7196e614bbd2b2b1615", | ||
12 | "sha256": "0cchbnli77d295lzf7kjmn4dcxj2bmdqa9qc3f8l8qgmp4n5n0gh", | ||
13 | "fetchSubmodules": true | ||
14 | } | ||
15 | } | ||
diff --git a/pkgs/webapps/yourls/yourls.json b/pkgs/webapps/yourls/yourls.json new file mode 100644 index 0000000..0a79b18 --- /dev/null +++ b/pkgs/webapps/yourls/yourls.json | |||
@@ -0,0 +1,15 @@ | |||
1 | { | ||
2 | "tag": "1.7.3", | ||
3 | "meta": { | ||
4 | "name": "yourls", | ||
5 | "url": "https://github.com/YOURLS/YOURLS", | ||
6 | "branch": "refs/tags/1.7.3" | ||
7 | }, | ||
8 | "github": { | ||
9 | "owner": "YOURLS", | ||
10 | "repo": "YOURLS", | ||
11 | "rev": "077018822d3594229daa8343310d0b40804b9ddc", | ||
12 | "sha256": "1av6h619rwqn0yn0kjn2s2h3gmrhmxaaa9hd5ns4ralxgg731imd", | ||
13 | "fetchSubmodules": true | ||
14 | } | ||
15 | } | ||