refactor(system): simplify steamTinkerLaunch logic and package assignment
Refactor the steamExtraPkgs conditional logic into a single line and introduce a launcherSet variable to reduce redundancy when assigning packages to the system or specific users.
This commit is contained in:
@@ -17,10 +17,9 @@
|
||||
++ lib.optionals pkgs.stdenv.isx86_64 [ heroic ];
|
||||
|
||||
steamExtraPkgs =
|
||||
if !cfg.steam.steamTinkerLaunch.enable then
|
||||
[ ]
|
||||
else
|
||||
lib.optional (lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.steamtinkerlaunch) pkgs.steamtinkerlaunch;
|
||||
lib.optional (cfg.steam.steamTinkerLaunch.enable && lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.steamtinkerlaunch) pkgs.steamtinkerlaunch;
|
||||
|
||||
launcherSet = launcherPkgs ++ steamExtraPkgs ++ cfg.launchers.extraPackages;
|
||||
in
|
||||
{
|
||||
options.chiasson.system.gaming = {
|
||||
@@ -194,11 +193,11 @@
|
||||
];
|
||||
}
|
||||
(lib.mkIf (cfg.launchers.forUsers == null) {
|
||||
environment.systemPackages = launcherPkgs ++ steamExtraPkgs ++ cfg.launchers.extraPackages;
|
||||
environment.systemPackages = launcherSet;
|
||||
})
|
||||
(lib.mkIf (cfg.launchers.forUsers != null) {
|
||||
users.users = lib.genAttrs cfg.launchers.forUsers (_: {
|
||||
packages = launcherPkgs ++ steamExtraPkgs ++ cfg.launchers.extraPackages;
|
||||
packages = launcherSet;
|
||||
});
|
||||
})
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user