nixpkgs/pkgs/servers/web-apps/freshrss/default.nix
colin 9443d83e6f freshrss: patchShebangs instead of specifying interpreter at use site
this makes it easier for one to manually administer freshrss.
for example, i can import OPML from the CLI like:

```
$ nix build .#freshrss
$ freshrss FRESHRSS_DATA_PATH=/var/lib/freshrss ./result/cli/import-for-user.php --user admin --file my-opml.opml
```

whereas previously i would have needed to include
`environment.systemPackages = [ php ];` in my system for that to work.
2022-10-13 21:46:04 -07:00

51 lines
1 KiB
Nix

{ stdenvNoCC
, lib
, fetchFromGitHub
, nixosTests
, php
, pkgs
}:
stdenvNoCC.mkDerivation rec {
pname = "FreshRSS";
version = "1.20.0";
src = fetchFromGitHub {
owner = "FreshRSS";
repo = "FreshRSS";
rev = version;
hash = "sha256-mzhEw2kFv77SmeuEx66n9ujWMscZO3+03tHimk1/vk4=";
};
passthru.tests = nixosTests.freshrss;
buildInputs = [ php ];
# There's nothing to build.
dontBuild = true;
# the data folder is no in this package and thereby declared by an env-var
overrideConfig = pkgs.writeText "constants.local.php" ''
<?php
define('DATA_PATH', getenv('FRESHRSS_DATA_PATH'));
'';
postPatch = ''
patchShebangs cli/*.php app/actualize_script.php
'';
installPhase = ''
mkdir -p $out
cp -vr * $out/
cp $overrideConfig $out/constants.local.php
'';
meta = with lib; {
description = "FreshRSS is a free, self-hostable RSS aggregator";
homepage = "https://www.freshrss.org/";
license = licenses.agpl3Plus;
maintainers = with maintainers; [ etu stunkymonkey ];
};
}