-
Notifications
You must be signed in to change notification settings - Fork 102
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
Set /tmp as the CWD for activation #39
Conversation
Due to some nixos bugs (e.g. NixOS/nixpkgs#73404), the activation requires CWD to be writeable; the canonical writeable directory is /tmp, so let's use that.
I think this would be better done in the We have |
Also I'm against using |
This issue can probably be closed, when NixOS/nixpkgs#73780 is merged. |
NixOS/nixpkgs#73780 won't make it into 20.09, right? I think we might need some method to customize the cwd anyway if not. |
Why not just change the NixOS activation helper to |
Ah, I just found a case where your workaround is not quite optimal: When activation fails, the magic rollback will re-activate the previous generation, but if that's one that is built without this activation script, that generation can no longer properly be activated outside a writable directory. |
Even if the bug was fixed in nixpkgs that would still be the case when you'd be deploying the fix for the first time. I would just re-deploy the previous generation with this workaround applied before doing any other changes if you want to safely rollback to it. |
I'm closing this in favor of the now-merged #65 |
Due to a nixos bug (NixOS/nixpkgs#73404), the activation requires CWD to be writeable; one canonical writeable directory is /tmp, so I picked that. This fixes the issue for me, and I can install initrd secrets with the fix in place.
I guess it would be reasonable to let users choose their own, but I'm not sure how to properly do that - maybe via a custom activation script?