This repository has been archived by the owner on Oct 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathdefault.nix
76 lines (54 loc) · 2.36 KB
/
default.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
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
{ system ? builtins.currentSystem,
config ? {}
}:
#
# BBP nixpkgs
#
let
##auto config
generic-config = (import ./config/all_config.nix);
#helpers
toPath = builtins.toPath;
getEnv = x: if builtins ? getEnv then builtins.getEnv x else "";
## system
configAll =
let
pathExists = name:
builtins ? pathExists && builtins.pathExists (toPath name);
envConfigFile = getEnv "NIXPKGS_CONFIG";
homeDir = getEnv "HOME";
homeConfigFile = homeDir + "/.nixpkgs/config.nix";
systemConfigFile = "/nix/var/config/config.nix";
envConfig = if envConfigFile != "" && pathExists envConfigFile then import (toPath envConfigFile) else {};
homeConfig = if homeDir != "" && pathExists homeConfigFile then import (toPath homeConfigFile) else {};
systemConfig = if pathExists systemConfigFile then import (toPath systemConfigFile) else {};
configExpr = systemConfig // homeConfig // envConfig;
in
configExpr // { allowUnfree = true; };
## import all config: blue gene override and others
all-config = (import ./bluegene/config.nix) // generic-config // configAll // config ;
## all standard upstream packages
std-pkgs = args: (if builtins.pathExists ./base/default.nix
then (import ./base args)
else builtins.abort
(''
no std nixpkgs found, you did not initialize the std submodule
please run "git submodule update --recursive --init" in your bbp-nixpkgs directory
''));
## proprietary external packages from binaries
proprietary-pkgs = args: (import ./proprietary { pkgs = std-pkgs args; config = all-config; });
## standard packages with generic patches
patch-pkgs = args: (import ./patches { std-pkgs = proprietary-pkgs args; } );
## import BG/Q specific packages
bgq-pkgs = args: (import ./bluegene { pkgs = patch-pkgs args; config = all-config; });
## all the bbp packages
bbp-pkgs = args: (import ./bbp { std-pkgs = bgq-pkgs args; config = all-config; } );
# add the inait packages
inait-pkgs = args: (if ((builtins.pathExists ./inait/proof) == false)
then bbp-pkgs args
else (import (builtins.toPath ./inait) { pkgs = bbp-pkgs args; config = all-config; }));
in
inait-pkgs {
config = all-config;
inherit system;
}