diff --git a/flake.nix b/flake.nix index dbdf6e8..2d8bb3c 100644 --- a/flake.nix +++ b/flake.nix @@ -16,6 +16,22 @@ forSystems = nixpkgs.lib.genAttrs systems; pkgsFor = system: (import nixpkgs {inherit system;}).extend overlays.default; genPkgs = func: (forSystems (system: func (pkgsFor system))); + deps = pkgs: + with pkgs; [ + pkg-config + clang + mold + wayland + clang + xorg.libX11 + xorg.libXcursor + xorg.libXi + xorg.libXrandr + udev + alsa-lib + vulkan-loader + libxkbcommon + ]; in { checks = genPkgs (pkgs: { git-hooks = git-hooks.lib.${pkgs.system}.run { @@ -44,29 +60,13 @@ pname = "kodotag"; version = "0.1.0"; - nativeBuildInputs = with pkgs; [ - pkg-config - clang - mold - wayland - ]; - - buildInputs = with pkgs; [ - clang - xorg.libX11 - xorg.libXcursor - xorg.libXi - xorg.libXrandr - udev - alsa-lib - vulkan-loader - libxkbcommon - ]; + nativeBuildInputs = deps pkgs; src = ./.; hash = pkgs.lib.fakeHash; - cargoHash = "sha256-x2St+At8n07ns354zORhb7NJfBQTav1beSyAnlJtak8="; + cargoHash = pkgs.lib.fakeHash; + # cargoHash = "sha256-x2St+At8n07ns354zORhb7NJfBQTav1beSyAnlJtak8="; # a hack to avoid using mold as our linker when building with nix postUnpack = '' @@ -87,6 +87,7 @@ rust-analyzer rustfmt ]; + LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (deps pkgs); }; });