mirror of
https://github.com/status-im/nim-dagger.git
synced 2025-01-09 14:15:41 +00:00
0c6784da7e
* nix: make derivation and update shell Create a structure for nix files. Add the derivation file which is using system Nim to compile Codex. Referenced issue: https://github.com/codex-storage/nim-codex/issues/940 Signed-off-by: markoburcul <marko@status.im> * nim-circom-compat: update Include commit which allows building circom-compat-ffi using Nix(doesn't affect current usage of the submodule). Referenced issue: https://github.com/codex-storage/nim-codex/issues/940 Signed-off-by: markoburcul <marko@status.im> * makefile: fix for detecting linux arch Signed-off-by: markoburcul <marko@status.im> --------- Signed-off-by: markoburcul <marko@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));
|
|
}
|