nix.dev
nix.dev copied to clipboard
<nixpkgs>: what to do with NixOS bare machines?
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.