From 1251761da2d2d769409503ace4b67f709c001de2 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Thu, 27 Jun 2024 17:46:14 -0400 Subject: [PATCH] refactor(steam): migrate to options module --- flakes/nixos.nix | 2 -- machines/terra/configuration.nix | 1 + modules/applications/steam/default.nix | 7 ------- nixos/steam/default.nix | 21 +++++++++++++++++++++ 4 files changed, 22 insertions(+), 9 deletions(-) delete mode 100644 modules/applications/steam/default.nix create mode 100644 nixos/steam/default.nix diff --git a/flakes/nixos.nix b/flakes/nixos.nix index 758a385..79edc1c 100644 --- a/flakes/nixos.nix +++ b/flakes/nixos.nix @@ -93,8 +93,6 @@ in { ++ [ ../modules/common.nix ../modules/containers.nix - ../modules/applications/libreoffice - ../modules/applications/steam ../machines/terra/configuration.nix ]; diff --git a/machines/terra/configuration.nix b/machines/terra/configuration.nix index 4235362..6b4a2ed 100644 --- a/machines/terra/configuration.nix +++ b/machines/terra/configuration.nix @@ -49,6 +49,7 @@ my.hyprland.enable = true; my.libreoffice.enable = true; + my.steam.enable = true; # Define a user account. Don't forget to set a password with ‘passwd’. users.users.michael = { diff --git a/modules/applications/steam/default.nix b/modules/applications/steam/default.nix deleted file mode 100644 index 01a2b5f..0000000 --- a/modules/applications/steam/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{pkgs, ...}: { - programs.steam = { - enable = true; - package = pkgs.unstable.steam; - gamescopeSession.enable = true; - }; -} diff --git a/nixos/steam/default.nix b/nixos/steam/default.nix new file mode 100644 index 0000000..98a977f --- /dev/null +++ b/nixos/steam/default.nix @@ -0,0 +1,21 @@ +{ + pkgs, + lib, + config, + ... +}: let + inherit (lib) mkEnableOption mkIf; + cfg = config.my.steam; +in { + options.my.steam = { + enable = mkEnableOption "steam"; + }; + + config = mkIf cfg.enable { + programs.steam = { + enable = true; + package = pkgs.unstable.steam; + gamescopeSession.enable = true; + }; + }; +}