(no title)
Shoue | 4 years ago
This is because the default.nix you have is exporting a lambda that expects arguments to be saturated, `callPackage` does this for you automagically hence why you have to use it.
Instead you probably want the nixpkgs import line _inside_ default.nix, either in a let-in binding or using the `?` operator to default a lambda argument to something, usually nixpkgs itself bound to a `pkgs` argument so you can use `pkgs`[0].
Even better, you can use Niv to pin nixpkgs to a specific nixpkgs commit so that it doesn't change as you update your system's nixpkgs channel with the `nix-channel` command because `<nixpkgs>` is special syntax referring to what's stored in your $NIX_PATH[1].
[0]: see the default argument section: https://nixos.wiki/wiki/Nix_Expression_Language [1]: https://nixos.org/guides/nix-pills/nix-search-paths.html
pmarreck|4 years ago
I'm about to dive headfirst into this nix business and this is intimidating, lol
soraminazuki|4 years ago
Fully agree, but the given example isn't such a case but rather incorrect code.
The example is somewhat akin to writing the following Python code and expecting it to print "hello".
It wouldn't work because you need to call the main function. It's not a problem of Python not addressing common use cases.