Deduplicate deps to avoid building package just to get deps into devshell
This commit is contained in:
parent
cd8bb97fc1
commit
0cba2f0360
1 changed files with 20 additions and 19 deletions
39
flake.nix
39
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);
|
||||
};
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue