nmattia / niv

Easy dependency management for Nix projects
https://github.com/nmattia/niv
MIT License
1.56k stars 77 forks source link

Add niv add local for local sources #220

Closed nmattia closed 4 years ago

nmattia commented 4 years ago

Closes #219

roberth commented 4 years ago

As completed by bash built-in completion

$ niv add local foodep/
cannot parse value `foodep/'

Usage: niv add local [PACKAGE] [-n|--name NAME] [--path PATH]
  Add a local dependency. Experimental.

./foodep/ results in an empty name and a different path value. The trailing / should be removed for consistency.

nix-repl> "${sources."".path}"    
"./foodep/"

./foodep works

nix-repl> sources = import ./nix/sources.nix

nix-repl> sources.foodep
{ outPath = "./foodep"; path = "./foodep"; type = "local"; }

outPath evaluate to ./. + "/${sources.foodep.path}" for local paths, except relative to the sources.json file.

Expected:

{ outPath = /home/user/test123/foodep; path = "./foodep"; type = "local"; }

I don't know whether the raw path is useful, but it may be confusing because it's not a Nix path value.