-
Notifications
You must be signed in to change notification settings - Fork 6
Feat: Add Nix Flake #1
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: main
Are you sure you want to change the base?
Conversation
ba986f1 to
8bd2eff
Compare
fef7751 to
448f27c
Compare
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.
Hey, thanks a lot for this! 🙇 And sorry for the response delay. For some reason, I'm not getting notifications for this repo... 😕
I don't use Nix for development, though I do use NixOS on a couple of machines, and have some (love/hate) experience with it. I actually tried setting something like this up for building the plugin and using it on my dev Void Linux machine, since I would really like to have an isolated build environment and simplify the building instructions, but I ran into issues with shared library mismatches, and couldn't get it to work. Do you think it would be possible to setup such a cross-platform build system using Nix, that essentially produces the .so files of the plugin? Or is this only useful if the user is already using Nix(OS)?
For example, I tried running nix build with these changes, and got this error:
Expand
error: Cannot build '/nix/store/04g9zhr7rlgcs7d91597zqknb8y9spy6-qml-niri-0.1.drv'.
Reason: builder failed with exit code 1.
Output paths:
/nix/store/h1igiypr88nrv64684k09aha4svsy1ww-qml-niri-0.1
Last 25 log lines:
> [ 48%] Building CXX object CMakeFiles/Niri.dir/niri_qmltyperegistrations.cpp.o
> [ 56%] Building CXX object CMakeFiles/Niri.dir/src/logging.cpp.o
> [ 56%] Building CXX object CMakeFiles/Niri.dir/src/icon.cpp.o
> [ 60%] Building CXX object CMakeFiles/Niri.dir/src/niri.cpp.o
> [ 64%] Building CXX object CMakeFiles/Niri.dir/src/ipcclient.cpp.o
> [ 68%] Building CXX object CMakeFiles/Niri.dir/src/windowmodel.cpp.o
> [ 72%] Building CXX object CMakeFiles/Niri.dir/src/workspacemodel.cpp.o
> [ 76%] Linking CXX shared library Niri/libNiri.so
> [ 80%] Built target Niri
> [ 80%] Built target Niriplugin_autogen_timestamp_deps
> [ 84%] Automatic MOC and UIC for target Niriplugin
> [ 84%] Built target Niriplugin_autogen
> [ 92%] Building CXX object CMakeFiles/Niriplugin.dir/Niriplugin_autogen/mocs_compilation.cpp.o
> [ 92%] Building CXX object CMakeFiles/Niriplugin.dir/Niriplugin_NiriPlugin.cpp.o
> [ 96%] Linking CXX shared module Niri/libNiriplugin.so
> [100%] Built target Niriplugin
> Running phase: glibPreInstallPhase
> Running phase: installPhase
> Running phase: fixupPhase
> shrinking RPATHs of ELF executables and libraries in /nix/store/h1igiypr88nrv64684k09aha4svsy1ww-qml-niri-0.1
> shrinking /nix/store/h1igiypr88nrv64684k09aha4svsy1ww-qml-niri-0.1/lib/qt-6/qml/Niri/libNiri.so
> shrinking /nix/store/h1igiypr88nrv64684k09aha4svsy1ww-qml-niri-0.1/lib/qt-6/qml/Niri/libNiriplugin.so
> checking for references to /var/nix/builds/nix-build-qml-niri-0.1.drv-5163-543824116/ in /nix/store/h1igiypr88nrv64684k09aha4svsy1ww-qml-niri-0.1...
> RPATH of binary /nix/store/h1igiypr88nrv64684k09aha4svsy1ww-qml-niri-0.1/lib/qt-6/qml/Niri/libNiriplugin.so contains a forbidden reference to /var/nix/builds/nix-build-qml-niri-0.1.drv-5163-543824116/
> Some binaries contain forbidden references to /var/nix/builds/nix-build-qml-niri-0.1.drv-5163-543824116/. Check the error above!
For full logs, run:
nix-store -l /nix/store/04g9zhr7rlgcs7d91597zqknb8y9spy6-qml-niri-0.1.drv
As usual with Nix, I have no idea how to troubleshoot this, if the issue is on my side or not... 😮💨 The build was successful, but some "references" are "forbidden"...? The full logs are not helpful either.
Anyway, I'd be happy to merge this, though since I likely won't be using it and find Nix confusing, I'm not sure I'd be able to troubleshoot any issues. So I might ping you in that case, if that's OK with you.
|
Hi, I tried this PR and I did not get an error pertaining to forbidden references. |
448f27c to
070cedd
Compare
This PR adds a basic Nix flake using flake-parts to provide two packages for Nix users:
It's mostly a "set it and forget it" kind of deal as it is quite simple. I have also added instructions on how to use the packages in the README, but note that the url points to my fork, so please change it upon merging.
Great work bridging the gap for niri users!