-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
xdg-mime type package options #5920
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The `xdg-mime` module now exposes packages to determine what will be run for update-mime-database and update-desktop-database. This allows users to select a different version of these packages if the are incompatible. This should, in combination with an override to the version of `shared-mime-info` (can be found here notalltim/home-manager-config#4), resolve nix-community#4955, nix-community#5102, nix-community#4682, and possibly nix-community#4941. The problem seems to stem from a mismatch in the version of `shared-mime-info` with the host. I also switched from using `buildPackages` to `pkgs` to improve cross-compilation compatibility.
The xdg-mime module was missing tests so I added basic test for all the options and checked the basic behavior. It covers ensuring that the proper files/folders are created and that the package overrides work.
though it's possible to achieve that via an overlay, I can see how this could be easier to use. |
Artturin
reviewed
Oct 8, 2024
@@ -46,12 +63,12 @@ in { | |||
if [[ -w $out/share/mime && -w $out/share/mime/packages && -d $out/share/mime/packages ]]; then | |||
XDG_DATA_DIRS=$out/share \ | |||
PKGSYSTEM_ENABLE_FSYNC=0 \ | |||
${pkgs.buildPackages.shared-mime-info}/bin/update-mime-database \ | |||
${getExe cfg.sharedMimeInfoPackage} \ |
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.
These are run during the build right?, so this breaks cross. Reported by @colemickens
2 tasks
Mikilio
pushed a commit
to Mikilio/home-manager
that referenced
this pull request
Oct 11, 2024
* xdg-mime: allow overrides to shared-mime-info and desktop-file-utils The `xdg-mime` module now exposes packages to determine what will be run for update-mime-database and update-desktop-database. This allows users to select a different version of these packages if the are incompatible. This should, in combination with an override to the version of `shared-mime-info` (can be found here notalltim/home-manager-config#4), resolve nix-community#4955, nix-community#5102, nix-community#4682, and possibly nix-community#4941. The problem seems to stem from a mismatch in the version of `shared-mime-info` with the host. I also switched from using `buildPackages` to `pkgs` to improve cross-compilation compatibility. * xdg-mime: Add tests for xdg-mime module The xdg-mime module was missing tests so I added basic test for all the options and checked the basic behavior. It covers ensuring that the proper files/folders are created and that the package overrides work.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds package options for
shared-mime-info
anddesktop-file-utils
for the purpose of allowing users to override the version in nixpkgs. This with overridden version ofshared-mime-info
should resolve #4955, #5102, #4682, and possibly #4941. I also added a couple basic tests for the module. An example of using the override can be found at notalltim/home-manager-config#4. I did not see a maintainer let me know if I missed one.Checklist
Change is backwards compatible.
Code formatted with
./format
.Code tested through
nix-shell --pure tests -A run.all
ornix develop --ignore-environment .#all
using Flakes.Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module
Maintainer CC