summaryrefslogtreecommitdiff
path: root/nix
diff options
context:
space:
mode:
Diffstat (limited to 'nix')
-rw-r--r--nix/overlay/development.nix2
-rw-r--r--nix/package/dev-shell.nix2
-rw-r--r--nix/package/mark-darcs-weak-hash.nix26
3 files changed, 30 insertions, 0 deletions
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 <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"
+ '';
+}