fn: add docstring to sopsHelper
This commit is contained in:
parent
1812effbd7
commit
f545e30831
1 changed files with 44 additions and 0 deletions
44
fn.nix
44
fn.nix
|
@ -151,6 +151,50 @@ rec {
|
|||
# But at least it now (hopefully) checks ONLY dependencies (and all of them at that).
|
||||
depsBrokenRec =
|
||||
p: (meetsConDo (p: ifelse (depsBroken p) true (depsBrokenRec (deps p))) (p: true) (deps p));
|
||||
|
||||
/**
|
||||
Helper function to generate secret definitions for sops-nix.
|
||||
|
||||
# Type
|
||||
```
|
||||
sopsHelper :: ()
|
||||
```
|
||||
# Arguments
|
||||
# Examples
|
||||
```nix
|
||||
sopsHelper (name: "services/nextcloud/${name}")
|
||||
[ "adminPass" "dbPass" ]
|
||||
{ owner = "nextcloud"; group = "nextcloud"; }
|
||||
=> {
|
||||
"services/nextcloud/adminPass" = {
|
||||
group = "nextcloud";
|
||||
owner = "nextcloud";
|
||||
};
|
||||
"services/nextcloud/dbPass" = {
|
||||
group = "nextcloud";
|
||||
owner = "nextcloud";
|
||||
};
|
||||
}
|
||||
|
||||
sopsHelper (user: "users/${user}/publicKey")
|
||||
[ "alice" "bob" "eve" ]
|
||||
(user: { path = "/etc/ssh/authorized_keys.d/${user}"; mode = "444"; })
|
||||
=> {
|
||||
"users/alice/publicKey" = {
|
||||
mode = "444";
|
||||
path = "/etc/ssh/authorized_keys.d/alice";
|
||||
};
|
||||
"users/bob/publicKey" = {
|
||||
mode = "444";
|
||||
path = "/etc/ssh/authorized_keys.d/bob";
|
||||
};
|
||||
"users/eve/publicKey" = {
|
||||
mode = "444";
|
||||
path = "/etc/ssh/authorized_keys.d/eve";
|
||||
};
|
||||
}
|
||||
```
|
||||
*/
|
||||
sopsHelper =
|
||||
template: names: options:
|
||||
let
|
||||
|
|
Loading…
Reference in a new issue