diff --git a/hosts/common/programs/gpodder.nix b/hosts/common/programs/gpodder.nix index 662d24302..4c23568c6 100644 --- a/hosts/common/programs/gpodder.nix +++ b/hosts/common/programs/gpodder.nix @@ -17,7 +17,7 @@ in { # - GPODDER_WRITE_LOGS ("yes" or "no") # - GPODDER_EXTENSIONS # - GPODDER_DISABLE_EXTENSIONS ("yes" or "no") - extraMakeWrapperArgs = (base.extraMakeWrapperArgs or []) ++ [ + makeWrapperArgs = (base.makeWrapperArgs or []) ++ [ "--set" "GPODDER_HOME" "~/.local/share/gPodder" # place downloads in a shared media directory to ensure sandboxed apps can read them "--set" "GPODDER_DOWNLOAD_DIR" "~/Videos/gPodder" diff --git a/pkgs/by-name/gpodder-configured/package.nix b/pkgs/by-name/gpodder-configured/package.nix index 6e6a57143..f4ae83b7a 100644 --- a/pkgs/by-name/gpodder-configured/package.nix +++ b/pkgs/by-name/gpodder-configured/package.nix @@ -6,9 +6,10 @@ { gpodder, + lib, listparser, + makeShellWrapper, static-nix-shell, - symlinkJoin, }: let @@ -21,12 +22,22 @@ let }; }; in -# we use a symlinkJoin so that we can inherit the .desktop and icon files from the original gPodder -(symlinkJoin { - name = "${gpodder.pname}-configured"; - paths = [ gpodder remove-extra ]; + gpodder.overrideAttrs (upstream: { + # use `makeShellWrapper` here so that we can get expansion of env vars like `$HOME`, at runtime + nativeBuildInputs = (upstream.nativeBuildInputs or []) ++ [ + makeShellWrapper + ]; - passthru = { - inherit gpodder remove-extra; - }; -}) + dontWrapGApps = true; + 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[@]}" + ''; + })