-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
92 lines (87 loc) · 2.62 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
{
description = "Flake for making and developing volumetric videos";
# Flake inputs
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs"; # also valid: "nixpkgs"
utils.url = "github:numtide/flake-utils";
};
# Flake outputs
outputs = { self, nixpkgs, utils }:
utils.lib.eachSystem [
"x86_64-linux" # 64-bit Intel/AMD Linux
"aarch64-linux" # 64-bit ARM Linux
# "x86_64-darwin" # 64-bit Intel macOS
# "aarch64-darwin" # 64-bit ARM macOS
] (system:
let
# Helper to provide system-specific attributes
pkgs = nixpkgs.legacyPackages.${system};
in
{
# Development environment output
devShells.default =
# let
# python = pkgs.python310;
# in
pkgs.mkShell {
# The Nix packages provided in the environment
packages = with pkgs; [
lldb
clang-tools
openvdb
boost
tbb
blender
fish
nodejs
nodePackages.vscode-langservers-extracted
nodePackages.typescript-language-server
inotify-tools
fiji
# (python.withPackages (ps: with ps; [
# virtualenv
# pip
# python-lsp-server
# ]))
];
shellHook = ''
exec fish
'';
};
packages.vdb2raw =
let
binName = "combiner";
cppDependencies = with pkgs; [ gcc openvdb tbb boost ];
in
pkgs.stdenv.mkDerivation {
name = "combiner";
src = self;
buildInputs = cppDependencies;
buildPhase = "c++ -std=c++17 -o ${binName} ${./main.cpp} -lboost_system -lopenvdb -ltbb";
installPhase = ''
mkdir -p $out/bin
cp ${binName} $out/bin/
'';
};
packages.default = pkgs.stdenv.mkDerivation {
name = "make-video";
src = ./.;
nativeBuildInputs = [
pkgs.makeBinaryWrapper
];
buildInputs = with pkgs; [
blender
nodejs
self.packages.${system}.vdb2raw
];
installPhase = ''
mkdir -p $out/bin
cp blender_scene2vdb.py $out/bin
cp raw2bvp.js $out/bin
cp make-video $out/bin
wrapProgram $out/bin/make-video \
--prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.blender pkgs.nodejs self.packages.${system}.vdb2raw ]}
'';
};
});
}