summaryrefslogtreecommitdiff
path: root/nix/tamal
diff options
context:
space:
mode:
author·𐑑𐑴𐑕𐑑𐑩𐑀2025-12-23 06:22:23 +0000
committer·𐑑𐑴𐑕𐑑𐑩𐑀2025-12-23 06:22:23 +0000
commit549a209f96bbd9f3a62f50cc2a075bdb61cf295c (patch)
tree6c4dd2be7aa8c6c53f566c3baf4c5d8fe95c47ed /nix/tamal
parent7d395daf34f89f1e6628f7871768d06eb0d16187 (diff)
downloadnixtaml-549a209f96bbd9f3a62f50cc2a075bdb61cf295c.tar
nixtaml-549a209f96bbd9f3a62f50cc2a075bdb61cf295c.tar.gz
nixtaml-549a209f96bbd9f3a62f50cc2a075bdb61cf295c.tar.bz2
nixtaml-549a209f96bbd9f3a62f50cc2a075bdb61cf295c.tar.lz
nixtaml-549a209f96bbd9f3a62f50cc2a075bdb61cf295c.tar.xz
nixtaml-549a209f96bbd9f3a62f50cc2a075bdb61cf295c.tar.zst
nixtaml-549a209f96bbd9f3a62f50cc2a075bdb61cf295c.zip
nix dep: add dash-nix
Diffstat (limited to 'nix/tamal')
-rw-r--r--nix/tamal/darcs_context/.editorconfig1
-rw-r--r--nix/tamal/darcs_context/dash-nix.txt8
-rw-r--r--nix/tamal/default.nix40
-rw-r--r--nix/tamal/lock.json2
-rw-r--r--nix/tamal/manifest.kdl11
5 files changed, 61 insertions, 1 deletions
diff --git a/nix/tamal/darcs_context/.editorconfig b/nix/tamal/darcs_context/.editorconfig
new file mode 100644
index 0000000..78b36ca
--- /dev/null
+++ b/nix/tamal/darcs_context/.editorconfig
@@ -0,0 +1 @@
+root = true
diff --git a/nix/tamal/darcs_context/dash-nix.txt b/nix/tamal/darcs_context/dash-nix.txt
new file mode 100644
index 0000000..b20003e
--- /dev/null
+++ b/nix/tamal/darcs_context/dash-nix.txt
@@ -0,0 +1,8 @@
+
+Context:
+
+
+[TAG 0.1.0
+·𐑑𐑴𐑕𐑑𐑩𐑀 <toastal@posteo.net>**20251223061619
+ Ignore-this: d3a35324d7812dc4844b63d9ac3abb5a4f8d82017cea37381e663be51dd831265e67cd815e87b7a4
+]
diff --git a/nix/tamal/default.nix b/nix/tamal/default.nix
index a995c23..ee07ccd 100644
--- a/nix/tamal/default.nix
+++ b/nix/tamal/default.nix
@@ -84,6 +84,40 @@ let
${hash.al} = hash.vl;
} // lib.optionalAttrs (builtins.length kind.ms > 0) { urls = kind.ms; };
+ fetch-darcs = {name, kind, hash}:
+ let
+ using-mirrors = kind ? ms && (builtins.length kind.ms) > 0;
+ mirror-support = pkgs.fetchdarcs.__functionArgs ? "mirrors";
+ reference =
+ let
+ type = builtins.elemAt kind.rf 0;
+ value = builtins.elemAt kind.rf 1;
+ in
+ if type == 0 then
+ let path = builtins.elemAt value 1; in
+ assert (lib.hasSuffix ".txt" path);
+ let
+ txt-files = lib.sourceFilesBySuffices ./. [ ".txt" ];
+ dir = lib.fileset.toSource {
+ root = ./.;
+ fileset = lib.fileset.fromSource txt-files;
+ };
+ in
+ {context = "${dir}/${path}";}
+ else if type == 1 then
+ {rev = value;}
+ else
+ throw "Invalid Darcs reference";
+ in
+ lib.warnIf (using-mirrors && !mirror-support)
+ "Upstream pkgs.fetchdarcs doesn’t yet support mirrors for γ€Œ${name}」"
+ pkgs.fetchdarcs ({
+ url = kind.rp;
+ ${hash.al} = hash.vl;
+ } // reference // lib.optionalAttrs (using-mirrors && mirror-support){
+ mirrors = kind.ms;
+ });
+
to-input = name: input:
let k = builtins.head input.kd; in
if k == 1 then
@@ -92,6 +126,12 @@ let
kind = builtins.elemAt input.kd 1;
hash = input.ha;
}
+else if k == 3 then
+ fetch-darcs {
+ inherit name;
+ kind = builtins.elemAt input.kd 1;
+ hash = input.ha;
+ }
else
throw "Unsupported input kind β€œ${builtins.toString k}”.";
in
diff --git a/nix/tamal/lock.json b/nix/tamal/lock.json
index 6bd9717..f98764c 100644
--- a/nix/tamal/lock.json
+++ b/nix/tamal/lock.json
@@ -1 +1 @@
-{"v":"0.1.0","i":{"nixpkgs":{"kd":[1,{"ur":"https://github.com/NixOS/nixpkgs/archive/306ea70f9eb0fb4e040f8540e2deab32ed7e2055.tar.gz","ms":[]}],"ha":{"al":"sha256","vl":"1cxf8iw2janh04bcnw93b0sl9mzh94awzzrrdfhig170cssmz8lm"},"lv":"306ea70f9eb0fb4e040f8540e2deab32ed7e2055"}}} \ No newline at end of file
+{"v":"0.1.0","i":{"nixpkgs":{"kd":[1,{"ur":"https://github.com/NixOS/nixpkgs/archive/306ea70f9eb0fb4e040f8540e2deab32ed7e2055.tar.gz","ms":[]}],"ha":{"al":"sha256","vl":"1cxf8iw2janh04bcnw93b0sl9mzh94awzzrrdfhig170cssmz8lm"},"lv":"306ea70f9eb0fb4e040f8540e2deab32ed7e2055"},"dash-nix":{"kd":[3,{"rp":"https://darcs.toastal.in.th/dash-nix","ms":["https://smeder.ee/~toastal/dash-nix.darcs"],"dt":"2025-12-23T06:16:19Z","rf":[0,[0,"./darcs_context/dash-nix.txt"]],"lw":"4e22a71815c612374821959def64f60f66af0eff"}],"ha":{"al":"sha256","vl":"1kjyskwbchygwjqhpsq8pppfr133l508gi4fzd0pf12hfg46xn9x"},"lv":"4e22a71815c612374821959def64f60f66af0eff"}}} \ No newline at end of file
diff --git a/nix/tamal/manifest.kdl b/nix/tamal/manifest.kdl
index 6eeab6c..3856626 100644
--- a/nix/tamal/manifest.kdl
+++ b/nix/tamal/manifest.kdl
@@ -13,4 +13,15 @@ inputs {
| cut -f1
}
}
+ dash-nix {
+ darcs {
+ repository "https://darcs.toastal.in.th/dash-nix"
+ mirrors "https://smeder.ee/~toastal/dash-nix.darcs"
+ "https://hub.darcs.net/toastal/darcs-nix"
+ }
+ latest-cmd {
+ $ curl -fsL "https://darcs.toastal.in.th/dash-nix/_darcs/weak_hash"
+ }
+ }
}
+