summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Keller <tjk@tjkeller.xyz>2026-03-28 12:45:48 -0500
committerTim Keller <tjk@tjkeller.xyz>2026-03-28 12:45:48 -0500
commit0538c0398cbf338ad1261b1f58a01d3aaed94d50 (patch)
tree1b899ed03844c427cc6196c3f1fa360868dda3ab
parent3dcbd6b10b6cbbd551c41df278cd555d54d46bdf (diff)
downloadnixos-0538c0398cbf338ad1261b1f58a01d3aaed94d50.tar.xz
nixos-0538c0398cbf338ad1261b1f58a01d3aaed94d50.zip
add warning to rebuild if age key is missing for sops and simplify sops config
-rw-r--r--.sops.yaml10
-rwxr-xr-xrebuild7
2 files changed, 12 insertions, 5 deletions
diff --git a/.sops.yaml b/.sops.yaml
index 4da25c9..2d54fd2 100644
--- a/.sops.yaml
+++ b/.sops.yaml
@@ -2,23 +2,23 @@ keys:
- &general age1w80rc0dnuu8nw99gw64c596qqetm78jdnsqajr0u7ephykekr39qfz8vnv
- &flex-wg-router age1f0tmpy2nam58skmznjyqd3zf54rxtfrk6fda0vlpq9y3yg6wac7sjf0vja
creation_rules:
- - path_regex: timmy/resources/secrets/hashed-root-password.yaml
+ - path_regex: timmy/resources/secrets/.*\.yaml
key_groups:
- age:
- *general
- *flex-wg-router
- - path_regex: timmy/resources/secrets/wpa_supplicant-conf.yaml
+ - path_regex: T495/resources/secrets/.*\.yaml
key_groups:
- age:
- *general
- - path_regex: T495/resources/secrets/wg0.yaml
+ - path_regex: X230/resources/secrets/.*\.yaml
key_groups:
- age:
- *general
- - path_regex: X230/resources/secrets/wg0.yaml
+ - path_regex: flex-wg-router/resources/secrets/.*\.yaml
key_groups:
- age:
- - *general
+ - *flex-wg-router
diff --git a/rebuild b/rebuild
index 91ea7a1..cb92b80 100755
--- a/rebuild
+++ b/rebuild
@@ -1,2 +1,9 @@
#!/bin/sh
+if [ ! -f ~/.config/sops/age/keys.txt ]; then
+ mkdir -p ~/.config/sops/age
+ echo "---------------------------------------------------------------------------------------------------"
+ echo "| WARNING: Sops key not found. Please generate one from your ssh key using the following command: |"
+ echo "| nix run nixpkgs#ssh-to-age -- -private-key -i ~/.ssh/private > ~/.config/sops/age/keys.txt |"
+ echo "---------------------------------------------------------------------------------------------------"
+fi
nixos-rebuild switch --sudo --flake "$(dirname "$0")/#$(hostname)" $@