-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
151 lines (136 loc) · 4.59 KB
/
flake.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
{
description = "Collection of Nix packages for EPIC experiment at EIC";
inputs.flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
inputs.site-overlay.url = "github:veprbl/empty-overlay-flake";
# define source repositories as flake inputs to enable overrides from CLI
inputs.acts-src = {
url = "github:acts-project/acts/v33.1.0";
flake = false;
};
inputs.algorithms-src = {
url = "github:eic/algorithms/v1.0.0";
flake = false;
};
inputs.dd4hep-src = {
url = "github:AIDASoft/DD4hep/v01-30";
flake = false;
};
inputs.edm4eic-src = {
url = "github:eic/EDM4eic/v8.0.0";
flake = false;
};
inputs.edm4hep-src = {
url = "github:key4hep/EDM4hep/v00-10-05";
flake = false;
};
inputs.epic-src = {
url = "github:eic/epic/24.12.0";
flake = false;
};
inputs.eicrecon-src = {
url = "github:eic/EICrecon/v1.20.0";
flake = false;
};
inputs.geant4-src = {
url = "https://cern.ch/geant4-data/releases/geant4-v11.2.2.tar.gz";
flake = false;
};
inputs.jana2-src = {
url = "github:JeffersonLab/JANA2/v2.3.2";
flake = false;
};
inputs.juggler-src = {
url = "gitlab:EIC/juggler/v14.2.0?host=eicweb.phy.anl.gov";
flake = false;
};
inputs.podio-src = {
url = "github:AIDASoft/podio/v01-01";
flake = false;
};
outputs = { self, nixpkgs, site-overlay, ... }@inputs:
let
inherit (nixpkgs) lib;
supportedSystems = [ "x86_64-linux" "x86_64-darwin" ];
pkgsFor = system: import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
# Will assume that the flake user agrees to use non-free EIC software
config.allowUnfreePredicate = pkg:
(builtins.elem pkg.pname [ "afterburner" "athena" "BeastMagneticField" "eic-smear" "epic" "hepmcmerger" "npdet" "npsim" "osg-ca-certs" "pythia6" ])
|| lib.hasPrefix "ecce-detectors" pkg.pname
|| lib.hasPrefix "fun4all_coresoftware" pkg.pname
|| lib.hasPrefix "fun4all_eicdetectors" pkg.pname
;
};
in
{
overlays.default = lib.composeManyExtensions [
(import ./overlay.nix inputs)
site-overlay.overlays.default
];
packages = lib.genAttrs supportedSystems
(system:
let
pkgs = pkgsFor system;
providedPackageList = builtins.attrNames (self.overlays.default {} {});
is_broken = pkg: (pkg.meta or {}).broken or false;
select_unbroken = lib.filterAttrs (name: pkg: !(is_broken pkg));
in
lib.filterAttrs (name: lib.isDerivation)
(select_unbroken (lib.getAttrs providedPackageList pkgs)));
checks = self.packages;
# Default "development" shell provides all available packages (accessed via "nix develop")
devShells = lib.genAttrs supportedSystems (system:
let
pkgs = pkgsFor system;
includePredicate = attr: pkg:
!(builtins.elem attr [ "athena" "BeastMagneticField" "fun4all" "genfit" "pythia6" "rave" "veccore" "vecgeom" ]);
in
{
default = pkgs.mkShell rec {
buildInputs =
builtins.attrValues (lib.filterAttrs includePredicate self.packages.${system}) ++
(with self.packages.${system}; [
geant4.data.G4EMLOW
geant4.data.G4ENSDFSTATE
geant4.data.G4ENSDFSTATE
geant4.data.G4PARTICLEXS
geant4.data.G4PhotonEvaporation
]);
};
eicrecon-env = pkgs.mkShell rec {
buildInputs = with self.packages.${system}; [
dd4hep
edm4eic
edm4hep
eicrecon
epic
irt
jana2
podio
root
];
shellHook = let
var_name = "${lib.optionalString pkgs.stdenv.isDarwin "DY"}LD_LIBRARY_PATH";
in with self.packages.${system}; ''
export ${var_name}=${"$"}${var_name}:${lib.makeLibraryPath [ podio irt edm4hep edm4eic ]}
'';
};
fun4all-env = pkgs.mkShell rec {
buildInputs = with self.packages.${system}; [
fun4all
root
sartre
geant4.data.G4EMLOW
geant4.data.G4ENSDFSTATE
geant4.data.G4ENSDFSTATE
geant4.data.G4PARTICLEXS
geant4.data.G4PhotonEvaporation
];
};
});
};
}