nix.dev icon indicating copy to clipboard operation
nix.dev copied to clipboard

<nixpkgs>: what to do with NixOS bare machines?

Open domenkozar opened this issue 5 years ago • 0 comments

That one is tricky because be design nixos-rebuild depends on $NIX_PATH.

There are a few ways forward:

a) Flakes will solve this with locking, but they are not released yet.

b) For legacy we could change nixos-rebuild to look for /etc/nixos/nixpkgs.nix and use it to import <nixpkgs>.

c) Without changing upstream, one can create a wrapper called nixos-rebuild that sets $NIX_PATH to point to a commit and calls the original nixos-rebuild command. Not ideal since it won't do the right thing on the first installation, but the second will do.

domenkozar avatar Jun 18 '20 12:06 domenkozar