nix: separate kinds of dependencies
This commit is contained in:
parent
6c1e5d6df5
commit
d431756ce1
1 changed files with 14 additions and 7 deletions
21
flake.nix
21
flake.nix
|
@ -16,21 +16,27 @@
|
|||
forSystems = nixpkgs.lib.genAttrs systems;
|
||||
pkgsFor = system: (import nixpkgs {inherit system;}).extend overlays.default;
|
||||
genPkgs = func: (forSystems (system: func (pkgsFor system)));
|
||||
deps = pkgs:
|
||||
buildTimeDeps = pkgs:
|
||||
with pkgs; [
|
||||
pkg-config
|
||||
clang
|
||||
mold
|
||||
wayland
|
||||
clang
|
||||
xorg.libX11
|
||||
xorg.libXcursor
|
||||
xorg.libXi
|
||||
xorg.libXrandr
|
||||
];
|
||||
linkTimeDeps = pkgs:
|
||||
with pkgs; [
|
||||
mold
|
||||
wayland
|
||||
clang
|
||||
udev
|
||||
alsa-lib
|
||||
vulkan-loader
|
||||
libxkbcommon
|
||||
xorg.libX11
|
||||
xorg.libXcursor
|
||||
xorg.libXi
|
||||
xorg.libXrandr
|
||||
];
|
||||
in {
|
||||
checks = genPkgs (pkgs: {
|
||||
|
@ -59,7 +65,8 @@
|
|||
kodotag = pkgs.rustPlatform.buildRustPackage {
|
||||
pname = "kodotag";
|
||||
version = "0.1.0";
|
||||
nativeBuildInputs = deps pkgs;
|
||||
nativeBuildInputs = buildTimeDeps pkgs;
|
||||
buildInputs = linkTimeDeps pkgs;
|
||||
src = ./.;
|
||||
hash = pkgs.lib.fakeHash;
|
||||
# cargoHash = pkgs.lib.fakeHash;
|
||||
|
@ -84,7 +91,7 @@
|
|||
rust-analyzer
|
||||
rustfmt
|
||||
];
|
||||
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (deps pkgs);
|
||||
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (linkTimeDeps pkgs);
|
||||
};
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue