more refactoring with default.nix

This commit is contained in:
Noah Masur 2022-04-26 19:59:55 -04:00
parent 523a53f607
commit 9e12221b43
5 changed files with 30 additions and 12 deletions

View File

@ -1,5 +1,7 @@
{ config, ... }: {
imports = [ ./leagueoflegends.nix ./lutris.nix ./steam.nix ];
config = {
hardware.opengl = {
enable = true;

View File

@ -1,9 +1,15 @@
{ config, pkgs, ... }:
{ config, pkgs, lib, ... }:
{
imports = [ ./common.nix ./lutris.nix ];
with lib;
let cfg = config.modules.gaming.leagueoflegends;
config = {
in {
options.modules.gaming.leagueoflegends = {
enable = mkEnableOption "leagueoflegends";
};
config = mkIf cfg.enable {
# League of Legends anti-cheat
boot.kernel.sysctl = { "abi.vsyscall32" = 0; };

View File

@ -1,9 +1,14 @@
{ config, pkgs, ... }:
{ config, pkgs, lib, ... }:
{
with lib;
let cfg = config.modules.gaming.lutris;
imports = [ ./common.nix ];
in {
config = { environment.systemPackages = with pkgs; [ lutris amdvlk wine ]; };
options.modules.gaming.lutris = { enable = mkEnableOption "lutris"; };
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ lutris amdvlk wine ];
};
}

View File

@ -1,8 +1,13 @@
{ config, pkgs, ... }: {
{ config, pkgs, lib, ... }:
imports = [ ./common.nix ];
with lib;
let cfg = config.modules.gaming.steam;
config = {
in {
options.modules.gaming.steam = { enable = mkEnableOption "steam"; };
config = mkIf cfg.enable {
hardware.steam-hardware.enable = true;
environment.systemPackages = with pkgs; [ steam ];
};

View File

@ -9,7 +9,7 @@
/etc/nixos/hardware-configuration.nix
../modules/system/timezone.nix
../modules/system/doas.nix
../modules/gaming/steam.nix
../modules/gaming
];
nixpkgs.config.allowUnfree = true;