-
Notifications
You must be signed in to change notification settings - Fork 806
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
Add a nix flake for easy building and dev environments #5007
Conversation
Kudos, SonarCloud Quality Gate passed! |
I am interested: why are docker containers not a solution to this as well? |
Nix is primarily intended as a solution for distributing build and development environments. Docker has a wider scope that really encompasses every step of the production "life-cycle" -- development, build, and crucially, production. The two tools overlap in a lot of ways and a docker container would fill a similar role, but Nix has a couple of advantages:
This blog post explains things more clearly than I am able to: http://sandervanderburg.blogspot.com/2020/07/on-using-nix-and-docker-as-deployment.html |
Interesting! Sounds really cool! Will read more about it! Thanks for the Link! :) |
Very cool article! Thanks for sharing! :) |
no worries :) |
A good article on nix flakes specifically: https://www.tweag.io/blog/2020-05-25-flakes/ |
Kudos, SonarCloud Quality Gate passed! |
af71893
to
95a7ea2
Compare
@claucambra This one has been approved for a while. Were you going to merge it? |
yes :) |
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
95a7ea2
to
19a2f8c
Compare
AppImage file: nextcloud-PR-5007-19a2f8cc7da52f62b6e7f4ca3b68ba7056b46f4e-x86_64.AppImage |
Kudos, SonarCloud Quality Gate passed! |
postFixup = optionalString stdenv.isLinux '' | ||
wrapProgram "$out/bin/nextcloud" \ | ||
--set LD_LIBRARY_PATH ${lib.makeLibraryPath [ libsecret ]} \ | ||
--set PATH ${lib.makeBinPath [ xdg-utils ]} \ |
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.
You probably don't want to overwrite PATH here since it will clear most programs on NixOS systems.
separateDebugInfo = false; | ||
enableParallelBuilding = true; | ||
|
||
preConfigure = optionals stdenv.isLinux [ |
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.
preConfigure uses a multiline string and this only works because nix mangles lists to strings. In the future this might stop working.
You cab replace optionals with optionalString.
libsForQt5.qqc2-desktop-style | ||
libsForQt5.kio | ||
] ++ optionals stdenv.isDarwin [ | ||
libsForQt5.qt5.qtmacextras |
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.
libsForQt5, qt5 and libsForQt5.qt5 should be the same thing.
Nix flakes makes it very easy to create builds and dev shells of the desktop client with minimal maintenance load, by using nix and nixpkgs.
This nix flake includes support for both macOS and Linux. The Linux build is fully reproducible — nix downloads and builds the necessary dependencies independently of system packages. Unfortunately the macOS build is “impure” as we need to use the system Xcode to build the finder sync extension, but besides that everything else is shared with the Linux build
Adopting this will make it easier to build the desktop client and create a dev environment for contributors and for ourselves, as well as make it easier to package the desktop client if we adopt this for our build infra