Skip to content

Instantly share code, notes, and snippets.

@MatteoJoliveau
Created September 26, 2022 17:01
Show Gist options
  • Save MatteoJoliveau/54086686f35d6e771d7e475e3b1230a3 to your computer and use it in GitHub Desktop.
Save MatteoJoliveau/54086686f35d6e771d7e475e3b1230a3 to your computer and use it in GitHub Desktop.
Nix shell for Tauri projects
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
libraries = with pkgs;[
webkitgtk
gtk3
cairo
gdk-pixbuf
glib.out
dbus.lib
openssl.out
];
packages = with pkgs; [
pkg-config
dbus
openssl
glib
gtk3
libsoup
webkitgtk
appimagekit
];
in
{
devShell = pkgs.mkShell {
buildInputs = packages;
shellHook =
let
joinLibs = libs: builtins.concatStringsSep ":" (builtins.map (x: "${x}/lib") libs);
libs = joinLibs libraries;
in
''
export LD_LIBRARY_PATH=${libs}:$LD_LIBRARY_PATH
'';
};
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment