+46
docs/utils.md
+46
docs/utils.md
···See https://github.com/soopyc/nix-on-koumakan/blob/b7983776143c15c91df69ef34ba4264a22047ec6/systems/koumakan/services/fedivese/akkoma.nix#L8-L34 for a more extensive example+`attrset<nixos config attr> -> {namespace<str> ? "", secrets[list<str>], config ? freeformAttrset} -> secretHelpers`+This is a more convoluted setup that wraps around `_utils.genSecrets` to provide some additional helper functions.+NOTE: `<ReturnValue>.generate` is not actually a function. The attrset is "already" "rendered" should it be actually+placeholder = path: ""; # => placeholder string generated by sops-nix, for that secret path to be used in templates.+getTemplate = file: ""; # => actual path of the template, realized at activation time, similar to the get function.+namespace = "balls"; # for us, the namespace is just the top level element in our secrets yaml file.+some.service.settings.gock.file = secrets.get "my/definitions/gock"; # resolves to the path of balls/my/definitions/gock.`{filename<str> ? "index.html", content<str>, status<int> ? 200} -> {alias<str>, tryFiles<str>}`
+27
global/utils.nix
+27
global/utils.nix
···+namespace ? (lib.warn "secret namespace left as default, which is empty. it is encouraged to set a namespace for easier secret management. to override, explicitly set this to an empty value." ""),+else throw "secret path `${path}` is not defined in namespace `${namespace}`. (resolved: ${_r_ns namespace}/${path})";