-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
treewide: inject xdg-open into wrappers as $PATH suffix #181171
Conversation
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/1072 |
This is great! It makes a fix for #160923 a lot less intrusive as you can just provide a better |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! There are some merge conflicts to deal with since this was submitted, but I think it would be ok to merge after that.
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
I think we should accompany this by a contributing guide change to prefix such tools. |
Merge conflicts need to be resolved & contributing guide should be updated
(FWIW, my xdg-open replacement.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the docs should be good with @fricklerhandwerk's suggestions. I also noticed though that there are still a few other places where we should suffix xdg-utils:
pkgs/applications/audio/bitwig-studio/bitwig-studio1.nix
pkgs/applications/audio/bitwig-studio/bitwig-studio3.nix
pkgs/applications/misc/avrdudess/default.nix
pkgs/applications/misc/fff/default.nix
pkgs/applications/networking/browsers/brave/default.nix
pkgs/applications/networking/browsers/google-chrome/default.nix
pkgs/applications/networking/browsers/offpunk/default.nix
pkgs/applications/networking/instant-messengers/armcord/default.nix
pkgs/applications/office/jabref/default.nix
pkgs/applications/version-management/sparkleshare/default.nix
pkgs/tools/admin/aws-sso-cli/default.nix
pkgs/tools/bluetooth/blueman/default.nix
Most of these are places where the wrapper is created indirectly through some other variable that includes xdg-utils
, but some of them are just new updates to packages since this was started.
Also to fit CONTRIBUTING.md, the first commit should be renamed to: |
I've fixed the packages that @kira-bruneau found. |
Steam FHS does this too but it's fine to leave it out of this change as it has some indirection, probably better to be in a separate PR. |
I don't want to touch the FHS or appimage stuff, that should be a different PR. |
I'll try to do it for steam. |
@@ -102,7 +102,6 @@ in stdenv.mkDerivation rec { | |||
glxinfo | |||
gnugrep | |||
gnused | |||
xdg-utils |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ./hardcode-dependencies.patch
file will have to be updated to account for this change. I can take a look at this since I maintain mangohud.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm wait, yeah the reason I hard-code these dependencies is because the library needs them, and mangohud can be enabled independently from the executable with MANGOHUD=1
.
I think for now we should just leave this unchanged, I'll try to figure out a better solution for another PR.
@@ -50,7 +50,7 @@ stdenv.mkDerivation (finalAttrs: { | |||
|
|||
wrapProgram $out/bin/offpunk \ | |||
--set PYTHONPATH "$PYTHONPATH" \ | |||
--set PATH ${lib.makeBinPath otherDependencies} | |||
--suffix PATH ${lib.makeBinPath otherDependencies} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should only suffix xdg-utils
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[ less timg xdg-utils xsel ]
@@ -221,7 +221,7 @@ let | |||
|
|||
postFixup = '' | |||
for script in "$out"/bin/*; do | |||
wrapProgram "$script" --prefix PATH : "${runtimePath}" | |||
wrapProgram "$script" --suffix PATH : "${runtimePath}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should change this. It seems like runtimePath
may include xdg-utils (I can't tell because it's populated by a function argument, runtimeInputs
), but we shouldn't be suffixing any other dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The maintainer made this too complicated to begin with.
The xdg-open utility is only ever a runtime dependency and its dependents only expect that it accept a URI as a command line argument and do something with it that the user would expect. For such as a trivial relationship it should be possible for users to override xdg-open with something else in their PATH.
Merged what was reviewed. |
I used to have the following in my config: nixpkgs.overlays = [(
self: super: {
xdg-utils = super.xdg-utils.override { mimiSupport = true; };
}
)]; Unfortunately this resulted in having to build Chromium from source whenever there was a new version so I had to remove it again. Does this PR mean I can add the overlay again without having to re-compile the world on every update? |
@jtrees As far as I can see, no. Rebuilding a derivation because of an override is in the nature of |
Ah shame. I thought I saw that It's literally only used to add it to the |
@jtrees You do not want to override |
Ah, that makes sense! I'll try it. Thanks. |
Description of changes
The xdg-open utility is only ever a runtime dependency and its
dependents only expect that it accept a URI as a command line
argument and do something with it that the user would expect.
For such as a trivial relationship it should be possible for
users to override xdg-open with something else in their PATH.
I don't know anyone that knows what
xdg-open
does but hasn't also replaced it with a shell script.Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes