-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathflake.nix
More file actions
65 lines (63 loc) · 1.83 KB
/
flake.nix
File metadata and controls
65 lines (63 loc) · 1.83 KB
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
{
description = "Ferries AER data from inputs to outputs";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
faery =
let
pypkgs = pkgs.python312Packages;
in
pkgs.mkShell {
buildInputs = [
pypkgs.python
pypkgs.venvShellHook
pkgs.autoPatchelfHook
pkgs.bash
pkgs.cargo
pkgs.rustc
pkgs.rustPlatform.bindgenHook
pkgs.libgcc
pkgs.libz
pkgs.nasm
pkgs.nodejs
pkgs.uv
# GUI libraries
pkgs.fontconfig
pkgs.libGL
pkgs.libxkbcommon
pkgs.wayland
];
venvDir = "./.venv";
propagatedBuildInputs = [
pkgs.stdenv.cc.cc.lib
];
postVenvCreation = ''
uv pip install --group dev .
autoPatchelf ./.venv
'';
postShellHook = ''
export AS="nasm" # build assembly optimizations in x264
export CC="gcc" # use gcc to compile x264
export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath [
pkgs.libGL pkgs.libxkbcommon pkgs.wayland pkgs.fontconfig
]}:$LD_LIBRARY_PATH"
source .venv/bin/activate
maturin develop --release
'';
};
in
rec {
devShells = flake-utils.lib.flattenTree {
default = faery;
};
packages = flake-utils.lib.flattenTree {
default = faery;
};
}
);
}