-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
minetestWithPackages,minetestPackages: init (minetest bundled with mods and games, package set generated from ContentDB) #194749
base: master
Are you sure you want to change the base?
Conversation
pkgs/top-level/all-packages.nix
Outdated
minetestWithPackages = callPackage ../games/minetest/minetest-with-packages.nix { }; | ||
|
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.
What is the convention for *withPackages
attribute paths? Should it stay at top level? inside minetestPackages
? inside minetest
?
@GrahamcOfBorg build nixosTests.minetest-with-packages |
.editorconfig
Outdated
@@ -92,3 +92,6 @@ trim_trailing_whitespace = unset | |||
|
|||
[pkgs/tools/misc/timidity/timidity.cfg] | |||
trim_trailing_whitespace = unset | |||
|
|||
[pkgs/games/minetest/packages/contentdb/default.nix] |
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 script that generates this file should be fixed so that it doesn't include any whitespace.
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.
Why? Other generated files get the exception, the trailing whitespace does no harm since the file is always regenerated in the same way, and removing it would make the generator script less readable.
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 others (only eggs.nix
files and hackage-packages.nix
) were pre-existing when we added this check and they won't be exemption when we start formatting .nix
files.
make the generator script less readable.
Could just format the file which would remove the whitespace.
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.
Could just format the file which would remove the whitespace
That's definitely cleaner, but I'd still like to know why that is useful for a generated file.
In NixOS/rfcs#101 it was decided not to format generated files, and there is still no consensus on the style/formatter to use, so why should we add complexity now, at the risk of having to change the formatter later?
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'd still like to know why that is useful for a generated file.
What benefit is there in excluding files? Isn't it easier if the entire tree is consistent? Currently there are only 5 nix files excluded because of whitespace, I can easily reduce that to just one (haskell package set). If haskell is fixed do you still think this file should to be excluded?
it was decided not to format generated files
Where does it day that?
so why should we add complexity now
Doesn't seem complicated.
at the risk of having to change the formatter later
What does it matter if it needs to be changed?
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.
What benefit is there in excluding files? Isn't it easier if the entire tree is consistent?
I think it isn't really easier for anyone, since nobody is going to manually touch that file.
But...
If haskell is fixed do you still think this file should to be excluded?
Probably not
Where does it day that?
Looks like I can't find it anymore... I only find conflicting info about that now
Doesn't seem complicated.
Fair enough, and this is really a minor thing so I don't know why I was so stubborn...
Fixed. Now the extra whitespaces are filtered out.
The generated file is 1MB! Honestly think this would be better in an external repo. |
Well, it's not like this is the first or the biggest generated file in nixpkgs:
And it compresses well. Then, after this first commit, it's just going to be small diffs. Still, I could take some steps to further minimize file size:
I will do the first point, that just makes sense. |
Doesn't mean we should keep adding them.
Doesn't change that it's still 1MB extra bloat in shallow checkouts. Why can't it live in an external repo? |
That's less than 0.5% of nixpkgs, for more than a thousand of FOSS games and game mods. That seems like a good tradeoff to me
That question applies to every single package or package set though, doesn't it? And it has been discussed to death:
Regarding generated sets, the closest to a conclusion that I got from all those discussions is: Let's wait until flakes are stable to discuss this again, meanwhile generated sets are fine. Regarding general package inclusion, this package set is updated upstream, will be updated here because it's automated, and is used by many |
I explained why I think merging this is reasonable and provided a history of relevant discussions. Can I at least get some constructive criticism instead of downvotes and laughs? |
Seems like I might have downvoted that, too, but that wasn't intentional. |
Sorry, meant to post a response.
It's already so bloated we should just keep adding more? Keeping a generated 1MB file out of the repo seems like a very easy win with basically no downside, it's not like adding another input is a hassle.
Sound like a perfect example of something that can live in it's own repo.
People with bad internet would likely disagree. |
… override is plausible.
…variable MINETEST_MOD_PATH.
* add support for games * rename from minetestWithMods * add contentdb package set generator, move existing mods to extra-packages * remove from extra-packages abandoned mods and mods that are in contentdb * general improvements
Adding a new input and keeping it updated is a hassle without the still experimental flakes.
Why? As mentioned in #194749 (comment) we have a consensus about including generated sets in nixpkgs. What is different about this set from haskell, emacs, vim, node, r... packages?
Trust me, I know how bad modern software can get with a bad internet connection! I had a terrible one until not so long ago. That's why I tried to optimize this as much as possible (it's now down to <1 MB uncompressed, 180K gzipped). In nixpkgs there are multiple packages that are individually more than that size. There is still something I can do, though I'm not sure if that would be accepted: instead of only having a map mkMinetestPackage (importJSON ./packages.json) |
meta = with lib; { | ||
description = "Zombies based on TenPlus1's Mob API"; | ||
license = licenses.mit; | ||
maintainers = with maintainers; [ hllizi ]; |
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.
@hllizi you are not in the nixpkgs maintainer list yet. Are you fine with me adding you or removing the zombies mod?
@@ -48,5 +48,15 @@ | |||
|
|||
# This is an alias which we disallow by default; explicitly allow it | |||
emacs28Packages = emacs28.pkgs; | |||
|
|||
# FIXME: if minetestPackages uses callPackage anywhere, this will not work. Why? |
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 have no clue why this doesn't work with callPackage
, I could use some help here
I used the word "inputs" but I didn't mean to refer to flakes specifically ... nix-channel, niv, npins, whatever.
Keeping it updated like you have to update nixpkgs anyway? How is that a hassle?
Not sure what this is? If you mean https://github.com/nix-community/nixpkgs-swh it hasn't been working for quite a while.
They are already in nixpkgs, this isn't. Haskell and node are used tree-wide by other packages. The others likely be could be external. This package set seems to be very self-contained, hence much easier to be kept out.
Would have expected a bit more consideration for the people who won't use this and are getting stuck with the bloat anyway.
...
Again, they already in and this isn't. It doesn't mean we should keep adding more, especially when keeping it out doesn't have much downside.
Plenty of packages and sets do this so I don't see why it would be a problem here. 600k is still a lot of bloat so it doesn't change my objection. |
The generated file is just twice some node-packages.nix file. Not a fan of these either since they just download, unzip and symlink things. |
@fgaz Are you still planning to work on this? |
@nyabinary I plan to push a refinement I had locally on this branch (for archival), then I plan to close this and open a smaller pr that just adds the extension points (with a better design). I'll drop the package set for now. In parallel, I'm working on adding contentdb support to npins |
Description of changes
Based on #189724 cc @hllizi
Closes #189724
Fixes #82680
This iteration addresses my comments on the previous PR and adds a
minetestPackages.contentDB
package set generated from https://content.minetest.netHere's a screenshot obtained by building
nixosTests.minetest-with-packages
, which runs the packageminetestWithPackages (mtps: [ mtps.contentDB.Wuzzy.mineclone2 ])
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