modules: programs: steam: simplify wrapper

This commit is contained in:
Bruno BELANYI 2023-06-03 13:39:52 +01:00
parent 39a512bc0a
commit 4f6f483851
1 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,8 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.programs.steam;
steam = pkgs.steam;
in
{
options.my.programs.steam = with lib; {
@ -26,13 +28,13 @@ in
(pkgs.writeScriptBin "steam" ''
#!/bin/sh
mkdir -p "${cfg.dataDir}"
HOME="${cfg.dataDir}" exec ${pkgs.steam}/bin/steam "$@"
HOME="${cfg.dataDir}" exec ${lib.getExe steam} "$@"
'')
# Same, for GOG and other such games
(pkgs.writeScriptBin "steam-run" ''
#!/bin/sh
mkdir -p "${cfg.dataDir}"
HOME="${cfg.dataDir}" exec ${pkgs.steam-run}/bin/steam-run "$@"
HOME="${cfg.dataDir}" exec ${lib.getExe steam.run} "$@"
'')
];
};