From 098d4ee67bbea13e9e3c72ec3d2576f01b9a8830 Mon Sep 17 00:00:00 2001 From: polypoyo <23138363+polypoyo@users.noreply.github.com> Date: Wed, 26 Jun 2024 15:29:44 -0400 Subject: [PATCH] Add a `flake.nix` (#72) This will make it far easier to get started with eframe/egui. Simply running the following command will (hopefully) set up a working environment: `nix --experimental-features 'nix-command flakes' develop` (if Nix is installed) --- flake.nix | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 flake.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..49cebbe1 --- /dev/null +++ b/flake.nix @@ -0,0 +1,45 @@ +{ + description = "eframe devShell"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + rust-overlay.url = "github:oxalica/rust-overlay"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem (system: + let + overlays = [ (import rust-overlay) ]; + pkgs = import nixpkgs { inherit system overlays; }; + in with pkgs; { + devShells.default = mkShell rec { + buildInputs = [ + # Rust + rust-bin.stable.latest.default + trunk + + # misc. libraries + openssl + pkgconfig + + # GUI libs + libxkbcommon + libGL + fontconfig + + # wayland libraries + wayland + + # x11 libraries + xorg.libXcursor + xorg.libXrandr + xorg.libXi + xorg.libX11 + + ]; + + LD_LIBRARY_PATH = "${lib.makeLibraryPath buildInputs}"; + }; + }); +}