mirror of
https://github.com/status-im/status-react.git
synced 2025-01-09 18:46:19 +00:00
2dce0ba861
Signed-off-by: Pedro Pombeiro <noreply@pedro.pombei.ro>
34 lines
1.4 KiB
Nix
34 lines
1.4 KiB
Nix
{ config, stdenv, callPackage, fetchFromGitHub, mkFilter }:
|
|
|
|
let
|
|
inherit (stdenv.lib) attrByPath strings traceValFn;
|
|
|
|
repo = "nimbus";
|
|
|
|
localPath = attrByPath ["status-im" "nimbus" "src-override"] "" config;
|
|
localSrc = builtins.path rec { # We use builtins.path so that we can name the resulting derivation, otherwise the name would be taken from the checkout directory, which is outside of our control
|
|
path = traceValFn (path: "Using local ${repo} sources from ${path}\n") localPath;
|
|
name = "${repo}-source-local";
|
|
filter =
|
|
# Keep this filter as restrictive as possible in order to avoid unnecessary rebuilds and limit closure size
|
|
mkFilter {
|
|
dirRootsToInclude = [ "nix" "wrappers" "vendor" ];
|
|
dirsToExclude = [ ".git" ".svn" "CVS" ".hg" ".vscode" ".dependabot" ".github" "examples" "docs" ];
|
|
filesToInclude = [ "Makefile" "nim.cfg" "nimbus.nimble" "default.nix" ];
|
|
root = path;
|
|
};
|
|
};
|
|
|
|
src = if localPath != "" then localSrc
|
|
else fetchFromGitHub rec {
|
|
inherit repo;
|
|
name = "${repo}-source-${strings.substring 0 7 rev}";
|
|
rev = "501455b0cd2e74c451bc1743e2f1070a3fee1343";
|
|
owner = "status-im";
|
|
sha256 = "0nxh3hh8fib3hlmvs5d67h6cq3kyap94pa9w7ixsfa5285ila17h";
|
|
fetchSubmodules = true;
|
|
};
|
|
nimbusDeriv = import "${src}/nix/default.nix";
|
|
|
|
in nimbusDeriv
|