Compare commits
No commits in common. "5364812171e1aa39e45f36fc535b4d0426d9c50f" and "2efa87f90c00e5bd9bc732635ccf28de6200a646" have entirely different histories.
5364812171
...
2efa87f90c
16
flake.nix
16
flake.nix
|
|
@ -48,6 +48,7 @@
|
|||
let
|
||||
system = "x86_64-linux";
|
||||
username = "josh";
|
||||
profile = "desktop";
|
||||
homePath = ./. + "/users/${username}/home.nix";
|
||||
|
||||
pkgs = import nixpkgs {
|
||||
|
|
@ -59,7 +60,6 @@
|
|||
mkHost =
|
||||
{
|
||||
host,
|
||||
profile,
|
||||
extraModules ? [ ],
|
||||
}:
|
||||
nixpkgs.lib.nixosSystem {
|
||||
|
|
@ -79,19 +79,12 @@
|
|||
in
|
||||
{
|
||||
nixosConfigurations = {
|
||||
laptop = mkHost {
|
||||
host = "laptop";
|
||||
profile = "gaming";
|
||||
};
|
||||
laptop = mkHost { host = "laptop"; };
|
||||
|
||||
vm = mkHost {
|
||||
host = "vm";
|
||||
profile = "desktop";
|
||||
};
|
||||
vm = mkHost { host = "vm"; };
|
||||
|
||||
live = mkHost {
|
||||
host = "installation-iso";
|
||||
profile = "desktop";
|
||||
extraModules = [
|
||||
(nixpkgs + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix")
|
||||
{ environment.systemPackages = [ install-system.packages.${system}.default ]; }
|
||||
|
|
@ -101,8 +94,7 @@
|
|||
|
||||
homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration {
|
||||
extraSpecialArgs = {
|
||||
inherit inputs username;
|
||||
profile = "desktop";
|
||||
inherit inputs profile username;
|
||||
};
|
||||
inherit pkgs;
|
||||
modules = [
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
{
|
||||
profile,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
../../profiles/${profile}
|
||||
../../profiles/desktop
|
||||
|
||||
../../modules/nixos
|
||||
../../modules/drivers
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
{
|
||||
profile,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
../../profiles/${profile}
|
||||
../../profiles/desktop
|
||||
|
||||
../../modules/nixos
|
||||
../../modules/drivers
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
{
|
||||
profile,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
../../profiles/${profile}
|
||||
../../profiles/desktop
|
||||
|
||||
../../modules/nixos
|
||||
../../modules/drivers
|
||||
|
|
|
|||
|
|
@ -1,48 +0,0 @@
|
|||
{
|
||||
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,7 +3,6 @@
|
|||
}:
|
||||
{
|
||||
imports = [
|
||||
./battlenet.nix
|
||||
./direnv.nix
|
||||
./discord.nix
|
||||
./dictation.nix
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
{
|
||||
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,7 +3,6 @@
|
|||
}:
|
||||
{
|
||||
imports = [
|
||||
./battlenet.nix
|
||||
./boot.nix
|
||||
./dev.nix
|
||||
./fonts.nix
|
||||
|
|
|
|||
|
|
@ -19,27 +19,6 @@ in
|
|||
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
|
||||
security.rtkit.enable = true;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
{
|
||||
options.modules.battlenet = {
|
||||
enable = mkEnableOption "Battle.net via Lutris/Wine";
|
||||
};
|
||||
}
|
||||
|
|
@ -3,7 +3,6 @@
|
|||
}:
|
||||
{
|
||||
imports = [
|
||||
./battlenet.nix
|
||||
./discord.nix
|
||||
./dictation.nix
|
||||
./dev.nix
|
||||
|
|
|
|||
|
|
@ -29,4 +29,6 @@
|
|||
modules.screenshot.enable = true;
|
||||
|
||||
modules.tailscale.enable = true;
|
||||
|
||||
modules.steam.enable = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
../desktop
|
||||
];
|
||||
|
||||
modules.steam.enable = true;
|
||||
|
||||
modules.battlenet.enable = true;
|
||||
}
|
||||
Loading…
Reference in New Issue