Skip to content

Commit

Permalink
Detect HerculesCI, make our nixpkgs version easily available
Browse files Browse the repository at this point in the history
  • Loading branch information
nh2 committed Aug 17, 2019
1 parent eb48d1e commit a23b9ec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Note: This is just a minimal example. For proper usage, see the README.

{ nixpkgs ? (import <nixpkgs> {}).pkgsMusl, compiler ? "ghc864", strip ? true }:
{ nixpkgs ? (import ./nixpkgs.nix).pkgsMusl, compiler ? "ghc864", strip ? true }:


let
Expand Down
10 changes: 10 additions & 0 deletions nixpkgs.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Detect HerculesCI by checking if NIX_PATH is empty.
# See https://docs.hercules-ci.com/hercules-ci/getting-started/repository/
# If it's empty, we give our custom nixpkgs version;
# otherwise we use what the user has set with NIX_PATH.
if builtins.getEnv "NIX_PATH" == ""
then
builtins.trace "NIX_PATH is not set, we're probably in HerculesCI"
(import (fetchTarball https://github.com/nh2/nixpkgs/archive/a2d7e9b875e8ba7fd15b989cf2d80be4e183dc72.tar.gz) {})
else
import <nixpkgs> {}

0 comments on commit a23b9ec

Please sign in to comment.