dev env via flake.nix

This commit is contained in:
Henri Bourcereau 2022-12-09 21:19:18 +01:00
parent 9bbe58a274
commit eac6ffed70
2 changed files with 50 additions and 0 deletions

9
Makefile Normal file
View file

@ -0,0 +1,9 @@
shell:
# devenv shell
nix develop
startserver:
cargo run --bin=server
startclient1:
cargo run --bin=client Titi
startclient2:
cargo run --bin=client Tutu

41
flake.nix Normal file
View file

@ -0,0 +1,41 @@
{
description = "Trictrac";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
# let pkgs = nixpkgs.legacyPackages.${system}; in
let pkgs = import nixpkgs {
inherit system;
config = { allowUnfree = true; };
}; in
{
# devShell = import ./shell.nix { inherit pkgs; };
devShell = with pkgs; mkShell rec {
nativeBuildInputs = [
pkg-config
llvmPackages.bintools # To use lld linker
];
buildInputs = [
cargo rustc rustfmt rustPackages.clippy # rust
# pre-commit
alsa-lib udev
vulkan-loader # needed for GPU acceleration
xlibsWrapper xorg.libXcursor xorg.libXrandr xorg.libXi # To use x11 feature
# libxkbcommon wayland # To use wayland feature
];
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
shellHook = ''
export HOST=127.0.0.1
export PORT=7000
'';
};
}
);
}