diff --git a/nixpkgs-update b/nixpkgs-update new file mode 100755 index 0000000..f479b1c --- /dev/null +++ b/nixpkgs-update @@ -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 diff --git a/nixpkgs.nix b/nixpkgs.nix new file mode 100644 index 0000000..a542566 --- /dev/null +++ b/nixpkgs.nix @@ -0,0 +1,4 @@ +builtins.fetchTarball { + url = "https://github.com/NixOS/nixpkgs-channels/archive/4557b9f1f50aa813ae673fe6fcd30ca872968947.tar.gz"; + sha256 = "0cam48cn042axcik9vqxsqjc2hwyb2grjbjxacsn4w0y1zk6k6l2"; +} diff --git a/shell.nix b/shell.nix index 2d74392..b92d1dc 100644 --- a/shell.nix +++ b/shell.nix @@ -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 {