Skip to content

Commit

Permalink
fix: pass rootSrc to derivation fuzon
Browse files Browse the repository at this point in the history
  • Loading branch information
gabyx committed Sep 12, 2024
1 parent 4d8a6a2 commit 0212837
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 23 deletions.
5 changes: 4 additions & 1 deletion tools/nix/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
# by calling this function:
(
system: let
rootSrc = ./../..;

overlays = [(import rust-overlay)];

# Import nixpkgs and load it into pkgs.
Expand Down Expand Up @@ -78,6 +80,7 @@

pkgs.skopeo
pkgs.dasel
pkgs.python313
];

benchmark-deps = with pkgs; [
Expand All @@ -89,7 +92,7 @@
# The global version for fuzon.
# This is gonna get tooled later.
fuzon = pkgs.callPackage ./pkgs/fuzon {
inherit self;
inherit rootSrc;
inherit rustToolchain;
};
in rec {
Expand Down
47 changes: 25 additions & 22 deletions tools/nix/pkgs/fuzon/default.nix
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@
{
self,
rootSrc,
lib,
makeRustPlatform,
rustToolchain,
python313,
}: let
rustPlatform = makeRustPlatform {
cargo = rustToolchain;
rustc = rustToolchain;
};

fs = lib.fileset;
rootDir = ../../../..;

cargoFile = "${rootDir}/fuzon/Cargo.toml";
lockFile = "${rootDir}/Cargo.lock";
cargoFile = "${rootSrc}/fuzon/Cargo.toml";
lockFile = "${rootSrc}/Cargo.lock";
in
rustPlatform.buildRustPackage {
name = "fuzon";
(rustPlatform.buildRustPackage
{
name = "fuzon";

src = fs.toSource {
root = rootDir;
fileset = fs.gitTracked rootDir;
};
src = fs.toSource {
root = rootSrc;
fileset = fs.gitTracked rootSrc;
};

version = (lib.importTOML cargoFile).package.version;
version = (lib.importTOML cargoFile).package.version;

cargoLock = {
inherit lockFile;
};
cargoLock = {
inherit lockFile;
};

meta = {
description = "A CLI tool to fuzzy search ontology terms by their labels.";
homepage = "https://github.com/sdsc-ordes/fuzon";
license = lib.licenses.asl20;
maintainers = ["gabyx" "cmdoret"];
};
}
meta = {
description = "A CLI tool to fuzzy search ontology terms by their labels.";
homepage = "https://github.com/sdsc-ordes/fuzon";
license = lib.licenses.asl20;
maintainers = ["gabyx" "cmdoret"];
};
})
.overrideAttrs (finalAttrs: prevAttrs: {
buildInputs = prevAttrs.buildInputs ++ [python313];
})

0 comments on commit 0212837

Please sign in to comment.