Mic92 / sops-nix

Atomic secret provisioning for NixOS based on sops
MIT License
1.64k stars 154 forks source link

Option sips.gnupg.home declared in multiple places when using age key #584

Closed DeltaScratchpad closed 3 months ago

DeltaScratchpad commented 4 months ago

I have received the error `error: The option 'sops.gnupg.home' in '/nix/store/aa0zsahvyqnvzkicsh29jirm9hwv95pg-source/flake.nix' is already declared in '/nix/store/33ry497ing1bkj1nh8ymv80lsr2748pi-source/hosts/default/configuration.nix'.' when attempting to make a very minimal setup.

My configuration.nix file contains only these lines in relation to sops: `# Secret Management sops.defaultSopsFile = /etc/nixos/secrets/secrets.yaml; sops.defaultSopsFormat = "yaml";

sops.age.keyFile = "/home/username/.config/sops/age/keys.txt"; sops.gnupg.sshKeyPaths = [];`

with the import inputs.sops-nix.nixosModules.sops

from the flake.nix file imports: sops-nix.url = "github:Mic92/sops-nix"; sops-nix.inputs.nixpkgs.follows = "nixpkgs";

and the modules (in outputs): inputs.sops-nix.nixosModules.sops

This was also reported in #562 but they didn't actually document how they fixed it, so the bug is still present.

jitzelndbm commented 3 months ago

Hello,

You're importing inputs.sops-nix.nixosModules.sops twice, in flake.nix and configuration.nix. So removing one of the imports will probably solve your issue. I also had this problem and I removed the module from the imports statement in the configuration.nix file.

Mic92 commented 3 months ago

^ looks about right.