The installer needs to support upgrades and fixes of installations #21
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
nix upgrade-nix
is kind of busted (see lix issue tracker) and so it really should be replaced by the installer. However the installer only really knows how to uninstall nix, which, on macOS, requires deleting the nix store volume and users and such, which need not be done for upgrades.I think a lot of the code internals block this. I blame
receipt.json
for giving false sense of security. It is also used practically everywhere in the code, so we don't really have to write proper checks and error handling because we always just assume thatreceipt.json
is right (or just fail loudly).To put it bluntly: the Nix installation is pretty trivial in concept. We need to download a tarball, unpack it, create the filesystem tree at
/nix
, set permissions, and run some OS commands to finish Nix bootstrapping and to create service files. All of that can easily be done in idempotent ways, which will turn "upgrade" and "fix" into just re-running the installer (with maybe extremely small alterations).The hardest bit here is creating and encrypting volumes, which only happens on MacOS. This is a one-time, irreversible operation. Honestly, we shouldn't even delete the volumes by default: it should be behind a flag.
I want to systematically go over all of the operations we do after receipt.json is nuked. I already made some progress on
mv
in code. Then, we'll just need a small patchset to make volume nuking optional, and we'll essentially haveupgrade
andrepair
for free.