nixos/home/steam/nixos.nix
2025-01-13 11:52:09 +08:00

38 lines
787 B
Nix

{
pkgs,
lib,
config,
...
}:
with lib;
let
cfg = config.home.steam;
persist = [
".steam"
".local/share/Steam"
];
in
{
imports = [ ./config.nix ];
options.home.steam = {
enable = mkEnableOption "steam software and environment";
package = mkOption {
type = with types; package;
default = config.programs.steam.package;
description = "steam package";
};
allUsers = mkEnableOption "set up for all users";
};
config = {
users.homeModules = [
# this module passes steam configuration to home-manager
{ passthrough.steam = cfg; }
];
users.home.persist.directories = with cfg; mkIf (enable && allUsers) persist;
users.home.persistApp.directories = with cfg; mkIf (enable && !allUsers) persist;
};
}