summaryrefslogtreecommitdiff
path: root/secrets
diff options
context:
space:
mode:
Diffstat (limited to 'secrets')
-rw-r--r--secrets/secrets.nix6
-rw-r--r--secrets/toSecrets.nix34
2 files changed, 16 insertions, 24 deletions
diff --git a/secrets/secrets.nix b/secrets/secrets.nix
index 7a28470..7b933e9 100644
--- a/secrets/secrets.nix
+++ b/secrets/secrets.nix
@@ -9,9 +9,7 @@ let
glados = {
owner = owners.getchoo;
pubkey = "age1n7tyxx63wpgnmwkzn7dmkm62jxel840rk3ye3vsultrszsfrwuzsawdzhq";
- files = [
- "sethPassword.age"
- ];
+ files = [ "sethPassword.age" ];
};
glados-wsl = {
@@ -34,4 +32,4 @@ let
};
};
in
- toSecrets hosts
+toSecrets hosts
diff --git a/secrets/toSecrets.nix b/secrets/toSecrets.nix
index 3d495c6..fff6936 100644
--- a/secrets/toSecrets.nix
+++ b/secrets/toSecrets.nix
@@ -1,25 +1,19 @@
-hosts: let
- optional = attrset: val:
- if attrset ? ${val}
- then [attrset.${val}]
- else [];
+hosts:
+let
+ optional = attrset: val: if attrset ? ${val} then [ attrset.${val} ] else [ ];
mkPubkeys = host: optional host "pubkey" ++ optional host "owner";
- op = acc: host:
+ op =
+ acc: host:
acc
- // (
- builtins.listToAttrs (
- map (
- file: {
- name = "${host}/${file}";
- value = {
- publicKeys = mkPubkeys hosts.${host};
- };
- }
- )
- hosts.${host}.files
- )
- );
+ // (builtins.listToAttrs (
+ map (file: {
+ name = "${host}/${file}";
+ value = {
+ publicKeys = mkPubkeys hosts.${host};
+ };
+ }) hosts.${host}.files
+ ));
in
- builtins.foldl' op {} (builtins.attrNames hosts)
+builtins.foldl' op { } (builtins.attrNames hosts)