Add local lockfile to fetchYarnDeps

How can I add a local file to be used by fetchYarnDeps.

This is my default.nix currently, and it doesn’t work:

{
  stdenv
, fetchFromGitHub
, git
, openssh
, yarn
, fetchYarnDeps
, keepBuildTree
, buildNpmPackage
, nodejs
}:

stdenv.mkDerivation rec {
	pname = "Cider";
	version = "1.6.3";
	src = fetchFromGitHub {
		owner = "ciderapp";
		repo = pname;
		rev = "v${version}";
		sha256 = "sha256-kjF3QvKmc6DY2ETwDPp4HUlg1uuFXx04lksqevVZCho=";
	};
	
	offlineCache = fetchYarnDeps {
		yarnLock = "${src}/yarn1.lock";
		sha256 = "sha256-kjF3QvKmc6DY2ETwDPp4HUlg1uuFXx04lksqevVZCho=";
	};
		
 
	ELECTRON_SKIP_BINARY_DOWNLOAD = "1";

	nativeBuildInputs = [ keepBuildTree nodejs git openssh ];
	
	postPatch = ''
		cp ${./yarn.lock} ./yarn1.lock
	'';
}

yarnLock = "${yarn.lock}";

Is this the answer, please?

yeah, I don’t think I can mark my own reply as the solution

Marking as solution only works in Help category. I moved the topic there.

2 Likes