about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-09-30 16:43:29 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-09-30 16:43:29 +0200
commit474d732b61673c311b212262fc4fee88430bbced (patch)
treef9de0b921f120e638023d8fcb84bf0b654c4345b
parentchore(templates): Add the new `git_template` directory (diff)
downloadflake-templates-474d732b61673c311b212262fc4fee88430bbced.tar.gz
flake-templates-474d732b61673c311b212262fc4fee88430bbced.zip
feat(common/init): Perform the first run of `reuse` on init
Diffstat (limited to '')
-rw-r--r--common/init14
1 files changed, 14 insertions, 0 deletions
diff --git a/common/init b/common/init
index ecb52f4..f8c8bb3 100644
--- a/common/init
+++ b/common/init
@@ -165,4 +165,18 @@ chmod +x scripts/*
 chmod +x update.sh
 [ -f ./build.sh ] && chmod +x build.sh
 [ -f ./watch.sh ] && chmod +x build.sh
+
+# Do the first run of reuse annotate
+reuse="$(nix build nixpkgs#reuse --no-link --print-out-paths)"
+[ "$(echo "$reuse" | wc -l)" -ne 1 ] && die "Something is wrong with the nixpkgs#reuse derivation"
+
+git add .
+
+git diff --name-only --cached |
+    xargs -I {} "$reuse" annotate \
+        --copyright "$AUTHOR_NAME <$AUTHOR_EMAIL>" \
+        --copyright-style string-c \
+        --template default \
+        --license "$SPDX_LICENSE_IDENTIFIER" "{}"
+
 # vim: ft=sh