-
Notifications
You must be signed in to change notification settings - Fork 106
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
darwin -> darwin doesn't invoke user activation script #259
Comments
Hmm, I don't think that it's currently possible for a single profile to run activation scripts under multiple users. Do you have an example of such a configuration that needs to be activated under both root and user? As a workaround, I think it might be possible to split your configuration into two profiles: one under |
It's the standard MO of nix-darwin afaik. The "result" of a nix-darwin build creates two separate activation scripts, and nix-darwin switch calls them both separately. There's an entrypoint in the https://github.com/LnL7/nix-darwin/blob/0e6857fa1d632637488666c08e7b02c08e3178f8/pkgs/nix-tools/darwin-rebuild.sh#L222-L230 seems to be where it happens. |
This is still relevant. Caused me a lot of headaches today. A workaround I made is to just make a secondary profile that runs the user script: profilesOrder = [ "user" "system" ];
profiles = {
system = {
path = deploy-rs.lib.aarch64-darwin.activate.darwin self.darwinConfigurations.machine;
};
user = {
path = deploy-rs.lib.aarch64-darwin.activate.custom self.darwinConfigurations.machine.config.system.build.toplevel "sudo -Hu username $PROFILE/activate-user";
};
}; |
nix-darwin/nix-darwin#1341 should make this less relevant, FWIW. |
nix-darwin has two activation scripts: regular activation (meant to run as root) and user activation. User activation is meant to run as a user with sudo permissions, for tools like brew which don't like being run as root but want to control their own privilege escalation.
When doing
nix run github:serokell/deploy-rs -- --ssh-user user -s
on a deployment similar to the darwin example, it runs the activation script, but not user activation.Any idea how to get that invoked? Am I doing something wrong in calling the deploy script?
The text was updated successfully, but these errors were encountered: