diff options
Diffstat (limited to 'nix/package/mark-darcs-weak-hash.nix')
| -rw-r--r-- | nix/package/mark-darcs-weak-hash.nix | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/nix/package/mark-darcs-weak-hash.nix b/nix/package/mark-darcs-weak-hash.nix new file mode 100644 index 0000000..7f644e1 --- /dev/null +++ b/nix/package/mark-darcs-weak-hash.nix @@ -0,0 +1,26 @@ +#──────────────────────────────────────────────────────────────────────────────┐ +# SPDX-FileCopyrightText: 2025 toastal <https://toast.al/contact/> │ +# SPDX-License-Identifier: LGPL-2.1-or-later │ +#──────────────────────────────────────────────────────────────────────────────┘ +{ + lib, + writeDashBinScript, + darcs, + gawk, +}: + +let + path = lib.makeBinPath [ + darcs + gawk + ]; +in +writeDashBinScript { + name = "mark-darcs-weak-hash"; + text = /* sh */ '' + export PATH="${path}:$PATH" + + darcs show repo \ + | awk '/^[[:space:]]*Weak Hash:/ { sub(/^[[:space:]]*Weak Hash:[[:space:]]*/, "", $0); printf $0 }' > "$PWD/_darcs/weak_hash" + ''; +} |
