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/mantisbt_2/default.nix | |
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/mantisbt_2/default.nix')
-rw-r--r-- | flakes/mypackages/pkgs/webapps/mantisbt_2/default.nix | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/flakes/mypackages/pkgs/webapps/mantisbt_2/default.nix b/flakes/mypackages/pkgs/webapps/mantisbt_2/default.nix new file mode 100644 index 0000000..466595d --- /dev/null +++ b/flakes/mypackages/pkgs/webapps/mantisbt_2/default.nix | |||
@@ -0,0 +1,44 @@ | |||
1 | { mantis_config ? "/etc/mantisbt/config_inc.php", stdenv, fetchurl, lib, callPackage}: | ||
2 | let | ||
3 | pluginNames = [ "slack" "source-integration" ]; | ||
4 | allPlugins = lib.attrsets.genAttrs pluginNames | ||
5 | (name: callPackage (./plugins + "/${name}") {}); | ||
6 | toPassthru = pkg: plugins: { | ||
7 | inherit plugins allPlugins; | ||
8 | pluginNames = map (n: n.pluginName) plugins; | ||
9 | withPlugins = withPlugins pkg; | ||
10 | }; | ||
11 | withPlugins = pkg: toPlugins: | ||
12 | let | ||
13 | plugins = toPlugins allPlugins; | ||
14 | toInstallPlugin = n: | ||
15 | if builtins.hasAttr "selector" n then | ||
16 | "ln -sf ${n}/${n.selector} $out/plugins/" | ||
17 | else | ||
18 | "ln -sf ${n} $out/plugins/${n.pluginName}"; | ||
19 | newMantisbt = pkg.overrideAttrs(old: { | ||
20 | installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallPlugin plugins); | ||
21 | passthru = toPassthru newMantisbt (pkg.plugins ++ plugins); | ||
22 | }); | ||
23 | in newMantisbt; | ||
24 | package = stdenv.mkDerivation rec { | ||
25 | name = "mantisbt-${version}"; | ||
26 | version = "2.21.0"; | ||
27 | src = fetchurl { | ||
28 | url = "https://downloads.sourceforge.net/project/mantisbt/mantis-stable/${version}/${name}.tar.gz"; | ||
29 | sha256 = "13lx569dp1gibq5daqp7dj6gsqic85rrix1s7xkp60gwpzk8wiw5"; | ||
30 | }; | ||
31 | patches = [ | ||
32 | ./bug_report.php.diff | ||
33 | ./bug_report_page.php.diff | ||
34 | ./bugnote_add.php.diff | ||
35 | ./bugnote_add_inc.php.diff | ||
36 | ]; | ||
37 | installPhase = '' | ||
38 | cp -a . $out | ||
39 | ln -s ${mantis_config} $out/config/config_inc.php | ||
40 | ''; | ||
41 | |||
42 | passthru = toPassthru package []; | ||
43 | }; | ||
44 | in package | ||