-
Notifications
You must be signed in to change notification settings - Fork 529
/
flake.nix
80 lines (75 loc) · 2.47 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
unstablePkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
nix-playwright-browsers.url = "github:voidus/nix-playwright-browsers";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "unstablePkgs";
};
};
};
outputs = { self, unstablePkgs, nixpkgs, flake-utils, rust-overlay, nix-playwright-browsers }:
flake-utils.lib.eachDefaultSystem
(system:
let
overlays = [ (import rust-overlay) ];
unstable = import unstablePkgs {
inherit system overlays;
};
pkgs = import nixpkgs {
system = system;
overlays = [ nix-playwright-browsers.overlays.${system}.default];
};
rustToolchain = unstable.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
common = with pkgs; [
gtk3
glib
glib-networking
dbus
openssl_3
librsvg
gettext
libiconv
libsoup
libsoup_3
webkitgtk
webkitgtk_4_1
nodejs_20
corepack_20
pkgs.playwright-browsers_v1_47_0
];
# runtime Deps
libraries = with pkgs; [
cairo
pango
harfbuzz
gdk-pixbuf
] ++ common;
# compile-time deps
packages = with pkgs; [
curl
wget
pkg-config
rustToolchain
] ++ common;
in
{
devShells.default = pkgs.mkShell {
nativeBuildInputs = packages;
buildInputs = libraries;
shellHook = ''
LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath libraries}:$LD_LIBRARY_PATH
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
GIO_MODULE_DIR=${pkgs.glib-networking.out}/lib/gio/modules/
GIO_EXTRA_MODULES=${pkgs.glib-networking.out}/lib/gio/modules/
PLAYWRIGHT_BROWSERS_PATH=${pkgs.playwright-browsers_v1_47_0}
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true
'';
};
}
);
}