Issue with getting started with sops-nix

I’m trying to follow this tutorial for sops-nix Managing Secrets in NixOS Home Manager with SOPS. Under Create and Encrypt the Secrets File, I tried nix-shell -p sops --run "sops secrets.yaml" but I keep getting config file not found, or has no creation rules, and no keys provided through command line options, despite .sops.yaml existing in the current directory. What do I do? Is there something I’m missing?

Also, let me know if there’s a better tutorial that explains things for noobs that never used sops at all.

Post the contents of your .sops.yaml (you can redact the keys if you want, but copy everything else exactly, yaml is whitespace-sensitive).

The article had the indentation wrong for .sops.yaml, it’s supposed to look like this:

keys:
  - &host_hostname <youragekey>
creation_rules:
  - path_regex: secrets.yaml$
    key_groups:
    - age:
      - *host_hostname

Yeah, that’s in the readme… generally articles by random users are not the best quality. Prefer upstream docs.

1 Like