-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
116 lines (102 loc) · 2.66 KB
/
flake.nix
File metadata and controls
116 lines (102 loc) · 2.66 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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
flake-utils,
fenix,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
fenix.overlays.default
(import ./nix/overlays)
];
};
rust-toolchain = pkgs.fenix.complete;
libraries = with pkgs; [
webkitgtk_4_1
libsoup_3
gtk3
cairo
gdk-pixbuf
glib
dbus
openssl
librsvg
libayatana-appindicator
(opencv.override (old: {
enableGtk3 = true;
enableFfmpeg = true;
}))
llvmPackages.libclang.lib
];
buildInputs = libraries ++ (with pkgs; [
just
# Tauri
nodejs
nodejs.pkgs.pnpm
(with rust-toolchain; [
cargo
rustc
rust-src
clippy
rustfmt
])
curl
wget
(with llvmPackages; [
llvm
libclang.lib
clang
])
pkg-config
# Algorithm impl in CXX
xmake
cmake
# OpenCV algorithm test
(python3.withPackages (ps:
with ps; [
hy
numpy
(opencv4.override {enableGtk2 = true;})
]))
]);
in rec {
# Executed by `nix build`
packages = rec {
stickerbucket = pkgs.callPackage ./stickerbucket.nix {
inherit libraries;
};
default = stickerbucket;
};
# Executed by `nix run`
apps = rec {
stickerbucket = {
type = "app";
program = "${packages.default}/bin/stickerbucket";
};
default = stickerbucket;
};
devShell = pkgs.mkShell {
inherit buildInputs;
shellHook = ''
export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath libraries}:$LD_LIBRARY_PATH
export XDG_DATA_DIRS=${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}:$XDG_DATA_DIRS
'';
WEBKIT_DISABLE_COMPOSITING_MODE = "1";
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
# Specify the rust-src path (many editors rely on this)
RUST_SRC_PATH = "${rust-toolchain.rust-src}/lib/rustlib/src/rust/library";
};
formatter = nixpkgs.legacyPackages.${system}.alejandra;
});
}