-
Notifications
You must be signed in to change notification settings - Fork 1
/
anysnake2.toml
271 lines (203 loc) · 8.76 KB
/
anysnake2.toml
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# fully featured anysnake2.toml example
# this is fully tofu resolved as well.
[anysnake2]
rev = "dev" # pre 2.0 - 2.0+ uses url2
url = "github:TyberiusPrime/anysnake2_release_flakes" # pre 2.0 - 2.0+ uses url2
# We leverage nix flakes to run exactly that version.
# rev = "dev" = do not switch to fixed version, used in development.
url2 = "dev" # replace with fixed version outside of tests/examples.
# leave off to auto detect the newest version
# looks like this TOFU
# url = "github:TyberiusPrime/anysnake2/main/1.15.5"
# You can leave this off initially, it will be filled with the newest version
use_binary = false # default, optional, switches the default url. Ignored if url = is set.
# The rev must be a tag or sha-hash from the following configured url.
# url = "https://github.com/TyberiusPrime/anysnake2_release_flakes" # if you want to override this.
# (if use_binary is false, the default is https://github.com/TyberiusPrime/anysnake2),
# and there will be a rust build step involved.
# do_not_modify_flake = true # if set to true,
# flake/flake.nix is never overwritten,
# but stored in flake/flake.generated.nix.
# And nix build is called every run
# This is an escape hatch.
# the nixpkgs used to run singularity and nixfmt
[nixpkgs]
allow_unfree = true # set to true to allow unfree packages from nixpkgs
packages = [
"fish",
"gnumake",
"gnused",
"netcat",
"varscan"]
url = "github:NixOS/nixpkgs/master/24.05"
[clones.code] # target directory
# Unlike python.package.<xyz>.editable = true/folder
# these just get cloned into the target directory (once).
# if you change the rev here and have an already existing checkout
# anysnake2 will abort
fpick= "git+https://github.com//TyberiusPrime/fpick?ref=main&rev=0ddd3756be8a603ae05cabc1b001ebe01e3c38a0"
[clone_regexps]
# to make cloning internal repositories etc easier,
# we support regexs to replace URLs *in the clones only*
"@gh/([^/]+/[^/]+)"="git+https://github.com/$2/$1"
[python] # python section is optional
ecosystem_date = "2024-08-09"
version="3.12" # does not go down to 3.8.x. That's implicit in the nixpkgs (for now)
[python.packages]
#cffi = "pypi:1.15.1"
# The source definition is fairly flexible and follows the url definitions for nix flakes
# see https://nix.dev/manual/nix/2.18/command-ref/new-cli/nix3-flake.html#flake-references
dppd = {editable = true, url= "github:TyberiusPrime/dppd/master/d16b71a43b731fcf0c0e7e1c50dfcc80d997b7d7", poetry2nix.nativeBuildInputs=['setuptools']}
# mercurial example
lvr = {url= "hg+https://hg.sr.ht/~bwe/lvr?rev=db6f0a3254fbd3939d6b6b8c6d1711e7129faba1", poetry2nix.nativeBuildInputs=['setuptools']}
# so we have something that has an 'entrypoint'
pypipegraph = {editable = "hackonme", url= "github:TyberiusPrime/pypipegraph/master/1430704960b069ba25de30210059dcaf374d4ae7", poetry2nix.nativeBuildInputs=['setuptools'] } # editable may be a folder!
# you can use version specifiers from https://www.python.org/dev/peps/pep-0440/#id53
pypipegraph2=">2.0"
# You can circumvent the ecosystem date restriction from above
# by manually specifying a fixed pypi version
scanpy = "pypi:1.9.6"
scipy=""
#sometimes you just need to supply a nativeBuildInput to get poetry2nix working, but do not want to specify the version
session-info = {poetry2nix.nativeBuildInputs=['setuptools']}
# or for C dependencies
# packages that depend on otehr packages from this list should 'just work'.
testrepo={url = "github:TyberiusPrime/_anysnake2_test_repo/main/97d57e17c1bd4a5f547fa1c1be57c2f0a1d2ec6f", poetry2nix.nativeBuildInputs=['setuptools']}
testrepo2={url = "github:TyberiusPrime/_anysnake2_test_repo2/main/a42420f8ba0a6bc9bda0425cd665515fb92dc2b4", poetry2nix.nativeBuildInputs=['setuptools']}
[python.packages.plotnine]
poetry2nix.env.postInstall = """
touch $out/lib/python3.12/site-packages/plotnine/post_install_worked
"""
# and this is how you patch it after poetry's dependency resolution
# but before it's actually being ubuld
poetry2nix.env.postPatch = """
substituteInPlace setup.py --replace-fail "version=versioneer.get_version()," "version='0.8.0'," \
--replace-fail "cmdclass=versioneer.get_cmdclass()," ""
"""
# escape hatch for packages that just can't define their version number from the checked out
# path. ( We copy the package to the nix store, then supply poetry with a writeable version
# for it to figure out the package version number. Some packages that's not enough)
# this get's passed to bash. With set -xoeu pipefail
pre_poetry_patch = """
sed -i 's/git_refnames = ""/git_refnames = " (tag: v0.8.0)"/' plotnine/_version.py
"""
url = "github:has2k1/plotnine/main/6c82cdc20d6f81c96772da73fc07a672a0a0a6ef"
[R] # R section is optional
date = "2024-05-10"
# the date definies the R version, bioconductor version and R packages you get.
packages = [
"ACA",
"Rcpp"
]
url = "github:TyberiusPrime/nixR/main/bbfed71d90b2967f2226dd1cdb11b9060a5bef24"
# you can apply overrideAttrs to
# individual R packages, for those times you really really need to patch 'em
# see https://nixos.org/manual/nixpkgs/stable/#sec-pkg-overrideAttrs
# they take a function just like the example below
[R.override_attrs]
ACA = '''
old: {
postInstall = ''
echo "Yes" >$out/library/ACA/override_in_place
'';
}
'''
[rust]
url = "github:oxalica/rust-overlay/master/fecfe4d7c96fea2982c7907997b387a6b52c1093"
# version/rust section is optional. leave of for no rust
version = "1.55.0" # =stable.
# default packages is ["defaultPackage.x86_64-linux"],
# in which case you can ommit this entry
# packages = ["defaultPackage.x86_64-linux"]
[flakes.STAR]
dir = "STAR" # changed from anysnake < 2.0
rev = "8d50ea4a3e1a1e69ba9f7c1981913e4862ab49ef"
url = "github:IMTMarburg/flakes/main/356700f69497e12371aab6fe529d276893aaaf16"
# You can pull in arbitrary packages from arbitrary flakes
[flakes.hello]
# relative paths are tricky:
# you can use an url like $ANYSNAKE2_ROOT/path/to/flake for local flakes
# $ANYSNAKE2_ROOT will be replaced by abspath('anysnake2.toml') (or whatever your config file is)
follows = ["nixpkgs"] # so we overwrite the flakes dependencies
rev = "f32e7e451e9463667f6a1ddb7a662ec70d35144b" # flakes.lock tends to update unexpectedly, so we tie it down here
url = "github:TyberiusPrime/hello_flake/main/f32e7e451e9463667f6a1ddb7a662ec70d35144b"
#i to use nightly, add to nipkgs.packages 'rust-bin.nightly."2020-01-01".default'
[container]
#home = "$HOME/singularity_home/$USER" # where to locate the singularity home. Defaults to $HOME
dtach = true # whether to run your container wrapped in dtach https://github.com/crigler/dtach
[container.volumes_ro]
"/opt" = "/opt"
[container.volumes_rw]
# #home get's special treatment, container section
"." = "/project"
# if you want to give the singularity container access to docker
# note that that's essentially root access
# "/var/run/docker.sock" = "/var/run/docker.sock"
[env]
MBF_EXTERNAL_HOSTNAME = "${NICE_HOSTNAME}"
# define enviromental variables
MBF_EXTERNAL_PREBUILD_PATH="/machine/ffs/prebuild/externals/"
# Commands are optional and let you define predefined
# scripts to run.
[cmd.default]
# the post_run runs even if the run failed
post_run_inside = """
echo "post run inside - status was $ANYSNAKE_RUN_STATUS"
"""
# runs independend of the sucess inside (same as post_run_inside)
post_run_outside = """
echo 'post run outside'
"""
# if this fails, execution stops without starting the container
pre_run_outside = """
echo "pre run outside"
"""
# run happens inside the container
run = """
echo 'run_inside'
set -x # show what we're executing
cd /project
echo 'pythonpath $PYTHONPATH'
python run.py
hello
no_such-command
"""
# this runs *while* the singularity process is running,
# and get's killed() when the singularity process finishes
while_run_outside ="""
while :
do
# usage idea: snapshot zfs at regular intervals
sleep 100;
done
"""
[cmd.jupyter]
run = """
jupyter
"""
[cmd.shell]
run = """fish
"""
# network ports are exposed by default (using host network!)
[cmd.test_R]
run = """
R -e "library(ACA); library(Rcpp); print(sessionInfo())"
"""
[cmd.test_rpy2]
run = """
python -c "import rpy2.robjects as ro; print(ro.r('.libPaths()')); ro.r('library(ACA);'); ro.r('library(Rcpp);'); print(ro.r('sessionInfo()'))"
"""
[dev_shell] # optional
inputs = [ # optional
# these are packages that show up only when you do 'nix develop'
"rust-analyzer"
]
shell = "fish" # optional
[outside_nixpkgs]
url = "github:NixOS/nixpkgs/master/24.05"
[ancient_poetry]
url = "git+https://codeberg.org/TyberiusPrime/ancient-poetry.git?ref=main&rev=54a06abec3273f42f9d86a36f184dbb3089cd9c9"
[poetry2nix]
url = "github:nix-community/poetry2nix/master/cc0af1948e0887cd280496bd891fd40e52b40ff4"
[flake-util]
url = "github:numtide/flake-utils/main/b1d9ab70662946ef0850d488da1c9019f3a9752a"