-
Notifications
You must be signed in to change notification settings - Fork 986
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nix: switch status-im config to env vars, cleanup
To help with #15595 changes, refactoring is required. In this PR we switch from config to env vars. Doing some cleanup meanwhile.
- Loading branch information
Showing
20 changed files
with
131 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
{ lib, config }: | ||
{ lib }: | ||
|
||
{ | ||
getConfig = import ./getConfig.nix { inherit lib config; }; | ||
getEnvWithDefault = import ./getEnvWithDefault.nix {}; | ||
mkFilter = import ./mkFilter.nix { inherit lib; }; | ||
mergeSh = import ./mergeSh.nix { inherit lib; }; | ||
checkEnvVarSet = import ./checkEnvVarSet.nix; | ||
sanitizeVersion = import ./sanitizeVersion.nix { inherit lib; }; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# helper for getting environment variables in a safe way | ||
# | ||
|
||
{ }: | ||
|
||
name: default: | ||
let | ||
envValue = builtins.getEnv name; | ||
returnValue = if envValue != "" then envValue else default; | ||
in | ||
builtins.trace "getEnvWithDefault ${name} (default: ${toString default}): ${toString returnValue}" returnValue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ lib }: | ||
|
||
version: | ||
let | ||
# paths don't like slashes in them | ||
dropSlashes = builtins.replaceStrings [ "/" ] [ "_" ]; | ||
# if version doesn't match this it's probably a commit, it's lax semver | ||
versionRegex = "^v?[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+[[:alnum:]+_.-]*$"; | ||
in | ||
if (builtins.match versionRegex version) != null | ||
# Geth forces a 'v' prefix for all versions | ||
then lib.removePrefix "v" (dropSlashes version) | ||
# reduce metrics cardinality in Prometheus | ||
else lib.traceValFn (_: "WARNING: Marking build version as 'develop'!") "develop" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ xcodeWrapper }: | ||
|
||
let | ||
RED = "\\033[0;31m"; | ||
GREEN = "\\033[0;32m"; | ||
NC = "\\033[0m"; | ||
|
||
_xcodeToolsTest = '' | ||
xcode=0 | ||
iPhoneSDK=0 | ||
export PATH=${xcodeWrapper}/bin:$PATH | ||
xcrun xcodebuild -version && xcode=1 | ||
[ $xcode -eq 1 ] && xcrun --sdk iphoneos --show-sdk-version > /dev/null && iPhoneSDK=1 | ||
''; | ||
_xcodeToolReportScript = tool-name: ''[ $SELECTED -eq 0 ] && echo -e "${NC}- ${RED}[ ] ${tool-name}" || echo -e "${NC}- ${GREEN}[√] ${tool-name}${RED}"''; | ||
_xcodeToolsReportScript = '' | ||
echo -e "${RED}There are some required tools missing in the system:" | ||
export SELECTED=$xcode; ${_xcodeToolReportScript "Xcode ${_xcodeVersion}"} | ||
export SELECTED=$iPhoneSDK; ${_xcodeToolReportScript "iPhone SDK"} | ||
''; | ||
_xcodeVersion = builtins.replaceStrings ["xcode-wrapper-"] [""] xcodeWrapper.name; | ||
in | ||
'' | ||
${_xcodeToolsTest} | ||
if [ $xcode -eq 0 ]; then | ||
${_xcodeToolsReportScript} | ||
echo -e "Please install Xcode ${_xcodeVersion} from the App Store.${NC}" | ||
exit 1 | ||
fi | ||
'' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.