Update FredOS-Macbook.nix

This commit is contained in:
ediblerope 2026-01-05 10:19:12 +00:00 committed by GitHub
parent 59423f3299
commit e93e47f44b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,61 +1,77 @@
# hosts/FredOS-Gaming.nix
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
config = lib.mkMerge [ config = lib.mkIf (config.networking.hostName == "FredOS-Gaming") {
{ environment.systemPackages = with pkgs; [
nixpkgs.config.allowInsecurePredicate = pkg: lutris
(lib.hasPrefix "broadcom-sta" (lib.getName pkg)); heroic
} ];
(lib.mkIf (config.networking.hostName == "FredOS-Macbook") { programs.steam = {
# ... all your other settings (tlp, boot, firmware) ... enable = true;
environment.systemPackages = with pkgs; [ tlp ]; remotePlay.openFirewall = true;
services.tlp.enable = false; package = pkgs.steam.override {
services.power-profiles-daemon.enable = true; extraPkgs = pkgs: with pkgs; [
adwaita-icon-theme
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;
powerOnBoot = true;
settings = {
General = {
Enable = "Source,Sink,Media,Socket";
Experimental = true;
}; };
}; };
};
# PipeWire with Bluetooth support
services.pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
# Add Bluetooth codec config # Steam icon fix script
wireplumber.configPackages = [ systemd.user.services.steam-icon-fix = {
(pkgs.writeTextDir "share/wireplumber/bluetooth.lua.d/51-bluez-config.lua" '' description = "Fix Steam Proton game icons";
bluez_monitor.properties = {
["bluez5.enable-sbc-xq"] = true, serviceConfig = {
["bluez5.enable-msbc"] = true, Type = "oneshot";
["bluez5.enable-hw-volume"] = true, RemainAfterExit = false;
["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]" };
}
'') 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;
dates = "daily";
persistent = true;
allowReboot = false;
channel = "https://nixos.org/channels/nixos-unstable";
flags = [
"--upgrade"
"--option" "tarball-ttl" "0"
];
};
}; };
})
];
} }