-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.nix
More file actions
92 lines (73 loc) · 2.81 KB
/
common.nix
File metadata and controls
92 lines (73 loc) · 2.81 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
{ nixpkgs ? null
#------------------------------------------------------------------------------
# Optional arguments to the nix-shell
#------------------------------------------------------------------------------
# CAUTION! a spelling mistake in an arg string is ignored silently.
# We use the default compiler so that upon changing the nixpkgs channel we do
# not have to recompile the packages.
# To use a specific ghc version: nix-shell --argstr compiler "ghc966"
, compiler ? "default"
# To disable hoogle search engine database: nix-shell --arg hoogle false
, installHoogle ? false
}:
let
#------------------------------------------------------------------------------
# nixpksg configuration
#------------------------------------------------------------------------------
# IMPORTANT: if you change the commits, change in flake.nix as well.
# see https://channels.nixos.org/nixos-unstable/git-revision
nixpkgsRev = "6c9a78c09ff4d6c21d0319114873508a6ec01655"; # nixos-unstable
nixpkgsDarwinRev = "6c9a78c09ff4d6c21d0319114873508a6ec01655"; # nixos-unstable
nixpkgsOptions =
{
config.allowUnfree = true; # Allow unfree packages for some vscode extensions
config.allowBroken = true;
};
#------------------------------------------------------------------------------
# nixpack configuration
#------------------------------------------------------------------------------
packName = "nixpack-composewell-open";
packOptions =
{ inherit compiler;
inherit installHoogle;
#installDocs = true;
};
# https://github.com/composewell/nixpack repository revision.
nixpackRev = "f50a0b2aaaab434f46847bc171240957b508b901";
#------------------------------------------------------------------------------
# Anything after this is usually not to be changed
#------------------------------------------------------------------------------
isDarwin = builtins.match ".*darwin.*" builtins.currentSystem != null;
nixpkgsRev1 =
let rev = if isDarwin then nixpkgsDarwinRev else nixpkgsRev;
in builtins.trace "Using nixpkgs rev: ${rev}" rev;
nixpackRev1 = builtins.trace "Using nixpack rev: ${nixpackRev}" nixpackRev;
nixpkgsOrig =
if nixpkgs != null
then nixpkgs
else
import
(
builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/${nixpkgsRev1}.tar.gz";
}
) nixpkgsOptions;
basepkgs =
let
src =
builtins.fetchTarball {
url = "https://github.com/composewell/nixpack/archive/${nixpackRev1}.tar.gz";
};
in import src;
nixpkgs1 = nixpkgsOrig.extend (self: super: {
# XXX we may not need this if we are passing basepkgs everywhere
nixpack = basepkgs.nixpack;
});
in
basepkgs.nixpack.mkEnv
{ nixpkgs = nixpkgs1;
inherit basepkgs;
name = packName;
sources = import ./sources.nix;
packages = import ./packages.nix;
} // packOptions