-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
98 lines (95 loc) · 3.44 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
{
inputs = {
# dream2nix.url = "github:nix-community/dream2nix";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgs_master.url = "github:NixOS/nixpkgs/master";
systems.url = "github:nix-systems/default";
flake-utils.url = "github:numtide/flake-utils";
flake-utils.inputs.systems.follows = "systems";
cp-flake.url = "github:leoank/CellProfiler/refactor/nix";
cp-flake.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, flake-utils, systems, ... } @ inputs:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
system = system;
config.allowUnfree = true;
};
# mpkgs = import inputs.nixpkgs_master {
# system = system;
# config.allowUnfree = true;
# };
in
with pkgs;
rec {
packages = import ./nix {inherit pkgs;};
apps = {
cellprofiler = {
type = "app";
program = "${packages.cellprofiler-nightly}/bin/cellprofiler";
};
};
devShells = {
default = let
python_with_pkgs = (pkgs.python311.withPackages(pp: [
inputs.cp-flake.packages.${system}.cellprofiler
inputs.cp-flake.packages.${system}.cellprofiler-core
inputs.cp-flake.packages.${system}.cellprofiler-library
pp.mysqlclient
pp.packaging
pp.snakemake
pp.snakemake-storage-plugin-s3
]));
in mkShell {
NIX_LD = runCommand "ld.so" {} ''
ln -s "$(cat '${pkgs.stdenv.cc}/nix-support/dynamic-linker')" $out
'';
NIX_LD_LIBRARY_PATH = lib.makeLibraryPath [
# Add needed packages here
stdenv.cc.cc
libGL
libxcrypt-legacy
libmysqlclient
mariadb
glib
hdf5
];
packages = [
python_with_pkgs
python3Packages.venvShellHook
git
gtk3
glib
pkg-config
uv
jdk
maven
libmysqlclient
mariadb
duckdb
hdf5
# nodejs deps
nodejs_22
gocryptfs
goofys
nextflow
];
venvDir = "./.venv";
postVenvCreation = ''
unset SOURCE_DATE_EPOCH
'';
postShellHook = ''
unset SOURCE_DATE_EPOCH
'';
shellHook = ''
export LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH
export PYTHON_KEYRING_BACKEND=keyring.backends.fail.Keyring
runHook venvShellHook
export PYTHONPATH=${python_with_pkgs}/${python_with_pkgs.sitePackages}:$PYTHONPATH
'';
};
};
}
);
}