at main 1.7 kB view raw
1{ 2 inputs = { 3 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 4 flake-parts.url = "github:hercules-ci/flake-parts"; 5 rust-flake.url = "github:juspay/rust-flake"; 6 rust-flake.inputs.nixpkgs.follows = "nixpkgs"; 7 }; 8 9 outputs = 10 inputs@{ 11 nixpkgs, 12 flake-parts, 13 rust-flake, 14 ... 15 }: 16 flake-parts.lib.mkFlake { inherit inputs; } { 17 imports = [ 18 rust-flake.flakeModules.default 19 rust-flake.flakeModules.nixpkgs 20 ]; 21 systems = nixpkgs.lib.systems.flakeExposed; 22 perSystem = 23 { self', pkgs, ... }: 24 let 25 buildInputs = with pkgs; [ 26 alsa-lib 27 dbus 28 fontconfig 29 freetype 30 libGL 31 libudev-zero 32 libxkbcommon 33 xorg.libxcb 34 xorg.xcbutil 35 pipewire 36 pulseaudio 37 vulkan-headers 38 vulkan-loader 39 wayland 40 wayland-protocols 41 xorg.libX11 42 xorg.libXcursor 43 xorg.libXi 44 xorg.libXrandr 45 xorg.libXrender 46 ]; 47 nativeBuildInputs = with pkgs; [ 48 ]; 49 in 50 { 51 rust-project.crates.star-studio.crane.args = { 52 inherit buildInputs nativeBuildInputs; 53 }; 54 devShells.default = self'.devShells.rust.overrideAttrs (old: { 55 buildInputs = old.buildInputs ++ buildInputs; 56 nativeBuildInputs = old.nativeBuildInputs ++ nativeBuildInputs; 57 LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (buildInputs ++ nativeBuildInputs); 58 }); 59 packages.default = self'.packages.star-studio; 60 }; 61 }; 62}