If copySourceTreeToStore is false, don't copy inputs of type path to store #79

Merged
jade merged 3 commits from lillecarl/flake-compat:evalPathTypeFromFS into main 2025-07-05 03:26:14 +00:00
Contributor

If you configure

inputs.nixpkgs.url = "path:///path/to/your/nixpkgs";

and set copySourceTreeToStore to false we evaluate inputs with type "path" from filesystem
instead of running it through a fetcher and evaluate from store.

Should make hacking on nixpkgs easy with flake-compat

NOTE: I've tested that inputs.nixpkgs.outPath is a filesystem path and modulesPath is a filesystem path. However on my system it seems I still copy nixpkgs somewhere in my convoluted setup. (Help appreciated 😄)

(I've set nixpkgs.flake.source = null, nix.channel.enable = false; and nix.registry = {};)

Feedback would be appreciated! 😄

If you configure ```nix inputs.nixpkgs.url = "path:///path/to/your/nixpkgs"; ``` and set copySourceTreeToStore to false we evaluate inputs with type "path" from filesystem instead of running it through a fetcher and evaluate from store. Should make hacking on nixpkgs easy with flake-compat NOTE: I've tested that inputs.nixpkgs.outPath is a filesystem path and modulesPath is a filesystem path. However on my system it seems I still copy nixpkgs somewhere in my convoluted setup. (Help appreciated 😄) (I've set nixpkgs.flake.source = null, nix.channel.enable = false; and nix.registry = {};) Feedback would be appreciated! 😄
If you configure
```nix
inputs.nixpkgs.url = "path:///path/to/your/nixpkgs";
```
and set copySourceTreeToStore to false we evaluate nixpkgs from filesystem
instead of running it through a fetcher and evaluate from store.
lillecarl changed title from If copySourceTreeToStore is false, don't copy inputs of type path to store to WIP: If copySourceTreeToStore is false, don't copy inputs of type path to store 2025-05-09 14:58:09 +00:00
lillecarl changed title from WIP: If copySourceTreeToStore is false, don't copy inputs of type path to store to If copySourceTreeToStore is false, don't copy inputs of type path to store 2025-05-09 15:32:59 +00:00
jade left a comment
Owner

Oops! Sorry that I missed this PR.

Could you write a test for this behaviour? The test framework should let you write such a thing with a generated flake.nix with an inserted path.

Probably the easiest way to test this is to make the imported flake return builtins.toString ./. and determine whether that's a store path.

Oops! Sorry that I missed this PR. Could you write a test for this behaviour? The test framework *should* let you write such a thing with a generated flake.nix with an inserted path. Probably the easiest way to test this is to make the imported flake return `builtins.toString ./. ` and determine whether that's a store path.
lillecarl force-pushed evalPathTypeFromFS from 7bb742d1f5 to a2a447189b 2025-07-03 13:06:03 +00:00 Compare
lillecarl force-pushed evalPathTypeFromFS from a2a447189b to c1e5a702fd 2025-07-03 13:07:24 +00:00 Compare
lillecarl force-pushed evalPathTypeFromFS from c1e5a702fd to 86e8569136 2025-07-03 13:10:58 +00:00 Compare
Author
Contributor

@jade Turned out to be easier than expected, you've done some good plumbing there. Feel free to refactor the tests into one if you want but let's get this shipping! 😄

@jade Turned out to be easier than expected, you've done some good plumbing there. Feel free to refactor the tests into one if you want but let's get this shipping! 😄
lillecarl force-pushed evalPathTypeFromFS from 86e8569136 to 83acc2af80 2025-07-03 13:14:43 +00:00 Compare
jade approved these changes 2025-07-05 03:16:41 +00:00
Owner

I have fixed the tests for this, they were missing a nix flake lock and were running into a lockless flake bug (#81).

I have fixed the tests for this, they were missing a `nix flake lock` and were running into a lockless flake bug (#81).
jade merged commit 549f2762ae into main 2025-07-05 03:26:14 +00:00
lillecarl deleted branch evalPathTypeFromFS 2025-07-06 00:24:09 +00:00
Author
Contributor

Thanks! 😄

Thanks! 😄
Sign in to join this conversation.
No description provided.