Add gamin module in both nixos and home-manager

This commit is contained in:
Yorick Barbanneau 2023-12-26 00:30:05 +01:00
parent 2b7d1ec452
commit f9062e9d15
7 changed files with 71 additions and 11 deletions

View file

@ -2,5 +2,6 @@
config.modules = {
video.kdenlive.enable = true;
web.qutebrowser.enable = true;
gaming.lutris.enable = true;
};
}

View file

@ -0,0 +1,3 @@
{ ... }: {
config.modules.gaming.steam.enable = true;
}

View file

@ -1,6 +1,7 @@
{ lib, config, pkgs, ... }:
{
imports = [
./gaming/lutris
./video/kdenlive
./web/qutebrowser/default.nix
];

View file

@ -0,0 +1,29 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.gaming.lutris;
in
{
options.modules.gaming.lutris = {
enable = mkEnableOption "enable Lutris Gaming preservation platform";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
( lutris.override {
extraLibraries = pkgs: [
wine
xorg.libXcursor
xorg.libXi
xorg.libXinerama
xorg.libXScrnSaver
libpng
libpulseaudio
libvorbis
stdenv.cc.cc.lib
libkrb5
keyutils
];
})
];
};
}

View file

@ -0,0 +1,6 @@
_:
{
imports = [
./gaming/steam
];
}

View file

@ -0,0 +1,28 @@
{ lib, config, ... }:
with lib;
let
cfg = config.modules.gaming.steam;
in
{
options.modules.gaming.steam = {
enable = mkEnableOption "Enable Steam Platform";
gamescope = mkOption {
type = types.bool;
default = false;
description = "enable gamescope session (default false)";
};
gamemode = mkOption {
type = types.bool;
default = false;
description = "enable Feral Gamemode (default false)";
};
};
config = mkIf cfg.enable {
programs.gamemode.enable = cfg.gamemode;
programs.gamescope.enable = cfg.gamescope;
programs.steam = {
enable = true;
};
};
}

View file

@ -3,6 +3,8 @@
imports =
[ # Include the results of the hardware scan.
../hosts/${hostname}/hardware-configuration.nix
../hosts/${hostname}/nixos-config.nix
../modules/nixos
./includes/hardware/bootloader.nix
./includes/system/locales.nix
./includes/system/flakes.nix
@ -20,12 +22,6 @@
./includes/desktop/xdg-portal.nix
]
else []
) ++ (
if hostConfig.gaming then
[
./includes/gaming/steam.nix
]
else []
) ++ (
if hostConfig.laptop then
[
@ -72,7 +68,7 @@
];
imports = [
../hosts/${hostname}/home.nix
../hosts/${hostname}/home-config.nix
../modules/home-manager/default.nix
../home-manager/cli
] ++ (if hostConfig.desktop then
@ -86,10 +82,6 @@
../home-manager/mpv
]
else []
) ++ (
if hostConfig.gaming then
[ ../home-manager/lutris.nix ]
else []
) ++ lib.optional (
builtins.pathExists ../home-manager/hosts/${hostname}.nix
) ../home-manager/hosts/${hostname}.nix;