Compare commits
4 Commits
2efa87f90c
...
5364812171
| Author | SHA1 | Date |
|---|---|---|
|
|
5364812171 | |
|
|
eb480a205c | |
|
|
79ba19161f | |
|
|
0a34d3f062 |
16
flake.nix
16
flake.nix
|
|
@ -48,7 +48,6 @@
|
||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
username = "josh";
|
username = "josh";
|
||||||
profile = "desktop";
|
|
||||||
homePath = ./. + "/users/${username}/home.nix";
|
homePath = ./. + "/users/${username}/home.nix";
|
||||||
|
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
|
|
@ -60,6 +59,7 @@
|
||||||
mkHost =
|
mkHost =
|
||||||
{
|
{
|
||||||
host,
|
host,
|
||||||
|
profile,
|
||||||
extraModules ? [ ],
|
extraModules ? [ ],
|
||||||
}:
|
}:
|
||||||
nixpkgs.lib.nixosSystem {
|
nixpkgs.lib.nixosSystem {
|
||||||
|
|
@ -79,12 +79,19 @@
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
laptop = mkHost { host = "laptop"; };
|
laptop = mkHost {
|
||||||
|
host = "laptop";
|
||||||
|
profile = "gaming";
|
||||||
|
};
|
||||||
|
|
||||||
vm = mkHost { host = "vm"; };
|
vm = mkHost {
|
||||||
|
host = "vm";
|
||||||
|
profile = "desktop";
|
||||||
|
};
|
||||||
|
|
||||||
live = mkHost {
|
live = mkHost {
|
||||||
host = "installation-iso";
|
host = "installation-iso";
|
||||||
|
profile = "desktop";
|
||||||
extraModules = [
|
extraModules = [
|
||||||
(nixpkgs + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix")
|
(nixpkgs + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix")
|
||||||
{ environment.systemPackages = [ install-system.packages.${system}.default ]; }
|
{ environment.systemPackages = [ install-system.packages.${system}.default ]; }
|
||||||
|
|
@ -94,7 +101,8 @@
|
||||||
|
|
||||||
homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration {
|
homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration {
|
||||||
extraSpecialArgs = {
|
extraSpecialArgs = {
|
||||||
inherit inputs profile username;
|
inherit inputs username;
|
||||||
|
profile = "desktop";
|
||||||
};
|
};
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
modules = [
|
modules = [
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
{
|
{
|
||||||
|
profile,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../../profiles/desktop
|
../../profiles/${profile}
|
||||||
|
|
||||||
../../modules/nixos
|
../../modules/nixos
|
||||||
../../modules/drivers
|
../../modules/drivers
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
{
|
{
|
||||||
|
profile,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../../profiles/desktop
|
../../profiles/${profile}
|
||||||
|
|
||||||
../../modules/nixos
|
../../modules/nixos
|
||||||
../../modules/drivers
|
../../modules/drivers
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
{
|
{
|
||||||
|
profile,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../../profiles/desktop
|
../../profiles/${profile}
|
||||||
|
|
||||||
../../modules/nixos
|
../../modules/nixos
|
||||||
../../modules/drivers
|
../../modules/drivers
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.battlenet;
|
||||||
|
yq = "${pkgs.yq}/bin/yq";
|
||||||
|
jq = "${pkgs.jq}/bin/jq";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
# Battle.net is installed manually through Lutris, which creates the game
|
||||||
|
# config and wine prefix outside of Home Manager's control. The Lutris
|
||||||
|
# installer script writes HardwareAcceleration "false" (software rendering,
|
||||||
|
# which breaks Battle.net's CEF UI repainting under XWayland), so patch it
|
||||||
|
# and the game env after every rebuild. Re-run the rebuild after installing
|
||||||
|
# Battle.net for these tweaks to land.
|
||||||
|
home.activation.battlenetClientTweaks = hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
|
shopt -s nullglob
|
||||||
|
for game in "$HOME"/.local/share/lutris/games/battlenet*.yml; do
|
||||||
|
prefix=$(${yq} -r '.game.prefix // ""' "$game" 2>/dev/null) || continue
|
||||||
|
|
||||||
|
for configFile in "$prefix"/drive_c/users/*/AppData/Roaming/Battle.net/Battle.net.config; do
|
||||||
|
[ -e "$configFile" ] || continue
|
||||||
|
if [ "$(${jq} -r '.Client.HardwareAcceleration // ""' "$configFile" 2>/dev/null)" != "true" ]; then
|
||||||
|
${jq} '.Client.HardwareAcceleration = "true"' "$configFile" > "$configFile.tmp" && mv "$configFile.tmp" "$configFile"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# GE-Proton's Wayland driver breaks Battle.net's CEF window sizing and
|
||||||
|
# painting, and Xalia misrenders the client, so pin both off.
|
||||||
|
if [ "$(${yq} -r '.system.env.PROTON_USE_XALIA // ""' "$game" 2>/dev/null)" != "0" ]; then
|
||||||
|
${yq} --in-place --yaml-output '.system.env.PROTON_USE_XALIA = "0"' "$game"
|
||||||
|
fi
|
||||||
|
if [ "$(${yq} -r '.system.env.WINE_SIMULATE_WRITECOPY // ""' "$game" 2>/dev/null)" != "1" ]; then
|
||||||
|
${yq} --in-place --yaml-output '.system.env.WINE_SIMULATE_WRITECOPY = "1"' "$game"
|
||||||
|
fi
|
||||||
|
if [ -n "$(${yq} -r '.system.env.PROTON_ENABLE_WAYLAND // ""' "$game" 2>/dev/null)" ]; then
|
||||||
|
${yq} --in-place --yaml-output 'del(.system.env.PROTON_ENABLE_WAYLAND)' "$game"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
shopt -u nullglob
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./battlenet.nix
|
||||||
./direnv.nix
|
./direnv.nix
|
||||||
./discord.nix
|
./discord.nix
|
||||||
./dictation.nix
|
./dictation.nix
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.battlenet;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
# Battle.net games rely on 32-bit graphics libraries; Steam would
|
||||||
|
# normally force this on, but enable it independently as a fallback.
|
||||||
|
hardware.graphics.enable32Bit = mkDefault true;
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
lutris
|
||||||
|
wineWow64Packages.staging
|
||||||
|
winetricks
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./battlenet.nix
|
||||||
./boot.nix
|
./boot.nix
|
||||||
./dev.nix
|
./dev.nix
|
||||||
./fonts.nix
|
./fonts.nix
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,27 @@ in
|
||||||
jack.enable = true;
|
jack.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Re-enable PulseAudio-style auto profile switching (ACP), since
|
||||||
|
# WirePlumber 0.5 disables it and never reacts to HDMI hotplug events,
|
||||||
|
# leaving audio stuck on analog when a dock/TV is connected.
|
||||||
|
services.pipewire.wireplumber.extraConfig."99-acp-auto-profile" = {
|
||||||
|
"monitor.alsa.rules" = [
|
||||||
|
{
|
||||||
|
matches = [
|
||||||
|
{
|
||||||
|
"device.name" = "~alsa_card.*";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
actions = {
|
||||||
|
update-props = {
|
||||||
|
"api.acp.auto-profile" = true;
|
||||||
|
"api.acp.auto-port" = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
# Allows Pipewire to use the realtime scheduler for increased performance
|
# Allows Pipewire to use the realtime scheduler for increased performance
|
||||||
security.rtkit.enable = true;
|
security.rtkit.enable = true;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib;
|
||||||
|
{
|
||||||
|
options.modules.battlenet = {
|
||||||
|
enable = mkEnableOption "Battle.net via Lutris/Wine";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./battlenet.nix
|
||||||
./discord.nix
|
./discord.nix
|
||||||
./dictation.nix
|
./dictation.nix
|
||||||
./dev.nix
|
./dev.nix
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,4 @@
|
||||||
modules.screenshot.enable = true;
|
modules.screenshot.enable = true;
|
||||||
|
|
||||||
modules.tailscale.enable = true;
|
modules.tailscale.enable = true;
|
||||||
|
|
||||||
modules.steam.enable = true;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../desktop
|
||||||
|
];
|
||||||
|
|
||||||
|
modules.steam.enable = true;
|
||||||
|
|
||||||
|
modules.battlenet.enable = true;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue