about summary refs log tree commit diff
path: root/pkgs/games/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/games/default.nix')
-rw-r--r--pkgs/games/default.nix25
1 files changed, 25 insertions, 0 deletions
diff --git a/pkgs/games/default.nix b/pkgs/games/default.nix
new file mode 100644
index 00000000..d85bd191
--- /dev/null
+++ b/pkgs/games/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 ./steam
+  ];
+}).config.packages