aristanetworks / nix-serve-ng

A drop-in replacement for nix-serve that is faster and more reliable
Other
156 stars 14 forks source link

Error The program must call nix::initNix() before calling any libstore library functions. #22

Closed jkarni closed 1 year ago

jkarni commented 1 year ago

When running nix-serve-ng with nix 1.13.2, I get the following error:

nix-serve-start[2920872]: The program must call nix::initNix() before calling any libstore library functions.

This seems to be because of this recent change.

See also https://github.com/NixOS/nix/pull/7705 and a similar issue with nix-serve.

(With nix 2.11 this works fine.)

jkarni commented 1 year ago

I'll see if I can come up with a PR.

(And thanks for the package!)

rectcircle commented 1 year ago
nix-env -iA nixpkgs.nix-serve-ng

It not work same error

The program must call nix::initNix() before calling any libstore library functions.

version

nix --version
# nix (Nix) 2.14.1

none nixos, nix only temporary fixed it:

nix-env -E '_: let pkgs = import <nixpkgs> {}; in pkgs.nix-serve-ng.override { nix = pkgs.nixVersions.nix_2_12; }' -i