Skip to content

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

Closed
BBBSnowball wants to merge 1 commit intoNixOS:masterfrom
BBBSnowball:master
Closed

Add support for "path:./relative/path"#17
BBBSnowball wants to merge 1 commit intoNixOS:masterfrom
BBBSnowball:master

Conversation

@BBBSnowball
Copy link

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 BBBSnowball deleted the branch NixOS:master January 20, 2021 01:42
@BBBSnowball BBBSnowball deleted the master branch January 20, 2021 01:42
@BBBSnowball BBBSnowball restored the master branch January 20, 2021 01:42
@BBBSnowball
Copy link
Author

Sorry, wrong branch. See #18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant