From 60c8a7d4dc5c86f4e99f3cf372c539905d6e02ae Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Fri, 3 May 2024 15:13:43 +0200 Subject: [PATCH] Add `git diff` support for `sops` files --- .gitattributes | 6 ++++++ .gitconfig | 2 ++ README.md | 8 +++++++- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .gitattributes create mode 100644 .gitconfig diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3a48fe5 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +secrets/**/*.env diff=sopsdiffer +secrets/**/*.env.* diff=sopsdiffer +secrets/**/*.ini diff=sopsdiffer +secrets/**/*.json diff=sopsdiffer +secrets/**/*.yaml diff=sopsdiffer +secrets/**/*.yml diff=sopsdiffer diff --git a/.gitconfig b/.gitconfig new file mode 100644 index 0000000..f390e5e --- /dev/null +++ b/.gitconfig @@ -0,0 +1,2 @@ +[diff "sopsdiffer"] + textconv = "sops --decrypt" diff --git a/README.md b/README.md index 7b73cf1..cbbd3dc 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ # NixOSConfig -NixOS Configurations for personal Machines \ No newline at end of file +NixOS Configurations for personal Machines + +Run the following command for adding `git diff` support for `sops` in this repository: + +```sh +git config --local include.path ../.gitconfig +```