Update FredOS-Macbook.nix

This commit is contained in:
ediblerope 2026-01-05 10:26:20 +00:00 committed by GitHub
parent e93e47f44b
commit 9620282c81
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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") {
enable = true; # ... all your other settings (tlp, boot, firmware) ...
remotePlay.openFirewall = true; environment.systemPackages = with pkgs; [ tlp ];
package = pkgs.steam.override { services.tlp.enable = false;
extraPkgs = pkgs: with pkgs; [ services.power-profiles-daemon.enable = true;
adwaita-icon-theme
]; hardware.facetimehd.enable = true;
};
}; boot = {
loader = {
# Steam icon fix script systemd-boot.enable = true;
systemd.user.services.steam-icon-fix = { efi.canTouchEfiVariables = true;
description = "Fix Steam Proton game icons"; };
extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
serviceConfig = { blacklistedKernelModules = [ "b43" "bcma" "ssb" ];
Type = "oneshot"; };
RemainAfterExit = false; hardware.enableRedistributableFirmware = true;
};
# Enable Bluetooth
script = '' hardware.bluetooth = {
STEAM_DIR="$HOME/.local/share/Steam" enable = true;
DESKTOP_DIR="$HOME/.local/share/applications" powerOnBoot = true;
ICON_DIR="$HOME/.local/share/icons" settings = {
General = {
# Search all desktop files for steam_icon references Enable = "Source,Sink,Media,Socket";
${pkgs.gnugrep}/bin/grep -l "Icon=steam_icon_" "$DESKTOP_DIR"/*.desktop 2>/dev/null | while read desktop_file; do Experimental = true;
# 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 # PipeWire with Bluetooth support
continue services.pipewire = {
fi enable = true;
alsa.enable = true;
# Find the actual icon file pulse.enable = true;
icon_file=$(find "$STEAM_DIR/appcache/librarycache/$app_id" -name "*.jpg" 2>/dev/null | head -n 1)
# Add Bluetooth codec config
if [ -f "$icon_file" ]; then wireplumber.configPackages = [
# Copy icon to multiple sizes (pkgs.writeTextDir "share/wireplumber/bluetooth.lua.d/51-bluez-config.lua" ''
for size in 48x48 64x64 128x128 256x256; do bluez_monitor.properties = {
mkdir -p "$ICON_DIR/hicolor/$size/apps/" ["bluez5.enable-sbc-xq"] = true,
cp "$icon_file" "$ICON_DIR/hicolor/$size/apps/steam_icon_$app_id.png" ["bluez5.enable-msbc"] = true,
done ["bluez5.enable-hw-volume"] = true,
["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]"
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"
];
};
};
} }