Skip to content

Commit aee93d4

Browse files
committed
darwin.rs: future proof removal of activate-user script
In the future the script will be removed, if it does get removed we should just call the `activate` script as root.
1 parent caf77d5 commit aee93d4

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/darwin.rs

+12-8
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,19 @@ impl DarwinRebuildArgs {
150150
.message("Activating configuration")
151151
.dry(self.common.dry);
152152

153-
// Check whether to activate-user is deprecated
154-
// If it is, only activate with root
155-
if std::fs::read_to_string(&activate_user)
156-
.context("Failed to read activate-user file")?
157-
.contains("# nix-darwin: deprecated")
158-
{
159-
activation.run()?;
153+
if activate_user.exists() {
154+
// Check whether activate-user is deprecated
155+
// If it is, only activate with root
156+
if std::fs::read_to_string(&activate_user)
157+
.context("Failed to read activate-user file")?
158+
.contains("# nix-darwin: deprecated")
159+
{
160+
activation.run()?;
161+
} else {
162+
user_activation.run()?;
163+
activation.run()?;
164+
}
160165
} else {
161-
user_activation.run()?;
162166
activation.run()?;
163167
}
164168
}

0 commit comments

Comments
 (0)