-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
mu: run initialization command when personal addresses change #6100
base: master
Are you sure you want to change the base?
mu: run initialization command when personal addresses change #6100
Conversation
83b89fa
to
fd326d8
Compare
fd326d8
to
61873f8
Compare
This looks interesting! I have long tinkered with this kind of thing in my head. Does this also handle the case where you add/remove only some addresses/aliases? I would like to codify the expected behavior of changing a subset of the addresses as an actual test that Nix/home-manager can run if we do go down this road. |
On activation it asks
I agree, though it would involve testing the actual side-effects of activation over multiple runs, and I don't know if the current test infra allows that. |
I tried to get the integration tests working, but I can't get a working internet connection in the VMs. In any case I'm pretty sure the patch works, since I've been using it for the past couple weeks, during which I manipulated my email addresses (adding new aliases and accounts), and |
willing to merge but can't review. @KarlJoad could you test/review and confirm it works ? |
I can review, but cannot test on real-world stuff. I do not use home-manager anymore and I don't want to impact my current mail setup. I will post my review/approve by tonight CST. |
I'm not sure if I got the usage of |
In my opinion, a dry-run should do everything a normal run should do, except for any actual modifications, that way you (as the user) can see exactly what will happen, without anything actually changing. So dry-runs should check for currently-registered addresses. |
61873f8
to
cab44ac
Compare
I agree; fixed the check in dry-run mode and rebased on master. |
When the user changes which addresses mu should consider 'personal', mu's store should be reinitialized. After this change, the activation script parses the previously configured list of addresses and compares it with the new one. If they differ, it runs the init command even when the store has already been initialized.
cab44ac
to
d5ce971
Compare
This is hopefully the last change, sorry. I'm setting up a new device today, and the current address detection failed because the store has never been initialized. |
No worries! I'm glad you caught this one. |
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.
the current address detection failed because the store has never been initialized.
Honestly, I would have expected this to be caught by a test. Could you add a test for this too?
Yeah, but it needs to be an integration test, and I still haven't managed to run those |
7c0a10f
to
5790ca9
Compare
I figured out how to run integration tests (in hindsight it makes sense that the VM can't access the internet when it's running in sandbox, so I had to turn that off; also I was getting Hopefully now it should be mergeable. |
I don't seem to be able to run the test locally, for some reason (Podman on my desktop). What is the exact If I get this to test successfully locally, I'll gladly approve this again! Thanks for all your hard work on this @VojtechStep. |
With flakes it's |
I actually ended up with a different error, which is probably just operator error.
|
I tried that to disable the sandbox at first, but got a warning that I'm not a trusted user, so the setting is ignored. I ended up temporarily disabling it from my NixOS config. Could something similar be happening to you? |
It could be. I have not added my user to |
Description
When the user changes which addresses mu should consider 'personal', mu's store should be reinitialized.
After this change, the activation script parses the previously configured list of addresses and compares it with the new one. If they differ, it runs the init command even when the store has already been initialized.
Checklist
Change is backwards compatible.
Code formatted with
./format
.Code tested through
nix-shell --pure tests -A run.all
ornix develop --ignore-environment .#all
using Flakes.Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module
Maintainer CC
@KarlJoad