Add support for "path:./relative/path" #17

Closed
BBBSnowball wants to merge 1 commit from master into master
BBBSnowball commented 2021-01-20 00:54:27 +00:00 (Migrated from github.com)

My system config flake uses inputs.private.url = "path:./private"; for information that is ok to be in the store but shouldn't be on Github. This is a git submodule so a relative path feels like the right way to refer to it.

Without this patch, flake-compat wants an absolute path:

# nix --version
nix (Nix) 2.4pre20201201_5a6ddb3

# nix-build '<nixpkgs/nixos>' -A system
warning: Git tree '/etc/nixos' is dirty
error: --- EvalError ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- nix-build
at: (42:35) in file: /nix/store/2mpgi4bvn8py4liv9w3mjxd2c5r7bvv8-source/default.nix

    41|     else if info.type == "path" then
    42|       { outPath = builtins.path { path = info.path; };
      |                                   ^
    43|         narHash = info.narHash;

string './private' doesn't represent an absolute path
(use '--show-trace' to show detailed location information)
My system config flake uses `inputs.private.url = "path:./private";` for information that is ok to be in the store but shouldn't be on Github. This is a git submodule so a relative path feels like the right way to refer to it. Without this patch, flake-compat wants an absolute path: ``` # nix --version nix (Nix) 2.4pre20201201_5a6ddb3 # nix-build '<nixpkgs/nixos>' -A system warning: Git tree '/etc/nixos' is dirty error: --- EvalError ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- nix-build at: (42:35) in file: /nix/store/2mpgi4bvn8py4liv9w3mjxd2c5r7bvv8-source/default.nix 41| else if info.type == "path" then 42| { outPath = builtins.path { path = info.path; }; | ^ 43| narHash = info.narHash; string './private' doesn't represent an absolute path (use '--show-trace' to show detailed location information) ```
BBBSnowball commented 2021-01-20 01:46:16 +00:00 (Migrated from github.com)

Sorry, wrong branch. See #18

Sorry, wrong branch. See #18

Pull request closed

Sign in to join this conversation.
No description provided.