-
-
Notifications
You must be signed in to change notification settings - Fork 17.7k
nextcloud: build from source #442910
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
base: master
Are you sure you want to change the base?
nextcloud: build from source #442910
Conversation
|
Really great work, thank you! What do you think about moving the derivation to Instead of building all the Nextcloud apps from source here too, what about putting them into nextcloudApps subpackages first and include the default set into services.nextcloud.extraApps |
pkgs/development/python-modules/sphinxcontrib-mermaid/default.nix
Outdated
Show resolved
Hide resolved
pkgs/development/python-modules/sphinxcontrib-mermaid/default.nix
Outdated
Show resolved
Hide resolved
I'm pretty sure that this won't save asset rebuilds? Especially because it's not guaranteed that the sources are the same? Also, how would moving a single major version to by-name help with this? This really seems like another attempt to move stuff to by-name just for the sake of it (some packages don't fit into that structure and that's fine).
Can you give a rationale for doing that, please? This seems like needlessly overcomplicating stuff. |
|
Thanks! I need a few quiet hours for a closer review. While this looks pretty nice and promising, there are a few aspects (like the ad-hoc check if certain dependencies are required) that I'm afraid will cause major maintenance pain on upgrades and I don't have the time & spoons currently to think of suggestion on how to make this a little better. |
Maybe only have the newest Nextcloud version in
In my opinion the Nextcloud derivation in this PR is too big and complex for now. As a NixOS newbie I wouldn't knew where to start. So building just Nextcloud core/server and pulling all default required apps from pkgs.nextcloudApps would be a simpler and more straightforward approach |
The problem is that Nextcloud only allows upgrading from one major version to the next without skipping one. |
the nextcloud module can always pin a specific nextcloud version depending on the nixos release version. the nextcloud package in |
2d6ae11 to
55e1ad6
Compare
|
Some apps ship a .nextcloudignore, it should be used here to remove additional unwanted files. |
|
Tried to rebase for 32, but unfortunately there are new apps which have somewhat broken package-lock.json files. I'll try to fix those, but probably not for 32.0.1 due to having too little time right now. I'll also try to fix the root cause of these issues, as otherwise we will probably have the issue over and over with each new patch release (and thus being unable to build without modified package-lock.json files). |
|
For the broken package-lock.json files I made nextcloud/.github#620, so it hopefully goes away soon and doesn't need any manual fixes anymore. |
This builds on work from NixOS#442910, but adds support for building from specific revisions, which is then used to build nextcloud33. Like in that PR, updating hashes is a very painful part of this - and maybe moreso as there's no script to figure out what versions you need: you need to manually get the git revisions for all of them and update the hashes in versions.json... that could be greased with some script that, say, fetched every "latest" commit at a given time. If you're trying to update the hashes yourself, I'd suggest running something like: nix-build ./default.nix -A nextcloud33 --keep-going and picking off the hashes several at a time (rather than either manually calculating hashes or running many, many builds) Some further observations: - The way this is implemented in this commit is a bit of a hack - but a surprisingly nice one. It might be worth implementing something similar to this upstream (if only because of the documentation not being versioned!) - This feels very not-easy to override - I suspect if you want a custom build of nextcloud you really want to be forking nixpkgs and doing this sort of process rather than trying to overlay this in your own configs - You can't make the version (dynamic from the name in versions.json) anything you like - it has to be accepted by PHP which means things like "33.unstable-2025-10-27" aren't acceptable. You want instead to use something that roughly looks like semver, I think, so I went with 33.3665.20251027 (3665 from my username - it's arbitrary, 20251027 is today's date) And some stuff I didn't properly do - The 'recommendations' and 'files_pdfviewer' apps which had various errors each: - at least some of that was package-lock.json issues, which might be fixed soon judging by talk in the original PR... other bits aren't - I didn't do the documentation - since as I'm not going to be using it
55e1ad6 to
f8860a9
Compare
|
So I did a bunch of changes, including a script to generate all the hashes automatically and removing all IFD. Currently nextcloud31 builds as-is, nextcloud32 unfortunately doesn't due to a bunch of problems with package-lock.json. |
f8860a9 to
d8b473f
Compare
SuperSandro2000
left a comment
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 it would probably be a good idea to extract all the python dependencies and merge them already in another PR to reduce the scope of this PR.
Yep, sounds plausible to me. |
|
I think something that is still missing is compiling and copying |
|
@SuperSandro2000 See #463822 for the sphinx packages. |
8b02589 to
8c69f30
Compare
8c69f30 to
d99dadf
Compare
|
Now we got all the python things out of the way and can focus on Nextcloud things. |
|
Just noticed building the user manual PDF fails and an empty file is generated, so it still passes. |
d99dadf to
92e8866
Compare
|
No more patches 🎉 I still think there are a few thinks to fix, but a general review should be possible now. |
Replaces #354035
Instead of trying to comes as close as possible to the official release tarballs, I tried to build a minimal working version instead. The official release tarballs apparently contain quite some junk that doesn't belong there (e.g. README.md and vendor-bin for shipped apps which is not useful for admins or end users). I also didn't include the composer.json, composer.lock, package.json and package-lock.json files, as they are not necessary at runtime. I'm actually not sure why they are included, but as long as Nextcloud works correctly I would just skip them. Also there are a bunch of license files I skipped, as it should just be enough to have them in the source and not in the output.
One major difference to the official release tarballs is that all files necessary for the integrity check are not there, since those are signed with a private key and are not reproducible. Given that the integrity check has been disabled in NixOS a few months ago, it shouldn't really matter.
There are probably still some issues and I haven't done any user testing so far, as I wanted to gather feedback on everything first. Adding some missing files in the build process should be a trivial fix.
One downside of this approach is that updating all the hashes takes a lot of time, but I don't think there is a way around that. It just takes a bit of time 🤷♀️
TODOs:
Potential TODOs:
make latexpdfin the documentation like the official release tarballs: It contains the same user manual, but just looks a bit nicer. I looked into it, but got stuck early on some font issues and decided to postpone it for now.I definitely didn't spent way too much time on this and had to fight a lot with npm /s
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.