Deduplicate deps to avoid building package just to get deps into devshell
This commit is contained in:
parent
cd8bb97fc1
commit
0cba2f0360
39
flake.nix
39
flake.nix
|
@ -16,6 +16,22 @@
|
||||||
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:
|
||||||
|
with pkgs; [
|
||||||
|
pkg-config
|
||||||
|
clang
|
||||||
|
mold
|
||||||
|
wayland
|
||||||
|
clang
|
||||||
|
xorg.libX11
|
||||||
|
xorg.libXcursor
|
||||||
|
xorg.libXi
|
||||||
|
xorg.libXrandr
|
||||||
|
udev
|
||||||
|
alsa-lib
|
||||||
|
vulkan-loader
|
||||||
|
libxkbcommon
|
||||||
|
];
|
||||||
in {
|
in {
|
||||||
checks = genPkgs (pkgs: {
|
checks = genPkgs (pkgs: {
|
||||||
git-hooks = git-hooks.lib.${pkgs.system}.run {
|
git-hooks = git-hooks.lib.${pkgs.system}.run {
|
||||||
|
@ -44,29 +60,13 @@
|
||||||
pname = "kodotag";
|
pname = "kodotag";
|
||||||
version = "0.1.0";
|
version = "0.1.0";
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = deps pkgs;
|
||||||
pkg-config
|
|
||||||
clang
|
|
||||||
mold
|
|
||||||
wayland
|
|
||||||
];
|
|
||||||
|
|
||||||
buildInputs = with pkgs; [
|
|
||||||
clang
|
|
||||||
xorg.libX11
|
|
||||||
xorg.libXcursor
|
|
||||||
xorg.libXi
|
|
||||||
xorg.libXrandr
|
|
||||||
udev
|
|
||||||
alsa-lib
|
|
||||||
vulkan-loader
|
|
||||||
libxkbcommon
|
|
||||||
];
|
|
||||||
|
|
||||||
src = ./.;
|
src = ./.;
|
||||||
|
|
||||||
hash = pkgs.lib.fakeHash;
|
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
|
# a hack to avoid using mold as our linker when building with nix
|
||||||
postUnpack = ''
|
postUnpack = ''
|
||||||
|
@ -87,6 +87,7 @@
|
||||||
rust-analyzer
|
rust-analyzer
|
||||||
rustfmt
|
rustfmt
|
||||||
];
|
];
|
||||||
|
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (deps pkgs);
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue