Skip to content

Commit c683efa

Browse files
authored
Bump nixpkgs pin used in default.nix (#1649)
* Bump nixpkgs pin used in default.nix Making it match the current 22.05 pin in flake.lock. Was going to do this because of #1648, but might save some people a nixpkgs download so let's do it anyway. * Fix test issue * Use flake.lock * Use flake.lock
1 parent ffdf5b9 commit c683efa

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

default.nix

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
{...}@args:
22

33
let
4+
pins = (__fromJSON (__readFile ./flake.lock)).nodes;
5+
nixpkgsPin = pins.nixpkgs-2205.locked;
6+
flakeCompatPin = pins.flake-compat.locked;
47
nixpkgsSrc =
58
builtins.fetchTarball {
6-
url = "https://github.com/NixOS/nixpkgs/archive/110a2c9ebbf5d4a94486854f18a37a938cfacbbb.tar.gz";
7-
sha256 = "sha256-leWXLchbAbqOlLT6tju631G40SzQWPqaAXQG3zH1Imw=";
9+
url = "https://github.com/NixOS/nixpkgs/archive/${nixpkgsPin.rev}.tar.gz";
10+
sha256 = nixpkgsPin.narHash;
811
};
912
pkgs = args.pkgs or (import nixpkgsSrc {});
1013
flake-compat =
1114
pkgs.fetchzip {
12-
url = "https://github.com/edolstra/flake-compat/archive/5523c47f13259b981c49b26e28499724a5125fd8.tar.gz";
13-
sha256 = "sha256-7IySNHriQjzOZ88DDk6VDPf1GoUaOrOeUdukY62o52o=";
15+
url = "https://github.com/edolstra/flake-compat/archive/{flakeCompatPin.rev}.tar.gz";
16+
sha256 = flakeCompatPin.narHash;
1417
};
1518
self = import flake-compat {
1619
# We bypass flake-compat's rootSrc cleaning by evading its detection of this as a git

flake.lock

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
nixpkgs-2111 = { url = "github:NixOS/nixpkgs/nixpkgs-21.11-darwin"; };
99
nixpkgs-2205 = { url = "github:NixOS/nixpkgs/nixpkgs-22.05-darwin"; };
1010
nixpkgs-unstable = { url = "github:NixOS/nixpkgs/nixpkgs-unstable"; };
11+
flake-compat = { url = "github:hamishmack/flake-compat/hkm/pkgs-fetch"; flake = false; };
1112
flake-utils = { url = "github:numtide/flake-utils"; };
1213
hydra.url = "hydra";
1314
hackage = {

test/tests.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ fi
3939

4040
if [ "$TESTS" == "unit-tests" ] || [ "$TESTS" == "all" ]; then
4141
printf "*** Running the unit tests... " >& 2
42+
# Running nix build first avoids `error: path '/nix/store/X-hackage-to-nix-ghcjs-overlay.drv' is not valid`
43+
nix-build ./default.nix --argstr compiler-nix-name $GHC -A unit.tests
4244
res=$(nix-instantiate --eval --json --strict ./default.nix --argstr compiler-nix-name $GHC -A unit.tests)
4345
num_failed=$(jq length <<< "$res")
4446
if [ $num_failed -eq 0 ]; then

0 commit comments

Comments
 (0)