From 89911792efc07ce5dd52f3a9f5b2eb2046fd06a6 Mon Sep 17 00:00:00 2001 From: Caroline Larimore Date: Sat, 8 Feb 2025 15:09:38 -0800 Subject: migration: persist steam files --- snowfall/modules/home/apps/steam/default.nix | 30 +++++++++++++++++++++++++ snowfall/modules/home/suites/gaming/default.nix | 1 + 2 files changed, 31 insertions(+) create mode 100644 snowfall/modules/home/apps/steam/default.nix (limited to 'snowfall') 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; }; }; -- cgit v1.2.3