home(steam): port to home

This commit is contained in:
514fpv 2024-01-07 21:50:42 +08:00
parent 69703a3d6e
commit 6571c98447
Signed by: koishi
SSH key fingerprint: SHA256:VkIdW3jUIiqecV2WNAje2fGU5lEhN0XZ58DN0NS4pv0
4 changed files with 56 additions and 23 deletions

29
home/steam/nixos.nix Normal file
View file

@ -0,0 +1,29 @@
{ 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;
};
}