master-thesis/python/flake.nix

56 lines
1.7 KiB
Nix
Raw Normal View History

2021-12-07 17:54:45 +01:00
{
description = "Calculating open system bath energy changes with HOPS and analytically.";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
mach-nix.url = "github:DavHau/mach-nix";
flake-utils.url = "github:numtide/flake-utils";
hopsflow.url = "github:vale981/hopsflow";
2021-12-07 21:09:27 +01:00
hops.url = "git+ssh://git@gitlab.hrz.tu-chemnitz.de/s4498638--tu-dresden.de/hops.git?ref=main";
2021-12-07 17:54:45 +01:00
};
2021-12-07 21:09:27 +01:00
outputs = { self, nixpkgs, flake-utils, mach-nix, hopsflow, hops }:
2021-12-07 17:54:45 +01:00
let
2021-12-07 21:09:27 +01:00
python = "python39";
2021-12-07 17:54:45 +01:00
in flake-utils.lib.eachSystem ["x86_64-linux"] (system:
let
pkgs = nixpkgs.legacyPackages.${system};
2021-12-07 21:09:27 +01:00
mach-nix-wrapper = import mach-nix { inherit pkgs python; };
2021-12-07 17:54:45 +01:00
hopsflowPkg = hopsflow.defaultPackage.${system};
2021-12-07 18:54:53 +01:00
pythonShell = mach-nix-wrapper.mkPython {
2021-12-07 17:54:45 +01:00
requirements = ''
numba
quadpy
idesolver
ptpython
matplotlib
jupyter
qutip
2021-12-07 18:54:53 +01:00
mkl
2021-12-07 21:09:27 +01:00
sqlitedict
'';
packagesExtra = [
hopsflowPkg
hops.defaultPackage.${system}
];
_.jupyter.postInstall = ''
2021-12-07 18:54:53 +01:00
rm $out/lib/python*/site-packages/__pycache__/jupyter.cpython-39.pyc
rm $out/lib/python*/site-packages/jupyter.py
'';
2021-12-07 17:54:45 +01:00
2021-12-07 21:09:27 +01:00
providers.tk = "nixpkgs";
2021-12-07 18:54:53 +01:00
};
2021-12-07 17:54:45 +01:00
in {
2021-12-07 18:54:53 +01:00
devShell = pkgs.mkShell {
2021-12-07 21:09:27 +01:00
buildInputs = with pkgs; [pythonShell sshfs pyright sage];
2021-12-08 10:38:28 +01:00
shellHook = ''
export PYTHONPATH=$PYTHONPATH:$(realpath ./energy_flow_proper)
'';
2021-12-07 18:54:53 +01:00
};
2021-12-07 17:54:45 +01:00
});
}