From 950daf7fc384606605cafca1617bf12676485bed Mon Sep 17 00:00:00 2001 From: ยท๐‘‘๐‘ด๐‘•๐‘‘๐‘ฉ๐‘ค Date: Tue, 23 Dec 2025 06:22:23 +0000 Subject: mark-darcs-weak-hash: move to Nix --- nix/overlay/development.nix | 2 ++ nix/package/dev-shell.nix | 2 ++ nix/package/mark-darcs-weak-hash.nix | 26 ++++++++++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 nix/package/mark-darcs-weak-hash.nix (limited to 'nix') diff --git a/nix/overlay/development.nix b/nix/overlay/development.nix index b414597..c956556 100644 --- a/nix/overlay/development.nix +++ b/nix/overlay/development.nix @@ -7,6 +7,8 @@ final: prev: { final': prev': { dev-shell = final'.callPackage ../package/dev-shell.nix { }; + mark-darcs-weak-hash = final'.callPackage ../package/mark-darcs-weak-hash.nix { }; + nixfmt-3-space = final'.callPackage ../package/nixfmt-3-space.nix { }; ocamlformat-rpc-bin = final'.callPackage ../package/ocamlformat-rpc-bin.nix { }; diff --git a/nix/package/dev-shell.nix b/nix/package/dev-shell.nix index 77a9ac1..3cfec5c 100644 --- a/nix/package/dev-shell.nix +++ b/nix/package/dev-shell.nix @@ -7,6 +7,7 @@ kdlfmt, topiary, ocamlPackages, + mark-darcs-weak-hash, nixtamal, nixfmt-3-space, ocamlformat-rpc-bin, @@ -19,6 +20,7 @@ mkShell { ]; packages = [ kdlfmt + mark-darcs-weak-hash nixfmt-3-space topiary 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 โ”‚ +# 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" + ''; +} -- cgit v1.2.3