markoburcul 8d720decb0 nix: create initial version of flake
It includes also androidndk and files needed for nimbus-build-system

Referenced issue: https://github.com/waku-org/nwaku/issues/3232

Signed-off-by: markoburcul <marko@status.im>
2025-02-26 09:38:54 +01:00

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));
}