diff options
Diffstat (limited to 'bash')
| -rw-r--r-- | bash/.bash_aliases | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/bash/.bash_aliases b/bash/.bash_aliases index 3693bf5..7ec2ad1 100644 --- a/bash/.bash_aliases +++ b/bash/.bash_aliases @@ -28,3 +28,23 @@ tm() { tmux fi } + +# Edit NixOS Sops secret files. +se() { + local SYSTEM=$1 + local REPO_ROOT="$HOME/.nixos" + local SECRET_PATH="$REPO_ROOT/systems/$SYSTEM/secrets/secrets.yaml" + + if [ -z "$SYSTEM" ]; then + echo "Usage: se <system_name> (e.g., se suliman)" + return 1 + fi + + if [ ! -f "$SECRET_PATH" ]; then + echo "Error: Secret file not found at $SECRET_PATH" + echo "Creating new secret file for $SYSTEM..." + mkdir -p "$(dirname "$SECRET_PATH")" + fi + + nix shell nixpkgs#sops -c sops "$SECRET_PATH" +} |
