diff options
| author | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-07-14 19:38:49 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-07-14 19:42:36 +0530 |
| commit | ce1694f53d6a2465658f1bde9dacff66ffed031c (patch) | |
| tree | 6edb8e7d1e067ef061bc9116347a03c1444fea42 /modules/gaming | |
| parent | 77bc32332d99636666daa1a7bea8f7265675a5f9 (diff) | |
| download | home-manager-config-ce1694f53d6a2465658f1bde9dacff66ffed031c.tar.gz home-manager-config-ce1694f53d6a2465658f1bde9dacff66ffed031c.zip | |
refactor: refactored the configuration for gaming
Diffstat (limited to 'modules/gaming')
| -rw-r--r-- | modules/gaming/default.nix | 47 | ||||
| -rw-r--r-- | modules/gaming/steam.nix | 22 |
2 files changed, 69 insertions, 0 deletions
diff --git a/modules/gaming/default.nix b/modules/gaming/default.nix new file mode 100644 index 0000000..f1933bd --- /dev/null +++ b/modules/gaming/default.nix @@ -0,0 +1,47 @@ +{ + config, + pkgs, + lib, + ... +}: + +# Gaming - Collection of game launchers and gaming utilities +{ + imports = [ + ./steam.nix + ]; + + options.gaming = { + enable = lib.mkEnableOption "gaming tools bundle (Heroic, winetricks, gamemode)."; + launcher = lib.mkOption { + type = lib.types.package; + default = pkgs.symlinkJoin { + name = "heroic-bundle"; + paths = with pkgs; [ + # Wrap Heroic so it dynamically appends gamemode's library folder to LD_LIBRARY_PATH + (pkgs.symlinkJoin { + name = "heroic-wrapped"; + paths = [ heroic ]; + buildInputs = [ pkgs.makeWrapper ]; + postBuild = '' + wrapProgram $out/bin/heroic \ + --prefix LD_LIBRARY_PATH : "${pkgs.gamemode.lib}/lib:${pkgs.pkgsi686Linux.gamemode.lib}/lib" + ''; + }) + winetricks + xdg-user-dirs + gamemode + ]; + }; + description = "Bundle of game launchers (Heroic), winetricks, and core gaming utilities with GameMode support."; + }; + }; + + config = lib.mkIf config.gaming.enable { + home.packages = [ config.gaming.launcher ]; + + xdg.mimeApps.defaultApplications = { + "x-scheme-handler/heroic" = "heroic.desktop"; + }; + }; +} diff --git a/modules/gaming/steam.nix b/modules/gaming/steam.nix new file mode 100644 index 0000000..d1944d5 --- /dev/null +++ b/modules/gaming/steam.nix @@ -0,0 +1,22 @@ +{ + config, + pkgs, + lib, + ... +}: + +# Steam - game store +{ + options.gaming.steam = { + enable = lib.mkEnableOption "Enables steam."; + package = lib.mkOption { + type = lib.types.package; + default = pkgs.steam; + description = "Package for steam app."; + }; + }; + + config = lib.mkIf config.gaming.steam.enable { + home.packages = [ config.gaming.steam.package ]; + }; +} |
