I deleted nix and reinstalled it. The first thing I tried to install was nixops, and the installation dies the same way that it did when I tried to reinstall nixops over the existing one.
I decided to try to install nix and nixops on another Mac, and it installed it without problems. When it came to python2.7-PyJWT-1.6.4, it loaded it from the store on cache.nixos.org
So, why is it trying to build it on my first Mac instead of loading it from the cache?
I remembered I had written an overlay. Sure enough, it was still there. I removed it from the overlays directory but nixops still wouldn’t load. So, I removed nix, reinstalled it, and then could install nixops!
But nixops still doesn’t work. I get the same error that testing.nix is called without the required argument ‘pkgs’.
When you install nix, it automatically comes up with the nixpkgs channel installed, which depends on the nixpkgs-unstable channel. If I remove that channel, I cannot load anything from nixpkgs, including nixops. Hmm. So, how do I avoid the bad update to the nixpkgs channel? Pinning? Overlays?
I was putting the overlay in the wrong file at first, then I realized the sha256 hash was wrong. Now I am using the following.
self: super: {
nixops =
let
nixopsUnstable = self.fetchFromGitHub {
owner = "NixOS";
repo = "nixops";
rev = "v1.6";
sha256 = "0nfw05l3z2vdz2k4mj7qp3sfvpph7gss2qriabm92fi357i31643";
};
in (import "${nixopsUnstable}/release.nix" {}).build.${builtins.currentSystem};
}
When I first put this into the right place (~/.config/nixpkgs/overlays) I was able to install nixops and docker and was even able to deploy a simple system into VisualBox. Success! I was surprised to see that docker started up my old container for remote building, showing that something was a holdover from when I removed nix. But then I had to reboot my Mac, and when it came back up docker didn’t work. So, I removed nix once again and started over. But this time I can’t install nixops. Or docker. In fact, even a “nixops -qa” will result in an error.
The error is
error: cannot import ‘/nix/store/w484gxhpicpclrgw5hr4by47w657bb3z-source/release.nix’, since path ‘/nix/store/jdrcgvvyya1i8lj3da51b4zfjzjwmpz3-source.drv’ is not valid, at /Users/johnson/.config/nixpkgs/overlays/fix-nixops.nix :10:10
There is no file in /nix/store corresponding to either of these. Very mysterious.
The thing that bothers me the most is that removing /nix does NOT seem to completely undo nix, in spite of what the manual says.