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
tree-wide: add missing parent icon themes #85229
Conversation
buildInputs = [ | ||
breeze-icons | ||
gnome-icon-theme | ||
papirus-icon-theme |
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.
Do they get referenced in the build?
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.
No. They get referenced in the installed file share/icons/Papirus-Adapta-Maia/index.theme
(and others):
Inherits=Papirus,breeze,gnome,hicolor
And it expects just that those themes are installed.
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.
Ok. The problem is that just adding them to buildInputs
won't make them available at runtime or install them into the user's profile.
cc @jtojnar
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.
Yeah, I think the inherited themes need to go to propagatedBuildInputs
. Recently encountered this issue in #84983.
@@ -18,6 +19,7 @@ stdenv.mkDerivation rec { | |||
|
|||
propagatedUserEnvPkgs = [ |
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 propagatedBuildInputs
should be enough but I am not completely sure.
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 derivation was already using propagatedUserEnvPkgs
and I have just added missing dependencies. I will change it to propagatedBuildInputs
, handling the dependencies uniformly.
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.
Is propagatedUserEnvPkgs
documented somewhere? I am not finding it in the nixpkgs manual.
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.
It is not documented because it is frowned upon since it breaks purity.
But reading #34657 (comment), propagatedBuildInputs
might not work.
Relevant: #43049
I have tested with Only with The following screenshots illustrates the results. With With I think this is conclusive. |
I think it might be preferable (even though ugly) to symlink the inherited themes into the output. Relying on |
If symlink works, than this should be the preferred solution. In future a setup-hook that scans |
Won't this result in collisions if the parent theme is installed separately? (That might be fine, they're the same content after all). |
Testing with symbolic links in Collisions are reported at build time:
|
Should I go on and implement this solution for all icon themes? |
Using symlinks has one complexity: indirect inheritance. It would be needed to symlink also the parent themes from the parents, and so on, up to the inheritance root. This is not implemented yet in this PR. Also I am not liking the number of collisions. |
Now there is a setup hook in The dependencies providing parent icon themes should be propagated. It works for indirect inheritance. I have also tried to fix all packages providing icon themes in nixpkgs in order to indicate the dependencies needed to find the parent themes. |
I like the approach @jtojnar has suggested here, I also really don't favor using
I think this is something we should document in the gnome section in the nixpkgs manual. @jtojnar do you think backporting 682734d would be a good idea for 20.03?
These collision warnings have always been annoying, 😄 even if this introduced some. |
Also: - add runHook calls - move postFixup actions to installPhase - gtk-update-icon-cache does accepts only one icon path
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Motivation for this change
Icon themes may inherit from other icon themes. The inheritance is specified using the
Inherits
key in theindex.theme
file.According to the icon theme specification that means that icons not provided by the theme are looked for in its parents. The idea is that missing icons are looked for in the parent icon themes, in the order specified.
Therefore the parent themes should be installed as dependencies for a more complete experience regarding the icon sets used.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)