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

homemanager module not working #315

Closed
ccalhoun1999 opened this issue Feb 26, 2025 · 6 comments
Closed

homemanager module not working #315

ccalhoun1999 opened this issue Feb 26, 2025 · 6 comments

Comments

@ccalhoun1999
Copy link

Building with the following in my home.nix after enabling the home manager module:

age = {
    # identityPaths = [ "~/.ssh/id_ed25519" ];
    secrets.syncthing-password = {
      file = ../../secrets/syncthing-password.age;
      owner = "ccalhoun";
      group = "syncthing";
    };
  };

leads to the following error:

       error: attribute 'home' missing
       at /nix/store/glsqq1xn5al7d528hvlbm4hl3ladxmka-source/modules/age-home.nix:171:12:
          170|       default = [
          171|         "${config.home.homeDirectory}/.ssh/id_ed25519"
             |            ^
          172|         "${config.home.homeDirectory}/.ssh/id_rsa"
       Did you mean time?
@ccalhoun1999
Copy link
Author

Its hard to tell if this is me misusing the module, or a problem due to #306

@ccalhoun1999
Copy link
Author

Turns out its not related to the configuration, just enabling the module causes the error.

@kostareg
Copy link

kostareg commented Mar 3, 2025

How do you import it? It looks like you're not using home-manager.sharedModules or the equivalent.

@ccalhoun1999
Copy link
Author

This is from my flake.nix, I've edited out irrelevant code:

      ccalhoun-desktop-nixos = nixpkgs.lib.nixosSystem {
        specialArgs = {inherit inputs outputs;};
          ./nixos/shared.nix
          ./nixos/desktop/configuration.nix
          home-manager.nixosModules.home-manager
          agenix.homeManagerModules.default
        ];
      };

I'm unsure as to what sharedModules is.

@kostareg
Copy link

kostareg commented Mar 4, 2025

You are trying to import a home manager module as a system module. Try this, wherever you define your home-manager configuration:

home-manager.users.myuser = …;
home-manager.sharedModules = [agenix.homeManagerModules.age];

@ccalhoun1999
Copy link
Author

That fixed it, thank you!

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