Skip to content

Commit

Permalink
Add a flake.nix (#72)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
Hyperboid authored Jun 26, 2024
1 parent 00ff8b2 commit 098d4ee
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -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}";
};
});
}

0 comments on commit 098d4ee

Please sign in to comment.