summaryrefslogtreecommitdiff
path: root/shell.nix
blob: 7e1ba4c9f610a7e82fc9b2a4f086b3e745df31b8 (plain)
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
{ pkgs ? import <nixpkgs> {} }:
let
  install_opt_deps = false;
  libraries = with pkgs; [
    webkitgtk_4_1
    gtk3
    cairo
    gdk-pixbuf
    glib
    dbus
    openssl
    librsvg
  ];
in
pkgs.mkShell {
  packages = with pkgs; [
    gcc
    glib.dev
    pango
    openssl
    pkg-config
    clang-tools
    gnumake
  ] ++ (if install_opt_deps then [
    dbus
    gtk3
    libsoup_3
    webkitgtk_4_1
    librsvg
    nodejs_22
    pnpm
    cargo
    rustc
    rustup
  ] else []);
  RUST_SRC_PATH = if install_opt_deps then "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}" else '''';
  shellHook = if install_opt_deps then ''
    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
  '' else '''';
}