summaryrefslogtreecommitdiff
path: root/secrets
diff options
context:
space:
mode:
authorseth <[email protected]>2024-06-30 09:56:30 -0400
committerseth <[email protected]>2024-06-30 10:23:04 -0400
commit088facf700946cb8f2d96c6089185bdc2a67180a (patch)
treec5b4e4cffbb3ee4ad2498c2251892bd457e9d3c7 /secrets
parent5d3045a0769af3a94fba7b5cf646e8498aaef595 (diff)
alejandra -> nixfmt-rfc-style
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)