Commit 91ddd3623e43

Vincent Demeester <vincent@sbr.pm>
2026-06-29 11:54:12
fix(wallabag): add PHP to PATH in setup service
wallabag-setup failed silently because console commands use a '#!/usr/bin/env php' shebang but php was not in the service PATH. Errors were swallowed by '|| true', leaving the database uninitialized and Caddy returning 404.
1 parent 949a2f0
Changed files (1)
modules
wallabag
modules/wallabag/default.nix
@@ -61,6 +61,7 @@ let
 
   # Setup script that initializes the data directory and runs migrations
   wallabag-setup = pkgs.writeShellScript "wallabag-setup" ''
+    export PATH="${phpPackage}/bin:$PATH"
     set -euo pipefail
 
     DATA_DIR="${cfg.dataDir}"
@@ -327,6 +328,7 @@ in
         Group = cfg.group;
         RemainAfterExit = true;
         ReadWritePaths = [ cfg.dataDir ];
+        Environment = "PATH=${phpPackage}/bin:${pkgs.coreutils}/bin";
         WorkingDirectory = cfg.package;
       };
       restartTriggers = [