From e25752c74643bd23cd46d7a51201de9bfddb5da4 Mon Sep 17 00:00:00 2001 From: Jelle Besseling Date: Sun, 20 Feb 2022 21:56:52 +0100 Subject: [PATCH] Add updateToolchainManifest explanation --- flake.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/flake.nix b/flake.nix index 4fb387019..1be745ac8 100644 --- a/flake.nix +++ b/flake.nix @@ -68,6 +68,21 @@ inherit system; overlays = [ nixpkgs-mozilla.overlays.rust self.overlay ]; }; + + # Script to update the toolchain-manifest.toml file which is used in the nix build. + # + # nixpkgs doesn't package rust nightly, so the Mozilla nixpkgs Rust overlay is used, + # which can download the rust toolchain if given a manifest file (a sha256 hash can also be used + # in which case the overlay downloads the manifest file with fetchurl). + # The nice thing about this manifest file is that the nix builds are fully hermetic. + # The downside is that now both nixpkgs needs to be updated (with nix flake update) + # and the toolchain manifest. + # + # To update the toolchain to the latest nightly, run + # $ nix develop + # $ updateToolchainManifest + # The script also accepts arguments for a different rust channel (first argument) + # or a specific nightly date (e.g. updateToolchainManifest nightly 2022-02-19) updateToolchainManifest = pkgs.writeScriptBin "updateToolchainManifest" '' #! /usr/bin/env bash