nixos/freshrss: migrate to DATA_PATH

This commit is contained in:
Felix Buehler 2023-10-24 21:19:42 +02:00
parent 67b0da8f51
commit 29d41b7fd2
2 changed files with 3 additions and 11 deletions

View File

@ -220,7 +220,7 @@ in
"catch_workers_output" = true; "catch_workers_output" = true;
}; };
phpEnv = { phpEnv = {
FRESHRSS_DATA_PATH = "${cfg.dataDir}"; DATA_PATH = "${cfg.dataDir}";
}; };
}; };
}; };
@ -267,7 +267,7 @@ in
WorkingDirectory = cfg.package; WorkingDirectory = cfg.package;
}; };
environment = { environment = {
FRESHRSS_DATA_PATH = cfg.dataDir; DATA_PATH = cfg.dataDir;
}; };
script = script =
@ -302,7 +302,7 @@ in
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
startAt = "*:0/5"; startAt = "*:0/5";
environment = { environment = {
FRESHRSS_DATA_PATH = cfg.dataDir; DATA_PATH = cfg.dataDir;
}; };
serviceConfig = defaultServiceConfig //{ serviceConfig = defaultServiceConfig //{
ExecStart = "${cfg.package}/app/actualize_script.php"; ExecStart = "${cfg.package}/app/actualize_script.php";

View File

@ -26,12 +26,6 @@ stdenvNoCC.mkDerivation rec {
# There's nothing to build. # There's nothing to build.
dontBuild = true; 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 = '' postPatch = ''
patchShebangs cli/*.php app/actualize_script.php patchShebangs cli/*.php app/actualize_script.php
''; '';
@ -39,8 +33,6 @@ stdenvNoCC.mkDerivation rec {
installPhase = '' installPhase = ''
mkdir -p $out mkdir -p $out
cp -vr * $out/ cp -vr * $out/
cp $overrideConfig $out/constants.local.php
''; '';
meta = with lib; { meta = with lib; {