Comments (9)
You can run dream2nix in the root repo and use packageOverrides
to make a patch to copy the library over then patch the sources to point to the library's new location. kind of like this https://github.com/nix-community/dream2nix/blob/main/overrides/nodejs/default.nix#L809
from dream2nix.
@tgunnoe by "run dream2nix in the root repo" you mean settings config.projectRoot
to ../..
?
Also - this means patching (using text find replace) each dependency individually AFAIK, which is a little cumbersome.
Also I'm not sure how it will affect caching - but it's a separate issue i suppose.
I was wondering if there is anything that could be done to make this more like poetry2nix (which supports this already).
from dream2nix.
@DavHau @yusdacra I've checked this out but this doesn't really solve what I was aiming for.
It still fails in the example repository when trying to build inside service/binary
.
I wanted to avoid keeping a single flake.nix
file at the root of the monorepo.
Note that all the sources are still available in the nix store when running it with config.projectRoot = ../..
.
Thanks a lot for the effort!
from dream2nix.
I wanted to avoid keeping a single flake.nix file at the root of the monorepo.
Why do you want that? I didn't even know it was possible to access parent directories from a flake. But it seems to work as long as it's part of the same repo
from dream2nix.
There are tens of services being managed in the repo, and a few dozen libraries - some of them have customizations in the flake, different target systems etc. There is common nix tooling which is being imported by many of the flakes.
It's the same reason they are not sharing a cargo workspace.
from dream2nix.
@omerbenamram I just tested with your repo and both the top level flake as well as the one in ./service/binary
work without any problem.
see: https://github.com/DavHau/dream2nix-issue-113
Maybe you just forgot to update dream2nix when you tested.
from dream2nix.
@DavHau My bad! I've tried setting config.projectRoot
to ../..
- but in your working example it's source
under makeFlakeOutputs
.
It's building fine on my linux machine - but it breaks on mac with:
❯ nix build .#packages.aarch64-darwin.binary
error: builder for '/nix/store/0i9km7lz45i10h5frnskmybpnjgm0z72-binary-0.1.0.drv' failed with exit code 1;
last 9 log lines:
> unpacking sources
> unpacking source archive /nix/store/x1p22sam64s7rpj07mfz2difxiav4mw7-fvywq19s7rnscjljnka87knyklvrpfxn-source/service/binary
> source root is binary
> Executing cargoSetupPostUnpackHook
> Finished cargoSetupPostUnpackHook
> patching sources
> updateAutotoolsGnuConfigScriptsPhase
> configuring
> mv: cannot stat '/build/.cargo/config': No such file or directory
For full logs, run 'nix log /nix/store/0i9km7lz45i10h5frnskmybpnjgm0z72-binary-0.1.0.drv'.
Maybe you have an idea where this could happen 😅?
from dream2nix.
@DavHau My bad! I've tried setting
config.projectRoot
to../..
- but in your working example it'ssource
undermakeFlakeOutputs
.It's building fine on my linux machine - but it breaks on mac with:
❯ nix build .#packages.aarch64-darwin.binary error: builder for '/nix/store/0i9km7lz45i10h5frnskmybpnjgm0z72-binary-0.1.0.drv' failed with exit code 1; last 9 log lines: > unpacking sources > unpacking source archive /nix/store/x1p22sam64s7rpj07mfz2difxiav4mw7-fvywq19s7rnscjljnka87knyklvrpfxn-source/service/binary > source root is binary > Executing cargoSetupPostUnpackHook > Finished cargoSetupPostUnpackHook > patching sources > updateAutotoolsGnuConfigScriptsPhase > configuring > mv: cannot stat '/build/.cargo/config': No such file or directory For full logs, run 'nix log /nix/store/0i9km7lz45i10h5frnskmybpnjgm0z72-binary-0.1.0.drv'.
Maybe you have an idea where this could happen 😅?
This is because of the hardcoded /build
path... I thought I fixed this, but apparently I missed one. I'll fix this when I have time later.
from dream2nix.
@omerbenamram can you try PR #130 and see if that works out for you?
from dream2nix.
Related Issues (20)
- Trouble Using Yarn Lockfile (nodejs-package-lock-v3) HOT 6
- Basic Documentation HOT 1
- Setuptools Collision HOT 4
- pip: do not know how to unpack source archive xxxx.whl HOT 1
- Separate the pyEnv and devShell parts of pip module into their own module(s)
- Start shell with dependencies without creating a new flake file HOT 2
- PDM Locking fails if only config.deps.python is set HOT 1
- nodejs: native module compilation failure, need help configuring nativeBuildInputs HOT 3
- Pip installed CLI tool not in PATH HOT 3
- WIP - pdm add spyder # python3.12-pyqt5-5.15.10 - pdm.sourceSelector.<function body> is not of type 'string'. HOT 2
- WIP - pdm - Python version from d2n nixpkgs HOT 1
- [help] usage of multi-derivation-package HOT 1
- Question: Python package with libusb dependency HOT 2
- error: infinite recursion encountered # nix run github:nix-community/dream2nix#__pythonEnv extract-msg HOT 2
- realpath: command not found HOT 1
- How to make the lock building process for python proxy aware?
- Error: attribute 'overrideAttrs' missing when running nodejs-granular-v3 devshell
- bad (null) hash for package from extra pypi index
- Unable to provide nativeBuildInputs to nodejs transitive dependencies
- error: No valid filename found in the list of filenames: - PyQt5_Qt5-5.15.13-py3-none-macosx_10_13_x86_64.whl
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dream2nix.