mirror of
https://github.com/logos-messaging/nim-sds.git
synced 2026-02-16 20:13:23 +00:00
This way we can track same Nim as in vendor folder. Notably this upgrades from Nim 2.2.4 to 2.2.6. Depends on: https://github.com/status-im/nimbus-build-system/pull/112 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));
|
|
}
|