nixos/hosts/FredOS-Macbook.nix

108 lines
3.6 KiB
Nix
Raw Normal View History

2026-03-28 13:42:35 +00:00
{ config, pkgs, lib, inputs, ... }:
2026-01-05 10:26:20 +00:00
2025-12-02 21:23:06 +00:00
{
config = lib.mkIf (config.networking.hostName == "FredOS-Macbook") {
environment.systemPackages = with pkgs; [
tlp
vesktop
2026-07-22 17:18:15 +01:00
faugus-launcher
mission-center
vlc
gnome-text-editor
proton-vpn
onlyoffice-desktopeditors
2026-05-02 00:38:42 -07:00
woeusb
2026-05-11 09:30:36 -07:00
vscodium
cmatrix
];
programs.geary.enable = true;
nix.settings.max-jobs = 0;
# max-jobs = 0 means an update is pure substitution, and nix's default
# 25 parallel HTTPS streams saturate the link hard enough that the
# out-of-tree broadcom_sta (wl) driver drops association mid-build —
# only a manual wifi reconnect brings it back. Cap the concurrency.
nix.settings.http-connections = 8;
nix.settings.max-substitution-jobs = 4;
services.tlp.enable = false;
services.power-profiles-daemon.enable = true;
# Linux leaves the Apple SMC fans at their minimum RPM — nothing in-tree
# ramps them. The CPU therefore sits at its thermal limit under any real
# load and throttles instead of spinning up. mbpfan drives applesmc.
services.mbpfan.enable = true;
# Haswell's own thermal management: throttle gradually via RAPL/P-states
# instead of waiting for the hardware's PROCHOT emergency brake.
services.thermald.enable = true;
# Zen eats the 8GB before zram can save it; without this the box hard-locks
# swapping instead of killing the tab that did it.
services.earlyoom.enable = true;
# Quickshell's battery widget reads org.freedesktop.UPower over DBus
services.upower.enable = true;
boot.loader.systemd-boot.configurationLimit = 5;
boot.initrd.systemd.enable = true;
2026-05-14 10:44:32 +01:00
# Swap Fn and left Ctrl on the internal Apple keyboard (PC layout)
boot.kernelParams = [ "hid_apple.swap_fn_leftctrl=1" ];
# Allow video group (fred) to write to /sys/class/backlight and /sys/class/leds
# (screen brightness and keyboard backlight)
hardware.acpilight.enable = true;
2026-05-15 12:17:12 +01:00
services.logind.settings.Login = {
HandleLidSwitch = "suspend";
HandleLidSwitchExternalPower = "suspend";
2026-05-15 12:12:04 +01:00
};
# systemd's hwdb tags USB touchpads external (no Apple exception
# upstream), so libinput refuses to offer DWT on the bcm5974
# (ID_INPUT_TOUCHPAD_INTEGRATION=external). Force internal so
# libinput's native DWT pairing with the internal keyboard works.
services.udev.extraHwdb = ''
touchpad:usb:v05acp0291:*
ID_INPUT_TOUCHPAD_INTEGRATION=internal
'';
home-manager.users.fred = { pkgs, ... }: {
wayland.windowManager.hyprland.settings.monitor = [{
output = "";
mode = "preferred";
position = "auto";
scale = "auto";
}];
systemd.user.services.nemo-warmup = {
Unit = {
Description = "Pre-warm Nemo file manager libraries";
After = [ "graphical-session.target" ];
PartOf = [ "graphical-session.target" ];
};
Service = {
Type = "oneshot";
ExecStart = "${pkgs.nemo}/bin/nemo --quit";
};
Install.WantedBy = [ "graphical-session.target" ];
};
systemd.user.services.kbd-backlight-init = {
Unit = {
Description = "Set keyboard backlight to 10% on login";
After = [ "graphical-session.target" ];
PartOf = [ "graphical-session.target" ];
};
Service = {
Type = "oneshot";
ExecStart = "${pkgs.brightnessctl}/bin/brightnessctl -d smc::kbd_backlight set 10%";
};
Install.WantedBy = [ "graphical-session.target" ];
};
2026-05-14 10:44:32 +01:00
};
};
2025-12-02 21:23:06 +00:00
}