dev env via flake.nix
This commit is contained in:
parent
9bbe58a274
commit
eac6ffed70
9
Makefile
Normal file
9
Makefile
Normal 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
41
flake.nix
Normal 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
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue