nix-community / npmlock2nix

nixify npm based packages [maintainer=@andir]
Apache License 2.0
130 stars 42 forks source link

import without niv #184

Open cduret opened 1 year ago

cduret commented 1 year ago

Hello I try to import npmlock2nix directly from nix and I have an error :

In test.nix :

let  npmlock2nix = builtins.fetchTarball {
       sha256 = "1ddfby72fsnpn4yw43g4zxvg6jzlk5hi5cfnnccg9jgw53ckr4xh";
       url = "https://github.com/nix-community/npmlock2nix/archive/9197bbf397d76059a76310523d45df10d2e4ca81.tar.gz";
     };
     npmlock2nix-drv = import npmlock2nix {};
in
npmlock2nix-drv

In nix repl :

nix-repl> import ./test.nix
{ build = trace: warning: [npmlock2nix] You are using the unversion prefix for builders. This is fine for now. In the future we will move to a versioned interface (old versions remain as they are). The currently used functions are availabe as `npmlock2nix.v1` for example `npmlock2nix.v1.build`.
error: attempt to call something which is not a function but a string

       at «none»:0: (source not available)
a-h commented 11 months ago

I think the error you're seeing is just that npmlock2nix-drv doesn't have a root thing, you have to use v1 or v2 next to it. I have a working example here: https://github.com/nix-community/npmlock2nix/issues/159#issuecomment-1669873260