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/ttrss/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/ttrss/default.nix')
-rw-r--r-- | flakes/mypackages/pkgs/webapps/ttrss/default.nix | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/flakes/mypackages/pkgs/webapps/ttrss/default.nix b/flakes/mypackages/pkgs/webapps/ttrss/default.nix new file mode 100644 index 0000000..fa2453e --- /dev/null +++ b/flakes/mypackages/pkgs/webapps/ttrss/default.nix | |||
@@ -0,0 +1,37 @@ | |||
1 | { ttrss_config ? "/etc/ttrss/config.php" | ||
2 | , varDir ? "/var/lib/ttrss" | ||
3 | , stdenv, lib, callPackage, sources }: | ||
4 | let | ||
5 | pluginNames = [ "auth_ldap" "af_feedmod" "feediron" "ff_instagram" "tumblr_gdpr_ua" ]; | ||
6 | allPlugins = lib.attrsets.genAttrs pluginNames | ||
7 | (name: callPackage (./plugins + "/${name}") {}); | ||
8 | toPassthru = pkg: plugins: { | ||
9 | inherit plugins allPlugins; | ||
10 | withPlugins = withPlugins pkg; | ||
11 | }; | ||
12 | withPlugins = pkg: toPlugins: | ||
13 | let | ||
14 | plugins = toPlugins allPlugins; | ||
15 | toInstallPlugin = n: | ||
16 | "ln -sf ${n} $out/plugins/${n.pluginName}"; | ||
17 | newTtrss = pkg.overrideAttrs(old: { | ||
18 | installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallPlugin plugins); | ||
19 | passthru = toPassthru newTtrss (pkg.plugins ++ plugins); | ||
20 | }); | ||
21 | in newTtrss; | ||
22 | package = stdenv.mkDerivation rec { | ||
23 | pname = "tt-rss"; | ||
24 | version = "${sources.tools.ttrss.shortRev}-master"; | ||
25 | name = "${pname}-${version}"; | ||
26 | src = sources.tools.ttrss; | ||
27 | buildPhase = '' | ||
28 | rm -rf lock feed-icons cache | ||
29 | ln -sf ${varDir}/{lock,feed-icons,cache} . | ||
30 | ''; | ||
31 | installPhase = '' | ||
32 | cp -a . $out | ||
33 | ln -s ${ttrss_config} $out/config.php | ||
34 | ''; | ||
35 | passthru = toPassthru package []; | ||
36 | }; | ||
37 | in package | ||