Improve nix development shell

This commit is contained in:
Julian Mutter 2024-01-14 12:19:20 +01:00
parent 608fc7c386
commit a9550e61fc

View File

@ -10,9 +10,8 @@
let
pkgs = import nixpkgs { inherit system; };
naersk-lib = pkgs.callPackage naersk { };
in {
defaultPackage = naersk-lib.buildPackage {
src = ./.;
# Needed at compile time (on build system)
nativeBuildInputs = with pkgs; [
gtk4
cairo
@ -21,7 +20,22 @@
poppler
wrapGAppsHook
];
# Needed at runtime (on run system)
buildInputs = with pkgs; [ ];
in rec {
defaultPackage = naersk-lib.buildPackage {
src = ./.;
inherit buildInputs;
inherit nativeBuildInputs;
};
devShell = with pkgs;
mkShell {
buildInputs =
[ cargo rustc rustfmt pre-commit rustPackages.clippy ];
# Without inheriting nativeBuildinputs, cargo build will fail but that is good since we want to use only nix build
# inherit nativeBuildInputs;
RUST_SRC_PATH = rustPlatform.rustLibSrc;
};
});
}