Add flake.nix for Nix development
Adds a flake.nix
file so that people that use the nix package manager (like me) can have an instant Monado development environment, and so that people that use NixOS can have a development environment for Monado at all.
Merge request reports
Activity
added 55 commits
-
e454537d...8df4d0eb - 54 commits from branch
monado:main
- e047e048 - Add shell.nix for NixOS development
-
e454537d...8df4d0eb - 54 commits from branch
added 2 commits
added 2 commits
- 091c1021 - misc: Add shell.nix for NixOS development
- 51f93d8e - doc: Document !2152 (merged)
Why does it need to be upstream? This is a distro specific file, there's not reason for it to be upstreamed.
First of all, it's not distro-specific, but I'll get to that.
Because it's a requirement for NixOS developers. Without it,
pkg-config
doesn't actually detect any libraries. I guess the alternative would be to add shell.nix to .gitignore so that it isn't overwritten but also not tracked.Additionally, Nix (the package manager) can also be run on non-NixOS distributions. NixOS just happens to be a distribution based around the Nix package manager. So basically in any distribution, the only command you need to run in order to get a development environment that is guaranteed not to conflict with other packages you have installed is just
nix-shell
. Think of it as working like, say,cargo.toml
, but with any package innixpkgs
. For reference, here is how big nixpkgs is. It's the lagest package repository for linux. Period:https://repology.org/repositories/statistics/total
I would argue that this is sufficient reason to consider this to be a non-platform-specific change.
Edited by Gavin JohnI wasn't aware that
nix
was available on other distros. My main problem with this is maintainability. I don't usenix
and don't intend to change my workflow anytime soon. I'm not vehemently against merging it but I don't intend to provide any support for it if merged.I'll be waiting for other opinion from co-maintainers before doing any action.
For what it's worth, NixOS is also just straight up the best Linux distribution I've ever used. If you haven't tried it yet, please do. You will thank yourself later. Think of regular package management and configuration as being analogous to duck typing, and NixOS as being analogous to static typing. There's a bit of a learning curve, and some overhead when making changes, but far fewer headaches later on.
Edited by Gavin Johnadded 2 commits
- fbc16633 - misc: Add shell.nix for Nix development
- 02b089ec - doc: Document !2152 (merged)
added 2 commits
- 8ba47af6 - misc: Add shell.nix for Nix development
- 021665b0 - doc: Document !2152 (merged)
The only dependencies that aren't installed are
depthai
,LeapV2
,LeapSDK
, andPercetto
. Packaging requests have been opened for all of them:- https://github.com/NixOS/nixpkgs/issues/292618
- https://github.com/NixOS/nixpkgs/issues/292613
- https://github.com/NixOS/nixpkgs/issues/292624
All other optional and non-optional dependencies are installed.
Edited by Gavin Johnadded needs-discussion needs-review labels
added 2 commits
- 0a6a2709 - misc: Add shell.nix for Nix development
- a2fdf9d6 - doc: Document !2152 (merged)
I found a way to vastly simplify the file and shift the maintenance burden onto nixpkgs. However, not all optional dependencies are installed anymore. I am upstreaming those dependencies into nixpkgs:
Edited by Gavin Johnadded 2 commits
- 3bcce628 - misc: Add shell.nix for Nix development
- ac7de783 - doc: Document !2152 (merged)
added 2 commits
- 9f5bf594 - misc: Add shell.nix for Nix development
- 7b161dab - doc: Document !2152 (merged)
added 2 commits
- 4471c944 - misc: Add shell.nix for Nix development
- 3c26544d - doc: Document !2152 (merged)
The first PR upstreaming almost all optional dependencies has been merged. I have submitted a second PR to upstream the build tools: https://github.com/NixOS/nixpkgs/pull/293301
I have also made
shell.nix
use a specific commit in the master branch as opposed to the latest stable branch, to make it obvious which stuff has or has not been upstreamed.added 2 commits
- 4adbe000 - misc: Add shell.nix for Nix development
- b5a28ec8 - doc: Document !2152 (merged)
added 7 commits
-
b5a28ec8...ffb71af2 - 5 commits from branch
monado:main
- 7bfdb8d4 - misc: Add shell.nix for Nix development
- 5508edb4 - doc: Document !2152 (merged)
-
b5a28ec8...ffb71af2 - 5 commits from branch
added 42 commits
-
4f3ee5c0...45fd181f - 39 commits from branch
monado:main
- 6562c6be - misc: Add shell.nix for Nix development
- 56117a48 - doc: Document !2152 (merged)
- 496200a7 - Switch to Nix flakes
Toggle commit list-
4f3ee5c0...45fd181f - 39 commits from branch
added 2 commits
- e15301e6 - misc: Add flake files for Nix development
- 3ce928d6 - doc: Document !2152 (merged)
CC @Scrumplex @bl4ckb0ne. How does this solution look?
added 2 commits
- d335a79e - misc: Add flake files for Nix development
- 7019ce63 - doc: Document !2152 (merged)
- Resolved by Gavin John
added 2 commits
- 2618d6c4 - misc: Add flake files for Nix development
- 70b811e5 - doc: Document !2152 (merged)
added 40 commits
-
38547811...45fd181f - 37 commits from branch
monado:main
- 9f0087c3 - misc: Add flake files for Nix development
- 1c53a9cf - doc: Document !2152 (merged)
- 4c0df9d9 - reuse: Add flake.lock entry
Toggle commit list-
38547811...45fd181f - 37 commits from branch
@bl4ckb0ne CI issues and your comment have been resolved
added 2 commits
- f1db9350 - reuse: Add flake.lock entry
- 54d01f56 - doc: Document !2152 (merged)
@bl4ckb0ne done!
added 5 commits
-
54d01f56...88317246 - 2 commits from branch
monado:main
- 84b3ed90 - misc: Add flake files for Nix development
- 135252e7 - reuse: Add flake.lock entry
- f62bc56d - doc: Document !2152 (merged)
Toggle commit list-
54d01f56...88317246 - 2 commits from branch