From 745a2fc9b57e5633ba283b91de92a6ea2aaf72f3 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Wed, 7 Feb 2024 00:52:42 +0300 Subject: [PATCH] Flake : Add template for Rust. --- .config/linux/flake/template/rust.nix | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .config/linux/flake/template/rust.nix diff --git a/.config/linux/flake/template/rust.nix b/.config/linux/flake/template/rust.nix new file mode 100644 index 0000000..cb554cf --- /dev/null +++ b/.config/linux/flake/template/rust.nix @@ -0,0 +1,38 @@ +{ + description = "Rust shell env."; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + + outputs = { self, nixpkgs } @inputs: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + lib = pkgs.lib; + in { + devShell.${system} = pkgs.mkShell rec { + nativeBuildInputs = with pkgs; [ + cargo + rustc + rust-analyzer + rustfmt + + cmake + pkg-config + fontconfig + ]; + buildInputs = with pkgs; [ + libxkbcommon + wayland + libGL + xorg.libX11 + xorg.libXrandr + xorg.libXinerama + xorg.libXcursor + xorg.libXi + ]; + LD_LIBRARY_PATH = "${lib.makeLibraryPath buildInputs}"; + }; + }; +}