The last line is the problem. If I comment it out, it builds. If I don’t, I get this:
error:
… while calling the 'head' builtin
at /nix/store/dg2g5qwvs36dhfqj9khx4sfv0klwl9f0-source/lib/attrsets.nix:922:11:
921| || pred here (elemAt values 1) (head values) then
922| head values
| ^
923| else
… while evaluating the attribute 'value'
at /nix/store/dg2g5qwvs36dhfqj9khx4sfv0klwl9f0-source/lib/modules.nix:807:9:
806| in warnDeprecation opt //
807| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value; │ mirroredBoots = [
| ^
808| inherit (res.defsFinal') highestPrio;
(stack trace truncated; use '--show-trace' to show the full trace)
error: getting status of '/nix/store/nqjkmjqsgc7xrac9ywbwgq0a1dvqc6k5-source/secrets/secrets.yaml': No such file or directory
which according to this is supposed to communicate in the most unhelpful way that the option is of the wrong type.
You should not get the exact same error. The source directory hash should have changed:
error: getting status of '/nix/store/nqjkmjqsgc7xrac9ywbwgq0a1dvqc6k5-source/secrets/secrets.yaml': No such file or directory
This is splitting hairs, but if that didn’t change, is there any chance you added stuff to the wrong git repo? Can you check the contents of that directory in the store to maybe see what the mismatch is?
Is there anything the flake setup can mangle? I’m very new nix, and only set up flakes for sops … Are there any ‘similar’ flakes I can try to see if they fail in a similar way? Are there any diagnosis/consistency checks I can run?
Erm, yeah, it’s in secrets/secrets.yaml, not modules/secrets/secrets.yaml. Change this:
diff --git a/modules/sops.nix b/modules/sops.nix
index 2d7380b..7aebad5 100644
--- a/modules/sops.nix
+++ b/modules/sops.nix
@@ -7,7 +7,7 @@
# This will add secrets.yml to the nix store
# You can avoid this by adding a string to the full path instead, i.e.
# sops.defaultSopsFile = "/root/.sops/secrets/example.yaml";
- sops.defaultSopsFile = ./secrets/secrets.yaml;
+ sops.defaultSopsFile = ../secrets/secrets.yaml;
# This will automatically import SSH keys as age keys
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
sops.secrets.restic_password = {};