Skip to content

Commit

Permalink
nix: Add development shell
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldk committed Nov 18, 2020
1 parent 42f6ac1 commit 859d622
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 0 deletions.
43 changes: 43 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
description = "SyntaxDot sequence labeler";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, utils }:
utils.lib.eachSystem [ "x86_64-linux" ] (system:
let
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfreePredicate = pkg: builtins.elem (pkgs.lib.getName pkg) [
"libtorch"
"nvidia-x11"
];
cudaSupport = true;
};
};
in {
devShell = import ./shell.nix { inherit pkgs; };
});
}
19 changes: 19 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{ pkgs ? import <nixpkgs> {} }:

with pkgs;

mkShell {
nativeBuildInputs = [ cmake pkg-config rustup ];

buildInputs = [ openssl ];

HDF5_DIR = symlinkJoin {
name = "hdf5-join";
paths = [ hdf5.dev hdf5.out ];
};

LIBTORCH = symlinkJoin {
name = "torch-join";
paths = [ libtorch-bin.dev libtorch-bin.out ];
};
}

0 comments on commit 859d622

Please sign in to comment.