mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-09 05:52:45 +00:00
Jakub
8c621b9ae6
* ci: bump status-jenkins-lib version, don't use a branch Also renamed `Jenkinsfile.nix` to `nix.Jenkinsfile` because the filename makes no sense. But left a symlink temporarily to not break things. Signed-off-by: Jakub Sokołowski <jakub@status.im> * nix: fix hash for Nim compiler checksums repo Signed-off-by: Jakub Sokołowski <jakub@status.im> * nix: do not create variable name conflicts Signed-off-by: Jakub Sokołowski <jakub@status.im> --------- Signed-off-by: Jakub Sokołowski <jakub@status.im>
16 lines
453 B
Nix
16 lines
453 B
Nix
{ pkgs ? import <nixpkgs> { } }:
|
|
|
|
let
|
|
|
|
inherit (pkgs.lib) fileContents last splitString flatten remove;
|
|
inherit (builtins) map match;
|
|
in {
|
|
findKeyValue = regex: sourceFile:
|
|
let
|
|
linesFrom = file: splitString "\n" (fileContents file);
|
|
matching = regex: lines: map (line: match regex line) lines;
|
|
extractMatch = matches: last (flatten (remove null matches));
|
|
in
|
|
extractMatch (matching regex (linesFrom sourceFile));
|
|
}
|