diff --git a/flake.lock b/flake.lock index f283755..de3762e 100644 --- a/flake.lock +++ b/flake.lock @@ -66,6 +66,21 @@ "type": "github" } }, + "crane": { + "locked": { + "lastModified": 1784248371, + "narHash": "sha256-0l0Y4D4wbZhp1Oi6h8OpbLtIm/4FN88oCf54MK2ZgiM=", + "owner": "ipetkov", + "repo": "crane", + "rev": "f7d151ec0bf52cf9662e2f59d7bea28588c2f070", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -587,6 +602,7 @@ }, "root": { "inputs": { + "crane": "crane", "haskellNix": "haskellNix", "nixpkgs": [ "haskellNix", diff --git a/flake.nix b/flake.nix index c8cb77c..b380772 100644 --- a/flake.nix +++ b/flake.nix @@ -7,6 +7,7 @@ url = "git+https://git.deertopia.net/msyds/sydpkgs"; inputs.nixpkgs.follows = "nixpkgs"; }; + crane.url = "github:ipetkov/crane"; }; outputs = { self, nixpkgs, sydpkgs, haskellNix, ... }@inputs: @@ -20,7 +21,9 @@ haskellNix.overlay (final: prev: { shake-wrapper = final.callPackage ./shake-wrapper.nix {}; - gyehoek-runtime = final.callPackage ./runtime {}; + gyehoek-runtime = final.callPackage ./runtime { + crane-lib = inputs.crane.mkLib final; + }; gyehoek = final.haskell-nix.project' { src = ./.; compiler-nix-name = "ghc912"; diff --git a/runtime/default.nix b/runtime/default.nix index af1fde4..8359c32 100644 --- a/runtime/default.nix +++ b/runtime/default.nix @@ -1,13 +1,13 @@ { rustPlatform +, lib +, crane-lib }: -rustPlatform.buildRustPackage (finalAttrs: { +crane-lib.buildPackage (lib.fix (finalAttrs: { pname = "gyehoek-runtime"; version = "0.1.0"; src = ./.; - cargoLock = { - lockFile = ./Cargo.lock; - }; + # cargoLock = ./Cargo.lock; doCheck = true; meta.mainProgram = "gyehoek-runtime"; -}) +}))