gpodder: fix to preserve GPODDER_HOME environment variables

This commit is contained in:
2025-03-20 15:38:19 +00:00
parent 73d79e10e7
commit cfde788dc4
2 changed files with 21 additions and 10 deletions

View File

@@ -17,7 +17,7 @@ in {
# - GPODDER_WRITE_LOGS ("yes" or "no") # - GPODDER_WRITE_LOGS ("yes" or "no")
# - GPODDER_EXTENSIONS # - GPODDER_EXTENSIONS
# - GPODDER_DISABLE_EXTENSIONS ("yes" or "no") # - GPODDER_DISABLE_EXTENSIONS ("yes" or "no")
extraMakeWrapperArgs = (base.extraMakeWrapperArgs or []) ++ [ makeWrapperArgs = (base.makeWrapperArgs or []) ++ [
"--set" "GPODDER_HOME" "~/.local/share/gPodder" "--set" "GPODDER_HOME" "~/.local/share/gPodder"
# place downloads in a shared media directory to ensure sandboxed apps can read them # place downloads in a shared media directory to ensure sandboxed apps can read them
"--set" "GPODDER_DOWNLOAD_DIR" "~/Videos/gPodder" "--set" "GPODDER_DOWNLOAD_DIR" "~/Videos/gPodder"

View File

@@ -6,9 +6,10 @@
{ {
gpodder, gpodder,
lib,
listparser, listparser,
makeShellWrapper,
static-nix-shell, static-nix-shell,
symlinkJoin,
}: }:
let let
@@ -21,12 +22,22 @@ let
}; };
}; };
in in
# we use a symlinkJoin so that we can inherit the .desktop and icon files from the original gPodder gpodder.overrideAttrs (upstream: {
(symlinkJoin { # use `makeShellWrapper` here so that we can get expansion of env vars like `$HOME`, at runtime
name = "${gpodder.pname}-configured"; nativeBuildInputs = (upstream.nativeBuildInputs or []) ++ [
paths = [ gpodder remove-extra ]; makeShellWrapper
];
passthru = { dontWrapGApps = true;
inherit gpodder remove-extra; postFixup = (upstream.postFixup or "") + ''
}; # XXX(2025-03-21): splat the makeWrapperArgs here because upstream gpodder specifies
}) # `--suffix PATH ...` all as _one_ argument, but makeShellWrapper requires it to be multiple :(
makeWrapperArgs=(''${makeWrapperArgs[*]} "''${gappsWrapperArgs[@]}")
# makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
for f in $out/bin/*; do
wrapProgramShell "$f" "''${makeWrapperArgs[@]}"
done
makeShellWrapper ${lib.getExe remove-extra} "$out/bin/${remove-extra.meta.mainProgram}" "''${makeWrapperArgs[@]}"
'';
})