-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
68 lines (63 loc) · 2.14 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
#
# Nix flake for the 4DGB Browser
#
# This provides a development environment with
# necessary dependencies installed and exports several packages
# related to running the browser and preparing data.
#
# The development environment provides:
# - python3 with required packages installed
# - NodeJS and a NODE_PATH set to a node_modules folder
# with required packages installed
# - Other tools (node2nix, just, etc)
#
# The packages exported by this flake include:
# - db_pop: Executable of the db_pop script
# - gtk-js: Minified GTK Javascript library
# - gtkserver: Executable of GTK Flask server
#
# (The GTK client python library is currently not included)
#
# NOTE:
# NodeJS dependencies are generated using node2nix. If you make any changes
# to the package.json file, you need to run node2nix again to re-create the
# necessary files. A recipe is included to do this. Just run
# 'just rebuild-node2nix`
# to rebuild the node2nix files, then exit and re-enter the development
# shell.
#
# Also, webpack is available in the development environment, but it doesn't
# work without an actual ./node_modules directory. After entering the development
# environment, you should create a symlink to it by running:
# 'ln -s $NODE_PATH ./node_modules'
# Just remember to remove it when you're done!
#
{
description = "4D Genome Browser";
inputs = {
# Nixpkgs
nixpkgs.url = "github:NixOS/nixpkgs/release-22.05";
# Flake-compat library
# (Used to generate a flake-less nix.shell file)
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
# Flake-utils library
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-compat, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
myPkgs = import ./pkgs.nix { inherit pkgs; };
in
rec {
# Export packages
packages = { inherit (myPkgs) gtkserver db_pop gtk-js; };
defaultPackage = packages.gtkserver;
# Development environment
devShell = myPkgs.devShell;
}
);
}