mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-09 13:56:23 +00:00
Jakub Sokołowski
4a1a2c8196
This way we can actually build and run a node using just: ```sh nix run 'github:status-im/nimbus-eth2?submodules=1' ``` The `?submodules=1` part should eventually not be necessary. For more details see: https://github.com/NixOS/nix/issues/4423 Signed-off-by: Jakub Sokołowski <jakub@status.im>
16 lines
465 B
Nix
16 lines
465 B
Nix
{ pkgs ? import <nixpkgs> { } }:
|
|
|
|
let
|
|
|
|
inherit (pkgs.lib) fileContents last splitString flatten remove;
|
|
inherit (builtins) map match;
|
|
in {
|
|
findKeyValue = regex: sourceFile:
|
|
let
|
|
linesFrom = sourceFile: splitString "\n" (fileContents sourceFile);
|
|
matching = regex: lines: map (line: match regex line) lines;
|
|
extractMatch = matches: last (flatten (remove null matches));
|
|
in
|
|
extractMatch (matching regex (linesFrom sourceFile));
|
|
}
|