-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
73 lines (67 loc) · 2.15 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-24.05";
flake-utils.url = "github:numtide/flake-utils";
cargo-tauri-src = {
url = "github:tauri-apps/tauri?ref=tauri-v2.0.0-beta.22";
flake = false;
};
};
outputs = { self, nixpkgs, flake-utils, cargo-tauri-src, }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
# Building cargo-tauri manually since v^2 isn't available on nixpkgs
cargo-tauri = pkgs.rustPlatform.buildRustPackage rec {
pname = "cargo-tauri";
version = "2.0.0-beta.22";
src = cargo-tauri-src;
sourceRoot = "source/tooling/cli";
cargoHash = "sha256-JIpQCVxK7+NMCP4rzlynA5yly1Eib9L6cIx8Q7vP7y8=";
buildInputs = [ pkgs.openssl ] ++ pkgs.lib.optionals pkgs.stdenv.isLinux (with pkgs;
[ glibc libsoup cairo gtk3 webkitgtk ])
++ pkgs.lib.optionals pkgs.stdenv.isDarwin (with pkgs.darwin.apple_sdk.frameworks;
[ CoreServices Security SystemConfiguration ]);
nativeBuildInputs = [ pkgs.pkg-config ];
};
libraries = with pkgs;[
webkitgtk_4_1
gtk3
cairo
gdk-pixbuf
glib
dbus
openssl_3
librsvg
libsoup
libsoup_3
];
packages = with pkgs; [
curl
trunk
wget
pkg-config
dbus
openssl_3
glib
gtk3
libsoup
webkitgtk_4_1
librsvg
rustup
cargo-tauri
trunk # serve web front without running a window
hexyl # pretty hex viewer
];
in
{
devShell = pkgs.mkShell {
buildInputs = packages;
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
'';
};
});
}