Skip to content
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

Error on system startup when home-manager used as NixOS module #19

Open
Gerschtli opened this issue Nov 28, 2021 · 3 comments
Open

Error on system startup when home-manager used as NixOS module #19

Gerschtli opened this issue Nov 28, 2021 · 3 comments

Comments

@Gerschtli
Copy link
Contributor

Hey, I set up my NixOS system with home-manager as NixOS module. Therefore, the activation script will run inside a systemd service that also runs on system boot. During that phase I get the following error:

Activating homeage
Decrypting secret /nix/store/<path>.age to /run/user/1000/secrets/<path>
mkdir: cannot create directory ‘/run/user/1000’: Permission denied

It looks like the directory was not created yet. I don't know how and when this directory is created (hopefully a system service) than home-manager should specify that as dependency for its systemd service.

  1. Do you have an idea, how to find the service that creates this directory?
  2. At least mark that in the README or even add the dependency in home-manager NixOS module itself.
@Gerschtli
Copy link
Contributor Author

Found a solution, maybe would be good to mention this workaround somewhere. Not sure if it would be worth (or possible, the uid could be non-trivial) putting it into home-manager.

let
  username = "<your username>";
  uid = 1000; # your uid
in
{
  systemd.services.home-manager-${username} = {
    after = [ "run-user-${toString uid}.mount" ];
    wants = [ "run-user-${toString uid}.mount" ];
  };
}

Gerschtli added a commit to Gerschtli/nix-config that referenced this issue Dec 7, 2021
Homeage puts secrets to /run/user/$UID during home-manager activation.

See jordanisaacs/homeage#19
Gerschtli added a commit to Gerschtli/nix-config that referenced this issue Dec 7, 2021
Homeage puts secrets to /run/user/$UID during home-manager activation.

See jordanisaacs/homeage#19
Gerschtli added a commit to Gerschtli/nix-config that referenced this issue Dec 7, 2021
Homeage puts secrets to /run/user/$UID during home-manager activation.

See jordanisaacs/homeage#19
@Gerschtli
Copy link
Contributor Author

Oh damn it, that didn't solve the problem, sorry.

@jordanisaacs
Copy link
Owner

Ya I am not sure what the fix could be here. I'll leave this open in case anyone figures it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants