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
|
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 {
|
||||||
|
|
@ -59,7 +60,6 @@
|
||||||
mkHost =
|
mkHost =
|
||||||
{
|
{
|
||||||
host,
|
host,
|
||||||
profile,
|
|
||||||
extraModules ? [ ],
|
extraModules ? [ ],
|
||||||
}:
|
}:
|
||||||
nixpkgs.lib.nixosSystem {
|
nixpkgs.lib.nixosSystem {
|
||||||
|
|
@ -79,19 +79,12 @@
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
laptop = mkHost {
|
laptop = mkHost { host = "laptop"; };
|
||||||
host = "laptop";
|
|
||||||
profile = "gaming";
|
|
||||||
};
|
|
||||||
|
|
||||||
vm = mkHost {
|
vm = mkHost { host = "vm"; };
|
||||||
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 ]; }
|
||||||
|
|
@ -101,8 +94,7 @@
|
||||||
|
|
||||||
homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration {
|
homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration {
|
||||||
extraSpecialArgs = {
|
extraSpecialArgs = {
|
||||||
inherit inputs username;
|
inherit inputs profile username;
|
||||||
profile = "desktop";
|
|
||||||
};
|
};
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
modules = [
|
modules = [
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
{
|
{
|
||||||
profile,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../../profiles/${profile}
|
../../profiles/desktop
|
||||||
|
|
||||||
../../modules/nixos
|
../../modules/nixos
|
||||||
../../modules/drivers
|
../../modules/drivers
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
{
|
{
|
||||||
profile,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../../profiles/${profile}
|
../../profiles/desktop
|
||||||
|
|
||||||
../../modules/nixos
|
../../modules/nixos
|
||||||
../../modules/drivers
|
../../modules/drivers
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
{
|
{
|
||||||
profile,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../../profiles/${profile}
|
../../profiles/desktop
|
||||||
|
|
||||||
../../modules/nixos
|
../../modules/nixos
|
||||||
../../modules/drivers
|
../../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 = [
|
imports = [
|
||||||
./battlenet.nix
|
|
||||||
./direnv.nix
|
./direnv.nix
|
||||||
./discord.nix
|
./discord.nix
|
||||||
./dictation.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 = [
|
imports = [
|
||||||
./battlenet.nix
|
|
||||||
./boot.nix
|
./boot.nix
|
||||||
./dev.nix
|
./dev.nix
|
||||||
./fonts.nix
|
./fonts.nix
|
||||||
|
|
|
||||||
|
|
@ -19,27 +19,6 @@ 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;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
with lib;
|
|
||||||
{
|
|
||||||
options.modules.battlenet = {
|
|
||||||
enable = mkEnableOption "Battle.net via Lutris/Wine";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./battlenet.nix
|
|
||||||
./discord.nix
|
./discord.nix
|
||||||
./dictation.nix
|
./dictation.nix
|
||||||
./dev.nix
|
./dev.nix
|
||||||
|
|
|
||||||
|
|
@ -29,4 +29,6 @@
|
||||||
modules.screenshot.enable = true;
|
modules.screenshot.enable = true;
|
||||||
|
|
||||||
modules.tailscale.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