Deduplicate deps to avoid building package just to get deps into devshell

This commit is contained in:
Daniel Flanagan 2024-07-30 11:45:04 -05:00
parent cd8bb97fc1
commit 0cba2f0360

View file

@ -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);
};
});