diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 01:35:06 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 02:11:48 +0200 |
commit | 1a64deeb894dc95e2645a75771732c6cc53a79ad (patch) | |
tree | 1b9df4838f894577a09b9b260151756272efeb53 /flakes/mypackages/pkgs/webapps/yourls | |
parent | fa25ffd4583cc362075cd5e1b4130f33306103f0 (diff) | |
download | Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.gz Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.zst Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.zip |
Squash changes containing private information
There were a lot of changes since the previous commit, but a lot of them
contained personnal information about users. All thos changes got
stashed into a single commit (history is kept in a different place) and
private information was moved in a separate private repository
Diffstat (limited to 'flakes/mypackages/pkgs/webapps/yourls')
-rw-r--r-- | flakes/mypackages/pkgs/webapps/yourls/default.nix | 37 | ||||
-rw-r--r-- | flakes/mypackages/pkgs/webapps/yourls/plugins/ldap/default.nix | 17 |
2 files changed, 54 insertions, 0 deletions
diff --git a/flakes/mypackages/pkgs/webapps/yourls/default.nix b/flakes/mypackages/pkgs/webapps/yourls/default.nix new file mode 100644 index 0000000..8001a60 --- /dev/null +++ b/flakes/mypackages/pkgs/webapps/yourls/default.nix | |||
@@ -0,0 +1,37 @@ | |||
1 | { yourls_config ? "/etc/yourls/config.php", fetchFromGitHub, callPackage, lib, stdenv }: | ||
2 | let | ||
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; | ||
9 | }; | ||
10 | withPlugins = pkg: toPlugins: | ||
11 | let | ||
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); | ||
17 | }); | ||
18 | in newYourls; | ||
19 | package = stdenv.mkDerivation (rec { | ||
20 | pname = "yourls"; | ||
21 | version = "1.7.3"; | ||
22 | src = fetchFromGitHub { | ||
23 | owner = "YOURLS"; | ||
24 | repo = "YOURLS"; | ||
25 | rev = "077018822d3594229daa8343310d0b40804b9ddc"; | ||
26 | sha256 = "1av6h619rwqn0yn0kjn2s2h3gmrhmxaaa9hd5ns4ralxgg731imd"; | ||
27 | fetchSubmodules = true; | ||
28 | }; | ||
29 | installPhase = '' | ||
30 | mkdir -p $out | ||
31 | cp -a */ *.php $out/ | ||
32 | cp sample-robots.txt $out/robots.txt | ||
33 | ln -sf ${yourls_config} $out/includes/config.php | ||
34 | ''; | ||
35 | passthru = toPassthru package []; | ||
36 | }); | ||
37 | in package | ||
diff --git a/flakes/mypackages/pkgs/webapps/yourls/plugins/ldap/default.nix b/flakes/mypackages/pkgs/webapps/yourls/plugins/ldap/default.nix new file mode 100644 index 0000000..5870faa --- /dev/null +++ b/flakes/mypackages/pkgs/webapps/yourls/plugins/ldap/default.nix | |||
@@ -0,0 +1,17 @@ | |||
1 | { stdenv, fetchFromGitHub }: | ||
2 | stdenv.mkDerivation (rec { | ||
3 | pname = "yourls-ldap-plugin"; | ||
4 | version = "2a3cb03-master"; | ||
5 | src = fetchFromGitHub { | ||
6 | owner = "k3a"; | ||
7 | repo = "yourls-ldap-plugin"; | ||
8 | rev = "2a3cb0334b8a6b81b284a7196e614bbd2b2b1615"; | ||
9 | sha256 = "0cchbnli77d295lzf7kjmn4dcxj2bmdqa9qc3f8l8qgmp4n5n0gh"; | ||
10 | fetchSubmodules = true; | ||
11 | }; | ||
12 | installPhase = '' | ||
13 | mkdir -p $out | ||
14 | cp plugin.php $out | ||
15 | ''; | ||
16 | passthru.pluginName = "ldap"; | ||
17 | }) | ||