diff options
Diffstat (limited to 'default.nix')
-rw-r--r-- | default.nix | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/default.nix b/default.nix new file mode 100644 index 00000000..80420a8b --- /dev/null +++ b/default.nix @@ -0,0 +1,25 @@ +{ configuration ? null }: + +let + configFilePath = let + xdgConfig = builtins.getEnv "XDG_CONFIG_HOME"; + fallback = "${builtins.getEnv "HOME"}/.config"; + basedir = if xdgConfig == "" then fallback else xdgConfig; + in "${basedir}/nixgames.nix"; + + configFile = if !builtins.pathExists configFilePath then throw '' + The config file "${configFilePath}" doesn't exist! Be sure to create it and + put your HumbleBundle email address and password in it, like this: + + { + humblebundle.email = "fancyuser@example.com"; + humblebundle.password = "my_super_secret_password"; + } + '' else configFilePath; + +in ((import <nixpkgs/lib>).evalModules { + modules = [ + (if configuration == null then configFilePath else configuration) + ./base-module.nix ./humblebundle + ]; +}).config.packages |