pin nixpkgs
This commit is contained in:
parent
bd2e6a1bd3
commit
10a9433932
3 changed files with 39 additions and 3 deletions
30
nixpkgs-update
Executable file
30
nixpkgs-update
Executable 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
4
nixpkgs.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
builtins.fetchTarball {
|
||||
url = "https://github.com/NixOS/nixpkgs-channels/archive/4557b9f1f50aa813ae673fe6fcd30ca872968947.tar.gz";
|
||||
sha256 = "0cam48cn042axcik9vqxsqjc2hwyb2grjbjxacsn4w0y1zk6k6l2";
|
||||
}
|
|
@ -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 {
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue