-
-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Description
Context
I have a project where I have two flakes:
./flake.nix./nix-dev/flake.nix
./flake.nix uses inputs from ./nix-dev/flake.nix:
- https://github.com/nix-community/nix-vscode-extensions/blob/842ee6c0a54cd4d0ed53ab5c8df88368cd1f382f/flake.nix#L25-L31
- https://github.com/nix-community/nix-vscode-extensions/blob/842ee6c0a54cd4d0ed53ab5c8df88368cd1f382f/flake.nix#L37
./nix-dev/flake.nix accesses files in ./ via the path:../ input:
- https://github.com/nix-community/nix-vscode-extensions/blob/842ee6c0a54cd4d0ed53ab5c8df88368cd1f382f/nix-dev/flake.nix#L35-L38
- https://github.com/nix-community/nix-vscode-extensions/blob/842ee6c0a54cd4d0ed53ab5c8df88368cd1f382f/nix-dev/flake.nix#L44
Problem
In the current flake-compat implementation, the src coincides with rootSrc.
Therefore, if I set src to ./nix-dev, I get an error
at /nix/store/ndslvddkj5h37rn09ccnk9s8bzydcz3z-nix-dev/flake.nix:44:24:
43| parent = inputs.parent.outPath;
44| systemPlatform = import "${parent}/nix/systemPlatform.nix";
| ^
45| systems = builtins.attrNames systemPlatform;
error: access to absolute path '/nix/store/nix/systemPlatform.nix' is forbidden in pure evaluation mode (use '--impure' to override)
Solution
Introduce an additional argument to the main function in default.nix that will let a user specify the "root" within src, i.e. where the flake.nix is within src.
This suggestion is implemented in #90.
Metadata
Metadata
Assignees
Labels
No labels