refactor: simplify default config in default.nix

This commit is contained in:
Yusuf Bera Ertan 2022-10-15 23:09:08 +03:00
parent 27033981c3
commit 7be6110eaf
No known key found for this signature in database
GPG Key ID: 1D8F8FAF2294D6EA

View File

@ -8,17 +8,13 @@
nix ? pkgs.nix,
# default to empty dream2nix config
config ?
# if called via CLI, load config via env
if builtins ? getEnv && builtins.getEnv "dream2nixConfig" != ""
then
import ./modules/config.nix {
configRaw = builtins.toPath (builtins.getEnv "dream2nixConfig");
inherit lib;
}
# load from default directory
else
import ./modules/config.nix {
configRaw = {};
configRaw =
if builtins ? getEnv && builtins.getEnv "dream2nixConfig" != ""
# if called via CLI, load config via env
then builtins.toPath (builtins.getEnv "dream2nixConfig")
# load from default directory
else {};
inherit lib;
},
/*