Compare commits
4 commits
ed456c999d
...
9f3811ea3b
Author | SHA1 | Date | |
---|---|---|---|
Bruno BELANYI | 9f3811ea3b | ||
Bruno BELANYI | 5c95ba1113 | ||
Bruno BELANYI | 37bb7fd625 | ||
Bruno BELANYI | 45321072fc |
|
@ -11,6 +11,7 @@
|
|||
./home.nix
|
||||
./networking.nix
|
||||
./profiles.nix
|
||||
./programs.nix
|
||||
./services.nix
|
||||
./sound.nix
|
||||
];
|
||||
|
|
7
machines/aramis/programs.nix
Normal file
7
machines/aramis/programs.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ ... }:
|
||||
{
|
||||
my.programs = {
|
||||
# Steam configuration
|
||||
steam.enable = true;
|
||||
};
|
||||
}
|
|
@ -5,6 +5,7 @@
|
|||
imports = [
|
||||
./hardware
|
||||
./home.nix
|
||||
./programs
|
||||
./services
|
||||
./system
|
||||
];
|
||||
|
|
8
modules/programs/default.nix
Normal file
8
modules/programs/default.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Program-related modules
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./steam.nix
|
||||
];
|
||||
}
|
39
modules/programs/steam.nix
Normal file
39
modules/programs/steam.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.my.programs.steam;
|
||||
in
|
||||
{
|
||||
options.my.programs.steam = with lib; {
|
||||
enable = mkEnableOption "steam configuration";
|
||||
|
||||
dataDir = mkOption {
|
||||
type = types.str;
|
||||
default = "$XDG_DATA_HOME/steamlib";
|
||||
example = "/mnt/steam/";
|
||||
description = ''
|
||||
Which directory should be used as HOME to run steam.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = builtins.map lib.hiPrio [
|
||||
# Respect XDG conventions, leave my HOME alone
|
||||
(pkgs.writeScriptBin "steam" ''
|
||||
#!/bin/sh
|
||||
mkdir -p "${cfg.dataDir}"
|
||||
HOME="${cfg.dataDir}" exec ${pkgs.steam}/bin/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-native}/bin/steam-run "$@"
|
||||
'')
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue