george-emu/flake.nix

63 lines
1.7 KiB
Nix

{
inputs = {
naersk.url = "github:nmattia/naersk/master";
# This must be the stable nixpkgs if you're running the app on a
# stable NixOS install. Mixing EGL library versions doesn't work.
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils";
flake-compat = {
url = github:edolstra/flake-compat;
flake = false;
};
};
outputs = { self, nixpkgs, utils, naersk, ... }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
naersk-lib = pkgs.callPackage naersk { };
libPath = with pkgs; lib.makeLibraryPath [
libxkbcommon
wayland
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
];
in
{
defaultPackage = naersk-lib.buildPackage {
src = ./.;
doCheck = true;
pname = "georgeemu";
nativeBuildInputs = [ pkgs.makeWrapper ];
buildInputs = with pkgs; [
xorg.libxcb
];
postInstall = ''
wrapProgram "$out/bin/georgeemu" --prefix LD_LIBRARY_PATH : "${libPath}"
'';
};
defaultApp = utils.lib.mkApp {
drv = self.defaultPackage."${system}";
};
devShell = with pkgs; mkShell {
buildInputs = [
cargo
cargo-insta
pre-commit
rust-analyzer
rustPackages.clippy
rustc
rustfmt
xorg.libxcb
];
RUST_SRC_PATH = rustPlatform.rustLibSrc;
LD_LIBRARY_PATH = libPath;
};
});
}