diff --git a/flake.nix b/flake.nix index a4b4374..d3dfd13 100644 --- a/flake.nix +++ b/flake.nix @@ -47,17 +47,49 @@ let pkgs = import nixpkgs { system = "x86_64-linux"; }; craneLib = crane.lib."x86_64-linux"; - in { + in rec { + kifu-core-deps = craneLib.buildDepsOnly { + pname = "kifu-core-deps"; + version = "0.1.0"; + src = craneLib.cleanCargoSource (craneLib.path ./.); + cargoExtraArgs = "-p kifu-core"; + }; + kifu-core = craneLib.buildPackage { + pname = "kifu-core"; + version = "0.1.0"; + src = craneLib.cleanCargoSource (craneLib.path ./.); + cargoExtraArgs = "-p kifu-core"; + doInstallCargoArtifacts = true; + inherit kifu-core-deps; + }; + kifu-gtk-deps = craneLib.buildDepsOnly { + pname = "kifu-gtk-deps"; + version = "0.1.0"; + src = craneLib.cleanCargoSource (craneLib.path ./.); + nativeBuildInputs = with pkgs; [ + pkg-config + glib + gtk4 + ]; + buildInputs = with pkgs; [ + pkg-config + ]; + cargoExtraArgs = "-p kifu-gtk"; + inherit kifu-core; + }; kifu-gtk = craneLib.buildPackage { pname = "kifu-gtk"; version = "0.1.0"; src = craneLib.cleanCargoSource (craneLib.path ./.); cargoExtraArgs = "-p kifu-gtk"; nativeBuildInputs = with pkgs; [ - pkg-config glib gtk4 ]; + buildInputs = with pkgs; [ + pkg-config + ]; + inherit kifu-gtk-deps; }; }; };