Update FredOS-Macbook.nix
This commit is contained in:
parent
e93e47f44b
commit
9620282c81
1 changed files with 54 additions and 70 deletions
|
|
@ -1,77 +1,61 @@
|
||||||
# hosts/FredOS-Gaming.nix
|
|
||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
config = lib.mkIf (config.networking.hostName == "FredOS-Gaming") {
|
config = lib.mkMerge [
|
||||||
environment.systemPackages = with pkgs; [
|
{
|
||||||
lutris
|
nixpkgs.config.allowInsecurePredicate = pkg:
|
||||||
heroic
|
(lib.hasPrefix "broadcom-sta" (lib.getName pkg));
|
||||||
];
|
}
|
||||||
|
|
||||||
programs.steam = {
|
(lib.mkIf (config.networking.hostName == "FredOS-Macbook") {
|
||||||
|
# ... all your other settings (tlp, boot, firmware) ...
|
||||||
|
environment.systemPackages = with pkgs; [ tlp ];
|
||||||
|
services.tlp.enable = false;
|
||||||
|
services.power-profiles-daemon.enable = true;
|
||||||
|
|
||||||
|
hardware.facetimehd.enable = true;
|
||||||
|
|
||||||
|
boot = {
|
||||||
|
loader = {
|
||||||
|
systemd-boot.enable = true;
|
||||||
|
efi.canTouchEfiVariables = true;
|
||||||
|
};
|
||||||
|
extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
|
||||||
|
blacklistedKernelModules = [ "b43" "bcma" "ssb" ];
|
||||||
|
};
|
||||||
|
hardware.enableRedistributableFirmware = true;
|
||||||
|
|
||||||
|
# Enable Bluetooth
|
||||||
|
hardware.bluetooth = {
|
||||||
enable = true;
|
enable = true;
|
||||||
remotePlay.openFirewall = true;
|
powerOnBoot = true;
|
||||||
package = pkgs.steam.override {
|
settings = {
|
||||||
extraPkgs = pkgs: with pkgs; [
|
General = {
|
||||||
adwaita-icon-theme
|
Enable = "Source,Sink,Media,Socket";
|
||||||
];
|
Experimental = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Steam icon fix script
|
# PipeWire with Bluetooth support
|
||||||
systemd.user.services.steam-icon-fix = {
|
services.pipewire = {
|
||||||
description = "Fix Steam Proton game icons";
|
|
||||||
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "oneshot";
|
|
||||||
RemainAfterExit = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
script = ''
|
|
||||||
STEAM_DIR="$HOME/.local/share/Steam"
|
|
||||||
DESKTOP_DIR="$HOME/.local/share/applications"
|
|
||||||
ICON_DIR="$HOME/.local/share/icons"
|
|
||||||
|
|
||||||
# Search all desktop files for steam_icon references
|
|
||||||
${pkgs.gnugrep}/bin/grep -l "Icon=steam_icon_" "$DESKTOP_DIR"/*.desktop 2>/dev/null | while read desktop_file; do
|
|
||||||
# Extract the app_id from the Icon line
|
|
||||||
app_id=$(${pkgs.gnugrep}/bin/grep "Icon=steam_icon_" "$desktop_file" | ${pkgs.gnused}/bin/sed 's/Icon=steam_icon_//')
|
|
||||||
|
|
||||||
# Check if icon already exists
|
|
||||||
if [ -f "$ICON_DIR/hicolor/256x256/apps/steam_icon_$app_id.png" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Find the actual icon file
|
|
||||||
icon_file=$(find "$STEAM_DIR/appcache/librarycache/$app_id" -name "*.jpg" 2>/dev/null | head -n 1)
|
|
||||||
|
|
||||||
if [ -f "$icon_file" ]; then
|
|
||||||
# Copy icon to multiple sizes
|
|
||||||
for size in 48x48 64x64 128x128 256x256; do
|
|
||||||
mkdir -p "$ICON_DIR/hicolor/$size/apps/"
|
|
||||||
cp "$icon_file" "$ICON_DIR/hicolor/$size/apps/steam_icon_$app_id.png"
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Fixed icon for $(basename "$desktop_file"): App ID $app_id"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
# Bootloader
|
|
||||||
boot.loader.systemd-boot.enable = true;
|
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
|
||||||
boot.loader.timeout = 1;
|
|
||||||
|
|
||||||
system.autoUpgrade = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
dates = "daily";
|
alsa.enable = true;
|
||||||
persistent = true;
|
pulse.enable = true;
|
||||||
allowReboot = false;
|
|
||||||
channel = "https://nixos.org/channels/nixos-unstable";
|
# Add Bluetooth codec config
|
||||||
flags = [
|
wireplumber.configPackages = [
|
||||||
"--upgrade"
|
(pkgs.writeTextDir "share/wireplumber/bluetooth.lua.d/51-bluez-config.lua" ''
|
||||||
"--option" "tarball-ttl" "0"
|
bluez_monitor.properties = {
|
||||||
|
["bluez5.enable-sbc-xq"] = true,
|
||||||
|
["bluez5.enable-msbc"] = true,
|
||||||
|
["bluez5.enable-hw-volume"] = true,
|
||||||
|
["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]"
|
||||||
|
}
|
||||||
|
'')
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
})
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue