status-mobile/nix/lib/getConfig.nix
Jakub Sokołowski dbe3e0a3f9
nix: minor cleanup and documentation updates
Changes:
- Simplified `default.nix` and `shell.nix`
- Moved the default shell to `nix/shell.nix`
- Dropped unnecessary merge from  `nix/shells.nix`
- Fixed `nix/lib/getConfig.nix` to return default on `null`
- Expanded `nix/DETAILS.md` with more info
- Added links to presentations in `nix/README.md`
- Fixed a few typos

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2020-06-05 14:49:34 +02:00

12 lines
282 B
Nix

# helper for getting status-im config values in a safe way
#
{ lib, config }:
let inherit (lib) splitString attrByPath;
in name: default:
let
path = [ "status-im" ] ++ (splitString "." name);
value = attrByPath path default config;
in if value != null then value else default