nix: separate kinds of dependencies

This commit is contained in:
Daniel Flanagan 2024-07-30 11:55:22 -05:00
parent 6c1e5d6df5
commit d431756ce1

View file

@ -16,21 +16,27 @@
forSystems = nixpkgs.lib.genAttrs systems; forSystems = nixpkgs.lib.genAttrs systems;
pkgsFor = system: (import nixpkgs {inherit system;}).extend overlays.default; pkgsFor = system: (import nixpkgs {inherit system;}).extend overlays.default;
genPkgs = func: (forSystems (system: func (pkgsFor system))); genPkgs = func: (forSystems (system: func (pkgsFor system)));
deps = pkgs: buildTimeDeps = pkgs:
with pkgs; [ with pkgs; [
pkg-config pkg-config
clang clang
mold mold
wayland wayland
clang clang
xorg.libX11 ];
xorg.libXcursor linkTimeDeps = pkgs:
xorg.libXi with pkgs; [
xorg.libXrandr mold
wayland
clang
udev udev
alsa-lib alsa-lib
vulkan-loader vulkan-loader
libxkbcommon libxkbcommon
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
]; ];
in { in {
checks = genPkgs (pkgs: { checks = genPkgs (pkgs: {
@ -59,7 +65,8 @@
kodotag = pkgs.rustPlatform.buildRustPackage { kodotag = pkgs.rustPlatform.buildRustPackage {
pname = "kodotag"; pname = "kodotag";
version = "0.1.0"; version = "0.1.0";
nativeBuildInputs = deps pkgs; nativeBuildInputs = buildTimeDeps pkgs;
buildInputs = linkTimeDeps pkgs;
src = ./.; src = ./.;
hash = pkgs.lib.fakeHash; hash = pkgs.lib.fakeHash;
# cargoHash = pkgs.lib.fakeHash; # cargoHash = pkgs.lib.fakeHash;
@ -84,7 +91,7 @@
rust-analyzer rust-analyzer
rustfmt rustfmt
]; ];
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (deps pkgs); LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (linkTimeDeps pkgs);
}; };
}); });