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

Home manager module conflict #305

Open
blackxored opened this issue Dec 26, 2024 · 3 comments
Open

Home manager module conflict #305

blackxored opened this issue Dec 26, 2024 · 3 comments

Comments

@blackxored
Copy link

It seems like we can't use the home manager module alongside the nixosModule, while this is most likely misconfiguration, I wonder if anyone's run into this?
error: The option `age.identityPaths' in `/nix/store/5mg8m013dk1dv3sl934ki6nbldgv23yf-source/modules/age-home.nix' is already declared in `/nix/store/5mg8m013dk1dv3sl934ki6nbldgv23yf-source/modules/age.nix

@taciturnaxolotl
Copy link

Same error here

@taciturnaxolotl
Copy link

possible dup: #263

@Erwyn
Copy link

Erwyn commented Jan 20, 2025

If this can help you I'm using both modules as I have system secrets and personal secrets.

What is do to avoid your error which I already encountered is this:

  1. I load the nixosModule in my flake and pass the agenix input as extraSpecialArgs of my home-manager module like this :
          modules =
          [
            agenix.nixosModules.default
            home-manager.nixosModules.home-manager
            {
              home-manager = {
                useGlobalPkgs = true;
                useUserPackages = true;
                users.whateverUser = import ./config/home/home.nix;
                extraSpecialArgs = {
                  inherit unstablePkgs;
                  agenix = agenix;
                };
              };
            }
            .......

  1. Then in my home.nix (or wherever you put this if you split your whole configuration) I import the homeManagerModules:
{ agenix, ... }:
{
  imports = [
    agenix.homeManagerModules.default
  ];

  age.identityPaths = [ "whereverIsMySecretsSSHKey" ];
  age.secrets = { Your secrets definition };
}

This works well on my setups. Maybe this is completely stupid and I would be happy to know the correct way of doing this, but including both modules on flake level ended up in the same issue you were presented.

Hope this helps.

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

3 participants