-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfreecad-cfd-unstable.nix
57 lines (49 loc) · 1.57 KB
/
freecad-cfd-unstable.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
# freecad.nix
let
# unstable
nixpkgs_ball = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/master";
nixgl_ball = fetchTarball "https://github.com/nix-community/nixGL/archive/main.tar.gz";
# import the packages
nixgl = import nixgl_ball {};
pkgs = import nixpkgs_ball {
config = {
allowUnfree = true;
};
overlays = [ ];
};
custompkgs = import ./custompkgs { pkgs = pkgs; };
openfoam = custompkgs.openfoam-2306;
cfmesh = custompkgs.cfmesh-cfdof-unstable.override { openfoam = openfoam; };
hisa = custompkgs.hisa-unstable.override { openfoam = openfoam; };
in
pkgs.mkShell {
buildInputs = [
pkgs.python3
pkgs.git
pkgs.curl
nixgl.nixGLIntel # Mesa OpenGL implementation (intel, amd, nouveau, ...).
pkgs.freecad
pkgs.calculix
pkgs.elmerfem
pkgs.gmsh
# pkgs.paraview # not necessary as carried by openfoam
openfoam
cfmesh
hisa
];
# What the hook does:
# add nixGL dynamic libs to LD_LIBRARY_PATH
# add hisa dynamic libs to LD_LIBRARY_PATH
# set FreeCAD storage locations
# some shorthands for shell access
# load OpenFOAM environment
shellHook = ''
export LD_LIBRARY_PATH=$(nixGLIntel printenv LD_LIBRARY_PATH):$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${hisa}/lib:$LD_LIBRARY_PATH
export FREECAD_USER_HOME=$(pwd)/freecad-state/home
export FREECAD_USER_DATA=$(pwd)/freecad-state/userdata
export FREECAD_USER_TEMP=$(pwd)/freecad-state/temp
alias freecad='nixGLIntel freecad'
source ${openfoam}/opt/OpenFOAM/OpenFOAM-v${openfoam.version}/etc/bashrc || true
'';
}