As a newb to NixOS, I’m trying things that I think would be intuitive, but that end up not being possible. For example, I thought I’d try to import a nix package from GitHub:
nix-repl> import https://github.com/svanderburg/nix-patchtools/archive/master.tar.gz error: string 'https://github.com/svanderburg/nix-patchtools/archive/master.tar.gz' doesn't represent an absolute path, at (string):1:1 nix-repl> import <https://github.com/svanderburg/nix-patchtools/archive/master.tar.gz> error: syntax error, unexpected '>', at (string):1:76
That doesn’t work.
I can make it work, by doing this:
# nix-channel --add https://github.com/svanderburg/nix-patchtools/archive/master.tar.gz patchtools # nix-channel --update patchtools # nix repl nix-repl> import <patchtools> «derivation /nix/store/76pyvhb67ybid35dscpr2h9lidpsimb3-autopatchelf.drv»
Is there way to work with Git URLs directly, so that I don’t have to manually add the channel and then remember what I named it (which means if I update the name, I need to update all the sources).
If there isn’t a way, I think this would be a convenient feature.
Suppose I want to depend on tens or hundreds of channels for various tools. It would get out of hand and error prone if I were to manually add all those channels when bootstrapping a new system.