feat: games

This commit is contained in:
Gustavo "Guz" L. de Mello
2024-04-18 10:43:47 -03:00
parent 185cc5772c
commit cb313daca9
7 changed files with 70 additions and 1 deletions

View File

@@ -26,6 +26,8 @@
};
};
programs.steam.enable = false;
programs.gnupg.agent = {
enable = true;
pinentryPackage = pkgs.pinentry-gnome3;

View File

@@ -19,6 +19,8 @@
services.gnome-keyring.enable = true;
programs.prismlauncher.enable = true;
fonts.fontconfig.enable = true;
home.sessionVariables = {

View File

@@ -50,7 +50,6 @@
services.flatpak.packages = [
"nz.mega.MEGAsync"
"com.bitwarden.desktop"
"org.prismlauncher.PrismLauncher"
"org.mozilla.Thunderbird"
"net.blockbench.Blockbench"
];

View File

@@ -4,6 +4,7 @@
./krita
./neovim.nix
./obsidian
./prismlauncher.nix
./wezterm.nix
];
options = {};

View File

@@ -0,0 +1,30 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.programs.prismlauncher;
in {
imports = [];
options.programs.prismlauncher = with lib;
with lib.types; {
enable = mkEnableOption "";
flatpak = mkOption {
type = bool;
default = false;
};
};
config = with lib;
mkIf cfg.enable {
services.flatpak = mkIf cfg.flatpak {
packages = ["org.prismlauncher.PrismLauncher"];
};
home.packages = with pkgs; mkIf (!cfg.flatpak) [prismlauncher];
programs.java = mkIf (!cfg.flatpak) {
enable = true;
package = mkDefault pkgs.jdk17;
};
};
}

View File

@@ -2,6 +2,7 @@
imports = [
./nih
./hyprland.nix
./steam.nix
];
options = {};
config = {};

View File

@@ -0,0 +1,34 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.programs.steam;
in {
imports = [];
options.programs.steam = with lib;
with lib.types; {
wayland = mkOption {
type = bool;
default = config.programs.hyprland.enable;
};
};
config = with lib;
mkIf cfg.enable {
environment.systemPackages = with pkgs; [steam-run];
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
"steam"
"steam-original"
"steam-run"
];
programs.steam = {
gamescopeSession = mkIf cfg.wayland {
enable = true;
};
};
};
}