summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/manifest.rst1
-rw-r--r--lib/manifest.ml28
-rw-r--r--nix/tamal/manifest.kdl2
3 files changed, 13 insertions, 18 deletions
diff --git a/doc/manifest.rst b/doc/manifest.rst
index 1c9e4c2..d6b7d72 100644
--- a/doc/manifest.rst
+++ b/doc/manifest.rst
@@ -45,6 +45,7 @@ Default ``manifest.kdl``
archive {
url "https://github.com/NixOS/nixpkgs/archive/{{cmd_value}}.tar.gz"
}
+ hash algorithm=SHA256
latest-cmd {
$ git ls-remote --heads "https://github.com/NixOS/nixpkgs.git" --refs "refs/heads/nixos-unstable"
| cut -f1
diff --git a/lib/manifest.ml b/lib/manifest.ml
index 725cbc5..8cadce5 100644
--- a/lib/manifest.ml
+++ b/lib/manifest.ml
@@ -371,23 +371,17 @@ module Hash = struct
let codec : t Util.KDL.codec = {
to_kdl = (fun hash ->
let open Kdl in
- if hash.algorithm != Input.Hash.default_algorithm || Option.is_some hash.expected then
- let props =
- match hash.expected with
- | None -> []
- | Some exp_hash ->
- ["expected", (None, `String exp_hash)]
- in
- let props =
- if hash.algorithm != Input.Hash.default_algorithm then
- let algo_str = Input.Hash.algorithm_to_string hash.algorithm in
- ("algorithm", (None, `String algo_str)) :: props
- else
- props
- in
- [node "hash" ~props []]
- else
- []
+ let props =
+ match hash.expected with
+ | None -> []
+ | Some exp_hash ->
+ ["expected", (None, `String exp_hash)]
+ in
+ let props =
+ let algo_str = Input.Hash.algorithm_to_string hash.algorithm in
+ ("algorithm", (None, `String algo_str)) :: props
+ in
+ [node "hash" ~props []]
);
of_kdl = (fun kdl ->
let open Util.KDL.L in
diff --git a/nix/tamal/manifest.kdl b/nix/tamal/manifest.kdl
index 6dfe609..d85e2f0 100644
--- a/nix/tamal/manifest.kdl
+++ b/nix/tamal/manifest.kdl
@@ -7,10 +7,10 @@ inputs {
archive {
url "https://github.com/NixOS/nixpkgs/archive/{{cmd_value}}.tar.gz"
}
+ hash algorithm=SHA256
latest-cmd {
$ git ls-remote --heads "https://github.com/NixOS/nixpkgs.git" --refs "refs/heads/nixpkgs-unstable"
| cut -f1
}
}
}
-