pin nixpkgs

This commit is contained in:
zimbatm 2019-08-12 12:16:00 +02:00
parent bd2e6a1bd3
commit 10a9433932
No known key found for this signature in database
GPG key ID: 71BAF6D40C1D63D7
3 changed files with 39 additions and 3 deletions

30
nixpkgs-update Executable file
View file

@ -0,0 +1,30 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bash curl jq
#
# Updates the pinned nixpkgs version
set -euo pipefail
source=nixpkgs.nix
owner=NixOS
repo=nixpkgs-channels
branch=nixos-unstable
echo "finding new revision for $owner/$repo@$branch..."
rev=$(curl -sfL https://api.github.com/repos/$owner/$repo/git/refs/heads/$branch | jq -r .object.sha)
echo "rev=$rev"
url=https://github.com/$owner/$repo/archive/$rev.tar.gz
echo "finding unpacked sha256 for $url..."
sha256=$(nix-prefetch-url --unpack "$url")
echo "generating new $source..."
cat <<NEW_SOURCE | tee "$source"
builtins.fetchTarball {
url = "$url";
sha256 = "$sha256";
}
NEW_SOURCE

4
nixpkgs.nix Normal file
View file

@ -0,0 +1,4 @@
builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs-channels/archive/4557b9f1f50aa813ae673fe6fcd30ca872968947.tar.gz";
sha256 = "0cam48cn042axcik9vqxsqjc2hwyb2grjbjxacsn4w0y1zk6k6l2";
}

View file

@ -1,8 +1,10 @@
let
nixpkgs = import ./nixpkgs.nix;
channelUrl = "https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz";
nixpkgs = builtins.fetchTarball channelUrl;
pkgs = import nixpkgs {};
pkgs = import nixpkgs {
config = {};
overlays = [];
};
in pkgs.mkShell {