The option of creating package definitions for each db (or single package with
multiple outputs?) seems most guix-like but i'm unclear about how metaphlan
could easily find the data installed by other guix packages?
Okay, then I think search paths are actually prefered - the user can choose
what database to install. Does the variable support multiple database
directories, like by splitting with :? If so, then that's perfect, if not, it
is a bit worse, you will need to set separator of search-path-specification to
#f and only one profile will be supported, ie. If someone installs the
metaphlan and databases A, B, then invoking shell with metaphlan and database C
will leave you with dayabase C only instead of A, B and C.
following your suggestions, i've added both a wrapper and search-path to
test and looks like it's working fine.
this seems to be the simplest way i've found to wrap the program ->
(arguments
(list
#:phases
#~(modify-phases %standard-phases
(add-after 'check 'wrap-program
(lambda* _
;; set database directory to a writeable location
(wrap-program
(string-append #$output "/bin/metaphlan")
'("METAPHLAN_DB_DIR" =
("/var/lib/metaphlan/metaphlan_databases/"))))))))
and this for shared search paths ->
(search-paths
(list (search-path-specification
(variable "METAPHLAN_DB_DIR")
(separator #f)
(files (list "/var/lib/metaphlan/metaphlan_databases/")))))
I'm assuming it's possible to create symlinks from the database package
output to /var/lib/ but wondering if there is a way to ensure the
permissions are correct? is /var/lib a reasonable choice for shared data
on a guix system?
Since each run can only use a single database (but many simultaneous
runs can use the same database) one db per package and explicitly
including it in shell or profile could be seen as an advantage.
nik