diff options
author | Colin Arnott <colin@urandom.co.uk> | 2022-12-03 19:49:00 +0000 |
---|---|---|
committer | Colin Arnott <colin@urandom.co.uk> | 2022-12-04 06:12:18 +0000 |
commit | bac379f30a6fa1284e48b4224862e0b41ad42199 (patch) | |
tree | 0bad9b7cbe730a740ec027e19d34e1c237f058db /doc/languages-frameworks/beam.section.md | |
parent | 88ae5d08250e206aad599c1bb9692bd9b3dd54c2 (diff) | |
download | nixlib-bac379f30a6fa1284e48b4224862e0b41ad42199.tar nixlib-bac379f30a6fa1284e48b4224862e0b41ad42199.tar.gz nixlib-bac379f30a6fa1284e48b4224862e0b41ad42199.tar.bz2 nixlib-bac379f30a6fa1284e48b4224862e0b41ad42199.tar.lz nixlib-bac379f30a6fa1284e48b4224862e0b41ad42199.tar.xz nixlib-bac379f30a6fa1284e48b4224862e0b41ad42199.tar.zst nixlib-bac379f30a6fa1284e48b4224862e0b41ad42199.zip |
doc: use sri hash syntax
The nixpkgs manual contains references to both sri hash and explicit sha256 attributes. This is at best confusing to new users. Since the final destination is exclusive use of sri hashes, see nixos/rfcs#131, might as well push new users in that direction gently. Notable exceptions to sri hash support are builtins.fetchTarball, cataclysm-dda, coq, dockerTools.pullimage, elixir.override, and fetchCrate. None, other than builtins.fetchTarball, are fundamentally incompatible, but all currently accept explicit sha256 attributes as input. Because adding backwards compatibility is out of scope for this change, they have been left intact, but migration to sri format has been made for any using old hash formats. All hashes have been manually tested to be accurate, and updates were only made for missing upstream artefacts or bugs.
Diffstat (limited to 'doc/languages-frameworks/beam.section.md')
-rw-r--r-- | doc/languages-frameworks/beam.section.md | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/doc/languages-frameworks/beam.section.md b/doc/languages-frameworks/beam.section.md index f6c74cb01e40..65204757b4a2 100644 --- a/doc/languages-frameworks/beam.section.md +++ b/doc/languages-frameworks/beam.section.md @@ -115,7 +115,7 @@ If there are git depencencies. owner = "elixir-libraries"; repo = "prometheus.ex"; rev = "a4e9beb3c1c479d14b352fd9d6dd7b1f6d7deee5"; - sha256 = "1v0q4bi7sb253i8q016l7gwlv5562wk5zy3l2sa446csvsacnpjk"; + hash = "sha256-U17LlN6aGUKUFnT4XyYXppRN+TvUBIBRHEUsfeIiGOw="; }; # you can re-use the same beamDeps argument as generated beamDeps = with final; [ prometheus ]; @@ -124,7 +124,7 @@ If there are git depencencies. }; ``` -You will need to run the build process once to fix the sha256 to correspond to your new git src. +You will need to run the build process once to fix the hash to correspond to your new git src. ###### FOD {#fixed-output-derivation} @@ -138,13 +138,13 @@ Practical steps mixFodDeps = fetchMixDeps { pname = "mix-deps-${pname}"; inherit src version; - sha256 = lib.fakeSha256; + hash = lib.fakeHash; }; ``` -The first build will complain about the sha256 value, you can replace with the suggested value after that. +The first build will complain about the hash value, you can replace with the suggested value after that. -Note that if after you've replaced the value, nix suggests another sha256, then mix is not fetching the dependencies reproducibly. An FOD will not work in that case and you will have to use mix2nix. +Note that if after you've replaced the value, nix suggests another hash, then mix is not fetching the dependencies reproducibly. An FOD will not work in that case and you will have to use mix2nix. ##### mixRelease - example {#mix-release-example} @@ -170,7 +170,7 @@ let pname = "mix-deps-${pname}"; inherit src version; # nix will complain and tell you the right value to replace this with - sha256 = lib.fakeSha256; + hash = lib.fakeHash; # if you have build time environment variables add them here MY_ENV_VAR="my_value"; }; @@ -282,7 +282,7 @@ mkShell { ### Using an overlay -If you need to use an overlay to change some attributes of a derivation, e.g. if you need a bugfix from a version that is not yet available in nixpkgs, you can override attributes such as `version` (and the corresponding `sha256`) and then use this overlay in your development environment: +If you need to use an overlay to change some attributes of a derivation, e.g. if you need a bugfix from a version that is not yet available in nixpkgs, you can override attributes such as `version` (and the corresponding `hash`) and then use this overlay in your development environment: #### `shell.nix` @@ -291,7 +291,7 @@ let elixir_1_13_1_overlay = (self: super: { elixir_1_13 = super.elixir_1_13.override { version = "1.13.1"; - sha256 = "0z0b1w2vvw4vsnb99779c2jgn9bgslg7b1pmd9vlbv02nza9qj5p"; + sha256 = "sha256-t0ic1LcC7EV3avWGdR7VbyX7pGDpnJSW1ZvwvQUPC3w="; }; }); pkgs = import <nixpkgs> { overlays = [ elixir_1_13_1_overlay ]; }; |