-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make our Nix installation immune to macOS upgrades #672
Make our Nix installation immune to macOS upgrades #672
Conversation
…ced by the compiler
…o<_> for free where the reverse isn't true
…by the nix-hook plist on every login
This reverts commit cccb8bc. It starts too early, fails, and then aborts. When it fails, launchd says the service failed to initialize and that the system is read-only.
I installed nix with this version of the installer, upgraded macOS to 14.0 and nix still works in my fish shell and also in my bash shell. |
src/cli/subcommand/restore_shell.rs
Outdated
use clap::{ArgAction, Parser}; | ||
|
||
/** | ||
Update the macOS startup files to make Nix usable after system upgrades. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm under the impression this can be used on non-Macs too? (I don't see it cfg
'd off by target) If it works on Linux I'd like to make it available for every body! =D
src/cli/subcommand/restore_shell.rs
Outdated
default_value = "false", | ||
global = true | ||
)] | ||
pub explain: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see explain
implemented below, can we remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thinking is we'd somehow smush this stuff here into the nice output / runner mechanism we see in uninstall
. I didn't know how to do that -- or if it was reasonable. I left these in as a reminder to ask -- is that a reasonable / straightforward thing to do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh like the plan display? We could do that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This turns out to be a bit hard since the associated functions are on Plan
which requires things like a planner
which aren't relevant
I looked at what happens if we're in a hard loop of failing. It isn't so bad, but it isn't great. The default ThrottleInterval limits starting a service to once every ten seconds:
I don't see any way to limit the number of attempts. |
Oh this needs to handle |
Description
This PR adds a global launch daemon on macOS which restores the shell hook after system upgrades, fixing the problem of Nix being "uninstalled" after each upgrade.
This is a rough pass to be improved. I haven't tested this exact implementation yet, but I tested the idea and it works. I'll be testing the implementation shortly.
Checklist
cargo fmt
nix build
nix flake check
Validating with
install.determinate.systems
If a maintainer has added the
upload to s3
label to this PR, it will become available for installation viainstall.determinate.systems
: