-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ce34c4
commit bf300e3
Showing
10 changed files
with
205 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
./desktop | ||
./dev | ||
./fonts.nix | ||
./games | ||
./home.nix | ||
./laptop | ||
./minimal.nix | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ lib, config, ... }: | ||
|
||
let | ||
inherit (config.meta) username; | ||
cfg = config.nixos.games.corectrl; | ||
in | ||
{ | ||
options.nixos.games.corectrl.enable = lib.mkEnableOption "corectrl config" // { | ||
default = config.nixos.games.enable && (config.nixos.games.gpu == "amd"); | ||
}; | ||
|
||
config = lib.mkIf cfg.enable { | ||
programs.corectrl = { | ||
enable = true; | ||
gpuOverclock.enable = true; | ||
}; | ||
|
||
# Added user to groups | ||
users.users.${username}.extraGroups = [ "corectrl" ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ pkgs, lib, config, ... }: | ||
|
||
let | ||
cfg = config.nixos.games; | ||
nvidia-offload = lib.findFirst (p: lib.isDerivation p && p.name == "nvidia-offload") | ||
null | ||
config.environment.systemPackages; | ||
in | ||
{ | ||
imports = [ | ||
./corectrl.nix | ||
./osu.nix | ||
./ratbag.nix | ||
./retroarch.nix | ||
./steam.nix | ||
]; | ||
|
||
options.nixos.games = { | ||
enable = lib.mkEnableOption "games config"; | ||
gpu = lib.mkOption { | ||
type = lib.types.nullOr (lib.types.enum [ "amd" "intel" "nvidia" ]); | ||
default = null; | ||
description = "GPU maker."; | ||
}; | ||
}; | ||
|
||
config = lib.mkIf cfg.enable { | ||
# Fix: MESA-INTEL: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0 | ||
boot.kernelParams = lib.mkIf (cfg.gpu == "intel") [ "dev.i915.perf_stream_paranoid=0" ]; | ||
|
||
environment = { | ||
systemPackages = with pkgs; [ | ||
lutris | ||
]; | ||
|
||
# Use nvidia-offload script in gamemode | ||
variables.GAMEMODERUNEXEC = lib.mkIf (cfg.gpu == "nvidia" && nvidia-offload != null) | ||
"${nvidia-offload}/bin/nvidia-offload"; | ||
}; | ||
|
||
programs.gamemode = { | ||
enable = true; | ||
settings = { | ||
general = { | ||
softrealtime = "auto"; | ||
renice = 10; | ||
}; | ||
custom = { | ||
start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'"; | ||
end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'"; | ||
}; | ||
}; | ||
}; | ||
|
||
# Alternative driver for Xbox One/Series S/Series X controllers | ||
hardware.xone.enable = true; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ pkgs, lib, config, ... }: | ||
|
||
let | ||
cfg = config.nixos.games.osu; | ||
in | ||
{ | ||
options.nixos.games.osu.enable = lib.mkEnableOption "osu! config" // { | ||
default = config.nixos.games.enable; | ||
}; | ||
|
||
config = lib.mkIf cfg.enable { | ||
environment.systemPackages = with pkgs; let | ||
import-osu-songs = pkgs.writeShellApplication { | ||
name = "import-osu-songs"; | ||
runtimeInputs = [ pkgs.coreutils ]; | ||
text = '' | ||
declare -r $osu_dir="$HOME/.osu" | ||
if [[ ! -d "$osu_dir" ]]; then | ||
>&2 echo "'$osu_dir' directory not found! Start 'osu-stable' once to create it." | ||
exit 1 | ||
fi | ||
declare -r osu_song_dir="$osu_dir/drive_c/osu/Songs" | ||
mkdir -p "$osu_song_dir" | ||
cp -v "''${@}" "$osu_song_dir" | ||
''; | ||
}; | ||
in | ||
[ | ||
gaming.osu-lazer-bin | ||
gaming.osu-stable | ||
import-osu-songs | ||
]; | ||
|
||
# Enable opentabletdriver | ||
hardware.opentabletdriver.enable = true; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ pkgs, lib, config, ... }: | ||
|
||
let | ||
cfg = config.nixos.games.ratbag; | ||
in | ||
{ | ||
options.nixos.games.ratbag.enable = lib.mkEnableOption "Ratbag/Piper (e.g. Logitech devices) config" // { | ||
default = config.nixos.games.enable; | ||
}; | ||
|
||
config = lib.mkIf cfg.enable { | ||
environment.systemPackages = with pkgs; [ piper ]; | ||
|
||
# Enable ratbagd (i.e.: piper) for Logitech devices | ||
services.ratbagd.enable = true; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ pkgs, lib, config, ... }: | ||
|
||
let | ||
cfg = config.nixos.games.retroarch; | ||
in | ||
{ | ||
options.nixos.games.retroarch = { | ||
enable = lib.mkEnableOption "RetroArch config" // { | ||
default = config.nixos.games.enable; | ||
}; | ||
package = lib.mkPackageOption pkgs "retroarch" { | ||
default = "retroarchFull"; | ||
}; | ||
}; | ||
|
||
config = lib.mkIf cfg.enable { | ||
environment.systemPackages = [ | ||
cfg.package | ||
]; | ||
|
||
services.xserver.desktopManager.retroarch = { | ||
enable = true; | ||
package = cfg.package; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ pkgs, lib, config, ... }: | ||
|
||
let | ||
cfg = config.nixos.games.steam; | ||
in | ||
{ | ||
options.nixos.games.steam = { | ||
enable = lib.mkEnableOption "Steam config" // { | ||
default = config.nixos.games.enable; | ||
}; | ||
}; | ||
|
||
config = lib.mkIf cfg.enable { | ||
environment.systemPackages = with pkgs; [ | ||
gamescope | ||
mangohud | ||
]; | ||
|
||
programs = { | ||
gamescope = { | ||
args = [ "--rt" ]; | ||
capSysNice = true; | ||
}; | ||
|
||
steam = { | ||
enable = true; | ||
remotePlay.openFirewall = true; | ||
gamescopeSession = { | ||
enable = true; | ||
args = [ | ||
"--fsr-sharpness 10" | ||
"-U" | ||
"--adaptive-sync" | ||
]; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |