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

Arrays throw error on system rebuild #450

Open
LennyLizowzskiy opened this issue Dec 7, 2023 · 4 comments
Open

Arrays throw error on system rebuild #450

LennyLizowzskiy opened this issue Dec 7, 2023 · 4 comments

Comments

@LennyLizowzskiy
Copy link

Error message:

error: builder for '/nix/store/d4rn1qq6yzh783qzhlvgzivz3jbrmvli-manifest.json.drv' failed with exit code 1;
       last 1 log lines:
       > /nix/store/1jv2yiw42wzar5ps8x06xgk8ibc0f0ck-sops-install-secrets-0.0.1/bin/sops-install-secrets: Manifest is not valid: secret example_array in /nix/store/5hk389r44g09gj8d4iimf59fkiqcjbm2-secrets.yaml is not valid: The value of key '' is not a string
       For full logs, run 'nix log /nix/store/d4rn1qq6yzh783qzhlvgzivz3jbrmvli-manifest.json.drv'.
error: 1 dependencies of derivation '/nix/store/a9cjnxh7fdds0n4xk49dlkiypk6j9qdl-nixos-system-rher-24.05.20231201.91050ea.drv' failed to build

secrets.yaml:

hello: Welcome to SOPS! Edit this file as you please!
example_key: example_value
# Example comment
example_array:
    - example_value1
    - example_value2
example_number: 1234.56789
example_booleans:
    - true
    - false
a: 1

NixOS config:

sops = {
    defaultSopsFile = ./secrets/secrets.yaml;
    defaultSopsFormat = "yaml";
    age.keyFile = "${mainUser.home}/.config/sops/age/keys.txt";

    secrets = {
      "example_array" = secretsDefaults;
    };
  };

If I change "example_array" to (for example) "hello" or any other non-array entry name in the NixOS config then it works and I can rebuild my system

@Mic92
Copy link
Owner

Mic92 commented Dec 7, 2023

Yes. Arrays are unsupported. It's not clear to me what those actually should be translated to.

@LennyLizowzskiy
Copy link
Author

LennyLizowzskiy commented Dec 7, 2023

Yes. Arrays are unsupported. It's not clear to me what those actually should be translated to.

I wish there would be something like entry_name/[index of the array] (so /run/secrets/example_array/0 for example). The lack of it really constrains me tbh

@SuperSandro2000
Copy link
Contributor

I think that would be ambiguous if the structure would look like:

entry_name:
  0: entry

@asyncedd
Copy link

Yes. Arrays are unsupported. It's not clear to me what those actually should be translated to.

sorry for bothering but are there any workarounds atm?

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

4 participants