diff options
| -rw-r--r-- | hosts/c-pc/home.nix | 5 | ||||
| -rw-r--r-- | snowfall/modules/home/apps/steam/default.nix | 30 | ||||
| -rw-r--r-- | snowfall/modules/home/suites/gaming/default.nix | 1 |
3 files changed, 31 insertions, 5 deletions
diff --git a/hosts/c-pc/home.nix b/hosts/c-pc/home.nix index f6dc268..15a9e09 100644 --- a/hosts/c-pc/home.nix +++ b/hosts/c-pc/home.nix @@ -27,11 +27,6 @@ ".config/fcitx" ".config/fcitx5" - - { - directory = ".local/share/Steam"; - method = "symlink"; - } ".config/qBittorrent" ".local/share/qBittorrent" diff --git a/snowfall/modules/home/apps/steam/default.nix b/snowfall/modules/home/apps/steam/default.nix new file mode 100644 index 0000000..9148b9d --- /dev/null +++ b/snowfall/modules/home/apps/steam/default.nix @@ -0,0 +1,30 @@ +{ options, config, osConfig, lib, pkgs, namespace, ... }: + +#NOTE: steam must be installed system-wide. +# This module does nothing unless steam is enabled at the +# system level as well. This is only a separate toggle so +# that not every user gets steam files in their home. +with lib; with lib.${namespace}; let + cfg = config.${namespace}.apps.steam; + oscfg = osConfig.${namespace}.apps.steam; + impermanence = config.${namespace}.impermanence; +in { + options.${namespace}.apps.steam = with types; { + enable = mkEnableOption "steam"; + }; + + config = mkIf (cfg.enable && oscfg.enable) { + home.persistence.${impermanence.location} = { + directories = [{ + directory = ".local/share/Steam"; + method = "symlink"; + }]; + }; + + home.file = { + "Links/Steam Games".source = config.lib.file.mkOutOfStoreSymlink ( + "${config.home.homeDirectory}/.local/share/Steam/steamapps/common" + ); + }; + }; +} diff --git a/snowfall/modules/home/suites/gaming/default.nix b/snowfall/modules/home/suites/gaming/default.nix index 201e650..b16b0e9 100644 --- a/snowfall/modules/home/suites/gaming/default.nix +++ b/snowfall/modules/home/suites/gaming/default.nix @@ -10,6 +10,7 @@ in { config = mkIf cfg.enable { cxl = { apps = { + steam.enable = true; prismlauncher.enable = true; }; }; |