-
Notifications
You must be signed in to change notification settings - Fork 124
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
agenix doesn't work properly when using impermanence #219
Comments
@jankaifer Are you using I don't have direct experience with either, but the issue is The possible solutions would either be breaking the dependency as you did, or constraining the order in which they can run; for instance, this ought to do the trick: systemd.user.services.agenix.Unit.After = [
"basic.target" # Ensures “basic boot-up” runs prior to agenix, including impermanence's bind-mounts
]; |
@nbraud thanks for the tip with systemd services, I didn't realize that. I run with / mounted as tmpfs and mount everything persistent with impermanence. |
I have a similar configuration but no FYI, when using agenix in the system config (as opposed to an hm one) the situation is different: it runs as an activationScript, whereas impermanence's NixOS module still uses services, so there's no easy way to order agenix after |
I ran into this issue a while back in my btrfs-backed impermanence setup. What I ended up doing was manually mounting |
I'm surprised this isn't mentioned here, but it's possible to just specify the direct location for the SSH hostkeys, and not having impermanence "manage" it as such. This is a simple snippet that I'm currently using, which works quite nicely. Seems like the most elegant solution to the problem. { config, ... }:
let
statePath = config.environment.persistence.root.persistentStoragePath + "/etc/ssh";
in {
services.openssh.hostKeys = [
{ path = statePath + "/ssh_host_rsa_key"; type = "rsa"; bits = 4096; }
{ path = statePath + "/ssh_host_ed25519_key"; type = "ed25519"; }
];
} |
I have the ssh key on in my home directory and it is mounted by impermanence on startup. Not sure what changes, but agenix started failing recently and it was caused by the fact that agenix started running before impermanence, which causeg agenix to not find the ssh key and fail to bootstrap the secrets.
I just solved it by not relying on impermanence mounts and specify directly the location of the ssk key on persistent drive like this.
Opening this issue mostly for others if someone faces a similar issue.
The text was updated successfully, but these errors were encountered: