mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-02 14:03:06 +00:00
* android-ndk is added * in the derivation, system nim is default but one can change it to nimbus-build-system * special script for creating nimble links, necessary for the compilation to succeed. Referenced issue: * https://github.com/waku-org/nwaku/issues/3232
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));
|
|
}
|