-
-
Notifications
You must be signed in to change notification settings - Fork 35
/
nixpkgs.nix
29 lines (29 loc) · 1.57 KB
/
nixpkgs.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# If this env var is set, use latest nixpkgs unstable.
# We use that for scheduled builds tracking nixpkgs unstable on CI.
# Of course that is NOT reproducible.
if builtins.getEnv "STATIC_HASKELL_NIX_CI_NIXPKGS_UNSTABLE_BUILD" == "1"
then
let
# You can set e.g. to build with `master`:
# STATIC_HASKELL_NIX_CI_NIXPKGS_UNSTABLE_BUILD=1
# NIXPKGS_URL=https://github.com/NixOS/nixpkgs/archive/master.tar.gz
NIXPKGS_URL_var = builtins.getEnv "NIXPKGS_URL";
nixpkgsUrl =
if NIXPKGS_URL_var != null && NIXPKGS_URL_var != ""
then NIXPKGS_URL_var
else "https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz";
nixpkgs = import (fetchTarball nixpkgsUrl) {};
msg = "Using version ${nixpkgs.lib.version} of nixpkgs-unstable channel.";
in builtins.trace msg nixpkgs
else
# If a `./nixpkgs` submodule exists, use that.
# Note that this will take precedence over setting NIX_PATH!
# We prefer this such that `static-stack2nix-builder` and specifically
# `static-stack2nix-builder-example` can just import `nixpkgs.nix`
# in CI and when called during development to get the right version of
# nixpkgs.
if builtins.pathExists ./nixpkgs/pkgs
then import ./nixpkgs {}
# Pinned nixpkgs version; should be kept up-to-date with our submodule.
# This is nixos-23.11 as of 2024-01-01, with minimal patches currently having open nixpkgs PR (see commits for PR links).
else import (fetchTarball https://github.com/nh2/nixpkgs/archive/ede5282c487a1fd2de64303ba59adad6726f1225.tar.gz) {}