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
gnome3: Package all the Gnome extensions #108414
Conversation
84e38bf
to
5b1cb27
Compare
@GrahamcOfBorg eval |
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 did a quick pass of the code. There are a few things we can and probably should improve when we want this to land.
I wonder what the usage guidelines of the gnome API are and I worry a bit about licenses of extensions.
@ofborg eval |
f899451
to
7ebc6c7
Compare
I'm not going to suggest my changes on the diff because I think it's more helpful to address this conceptually. I'm going to start with the points that are going to influence how this code looks the most.
There are a few issues:
I'm going to try to explain these in detail and suggest what I think we should do. Number 1&21&2 are linked so I will answer them similarly.
We can then have overrides for some of these packages so the more complicated extensions can actually work, and have maintainer fields. I would then request that we should split out the overrides into separate files, and not one giant one. Number 3There is an alternative to having the
For now I would say that good examples to see how this works in nixpkgs is TangentsAnother parallel that we can have with I'm going to steer away from documentation being a goal for now because we're just at a point where things might change a lot, but the other point can be implemented in nix code. I could suggest:
ClosingThank you soo much for your PR @piegamesde ✨ ✌️ |
Primary keysLet's get #3 out of the way first. Every extension has multiple unique identifiers. The UUID is one, and the number at the end of a name is one as well. I chose the MaintenanceSpeaking of which, as long as there is little to no manual overhead to the individual extensions, I'd be willing to maintain them all.
The extensions are installed exactly the way as it would be done through Gnome UI. And except for those that do some platform-specific magic foo (I haven't encountered any yet), all those that work on "normal" Gnome should work as well. But I agree that we need some kind of override mechanism for custom packaging. Moving onI propose to implement the following things:
An alternative proposal would be to only package the |
Yeah, I'm against this as well. As mentioned there is just too few extensions for it to be worth doing that.
Considering you mentioned someway of creating automated testing, I think we're all in good hands 😁 Overall the proposed changes are fine. But I would still harp on the index-id -> uuid change, because out of context it just feels weird to have some numbers with no apparent reason (to the enduser) in the package name. UUID's are typically suited for this purpose and somewhat ubiquitous with certain people. |
Oops, the allow list is simply what people put in their configuration (to build a broken package), and this already exists. |
fb4c962
to
a38f0a8
Compare
@worldofpeace I've thought about this again, and I really don't like using the UUIDs as primary identifiers. These will be the names that people will see (and have to look for) in the search. They are bulky, inconsistent in their casing and comparatively hard to discover. So I somewhat retract my claim about not caring about this. My proposal for using the informal ID from the extension's URL still stands. But if you prefer, I propose to try remove the number from the name unless there are some collisions. |
e7ffc63
to
3b266a9
Compare
I went ahead and renamed all the packages according to my previous comment. I really like the new names a lot more. I did a quick check and there don't seem to be any name collisions so far. |
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.
Did another pass through the code again. I am not a gnome user but I want to ensure that we have a decent level of code quality within Nixpkgs. At least on all those PRs that I have time & energy to review.
Sadly, I have to take that back. After fixing some embarassing bug, it now finds quite a few collisions. I honestly can't tell if this is fine, or if there are too many and we should go back to one of the other approaches |
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 this is really great. I am looking forward to using this.
I have a few minor nitpicks but nothing big (and I am no expert in modern python).
Please don‘t merge just because of my approval though. I‘d like to see one or two more.
e412c7b
to
bfe7a0c
Compare
# If our page isn't "full", it must have been the last one | ||
if responseLength < 25: | ||
logging.debug( | ||
f"\tThis page only has {responseLength} entries, so it must be the last one." |
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.
Logging should never use f-strings. The idea is that the expensive operation of substituting some strings in there should only be done if the log level requires it and otherwise it should be constant cost to skip this line.
I'll not be pedantic on this here as well this isn't a real application anyway...
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.
Thanks for the notice, but I think changing this would not improve the readability of the code, and the performance impact of this is absolutely negligible.
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 isn't about performance but consistent pythonic code style.
75334dd
to
345886b
Compare
345886b
to
52bfb84
Compare
An automatic way to do this that scales up and requires little manual intervention is really needed. It works by scraping extensions.gnome.org with a python script, that writes all relevant information into the `extensions.json`. Every attribute of besaid file can be built into a package using `buildShellExtension`. Extensions are grouped by Gnome shell version for practical reasons. Only extensions for Gnome 3.36 and 3.38 were added, as we don't support legacy Gnome versions. The extensions are exposed as an attrset, `pkgs.gnome36Extensions` and `pkgs.gnome38Extensions` respectively. The package name of each extensions is generated automatically from its UUID. The attribute `pkgs.gnomeExtensions` contains the officially packaged and supported extensions set. It contains all the automatically packaged extensions for the current Gnome Shell version, which are overwritten by manually packaged ones where needed. Unlike gnomeXYExtensions, the names are not UUIDs, but automatically generated human- friendly names. Naming collisions – which are tracked in collisions.json – need to be manually resolved in the `extensionRenames` attrset.
52bfb84
to
74463a4
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/what-are-your-goals-for-21-05/11559/17 |
Co-authored-by: Andreas Rammhold <andreas@rammhold.de>
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
e447f7b
to
838a6ea
Compare
Moved to #118232 |
Motivation for this change
An automatic way to do this that scales up and requires little manual intervention is really needed. It works by scraping extensions.gnome.org with a python script,
that writes all relevant information into the
extensions.json
. Every attribute of besaid file can be built into a package usingbuildShellExtension
.Extensions are grouped by Gnome shell version for practical reasons. Only extensions for Gnome 3.36 and 3.38 were added for now. If desired, we can always add older versions later on.
The extensions are exposed as an attrset,
pkgs.gnome36Extensions
andpkgs.gnome38Extensions
respectively. The package name of each extensions is generated automaticallyfrom its name and also contains its running index ID (e.g.
pkgs.gnome36Extensions.system-monitor-120
) to avoid collisions.The old, manually packaged extensions under
pkgs.gnomeExtensions
are left as they are for now for backwards compatibility. We could link them to the new ones and then removethe manual packaging, or keep them, or delete them alltogether. We could also link
pkgs.gnomeExtensions
topkgs.gnome38Extensions
or whatever the most recent version is (similar to what is done forpythonPackages
).You can have a look at all the extensions in my NUR.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review pr 108414"
./result/bin/
)nix path-info -S
before and after)