diff --git a/source/reference/pinning-nixpkgs.rst b/source/reference/pinning-nixpkgs.rst index def1c94..fb06871 100644 --- a/source/reference/pinning-nixpkgs.rst +++ b/source/reference/pinning-nixpkgs.rst @@ -35,8 +35,8 @@ Examples - ``NIX_PATH=nixpkgs=http://nixos.org/channels/nixos-20.03/nixexprs.tar.xz nix-build ...`` - Using just Nix:: - with import (fetchTarball https://github.com/NixOS/nixpkgs/archive/nixos-20.03.tar.gz) {}; - - stdenv.mkDerivation { … } + let + pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-20.03.tar.gz") {}; + in pkgs.stdenv.mkDerivation { … } - To make ad-hoc environment available on NixOS: ``nix.nixPath = [ ("nixpkgs=" + toString pkgs.path) ];`` diff --git a/source/tutorials/towards-reproducibility-pinning-nixpkgs.rst b/source/tutorials/towards-reproducibility-pinning-nixpkgs.rst index 49641b7..cb84ad9 100644 --- a/source/tutorials/towards-reproducibility-pinning-nixpkgs.rst +++ b/source/tutorials/towards-reproducibility-pinning-nixpkgs.rst @@ -32,7 +32,7 @@ The simplest way to do this is to fetch the required nixpkgs version as a tarbal .. code:: nix - { pkgs ? import (fetchTarball https://github.com/NixOS/nixpkgs/archive/3590f02e7d5760e52072c1a729ee2250b5560746.tar.gz) {}; + { pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/3590f02e7d5760e52072c1a729ee2250b5560746.tar.gz") {}; }: ...