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
|
|
|
{
|
2026-04-01 21:14:16 +01:00
|
|
|
config = lib.mkIf (config.networking.hostName == "FredOS-Macbook") {
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
2026-08-19 17:50:59 +01:00
|
|
|
spotify
|
2026-08-20 16:52:47 +01:00
|
|
|
discordo
|
2026-08-21 09:39:39 +01:00
|
|
|
haruna
|
2026-06-01 15:29:25 +01:00
|
|
|
gnome-text-editor
|
2026-05-18 10:48:22 +01:00
|
|
|
proton-vpn
|
2026-04-01 21:14:16 +01:00
|
|
|
onlyoffice-desktopeditors
|
2026-08-01 22:25:01 +01:00
|
|
|
cmatrix
|
2026-04-01 21:14:16 +01:00
|
|
|
];
|
|
|
|
|
|
2026-06-01 15:29:25 +01:00
|
|
|
programs.geary.enable = true;
|
|
|
|
|
|
2026-05-16 12:42:27 +01:00
|
|
|
nix.settings.max-jobs = 0;
|
|
|
|
|
|
2026-07-29 17:24:25 +01:00
|
|
|
# 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;
|
2026-08-09 09:07:59 +01:00
|
|
|
# 2, not 4: each job is an xz/zstd decompress, and there are only 4 threads
|
|
|
|
|
# to share with the desktop. 4 just queues them behind each other.
|
|
|
|
|
nix.settings.max-substitution-jobs = 2;
|
2026-07-29 17:24:25 +01:00
|
|
|
|
2026-04-01 21:14:16 +01:00
|
|
|
services.power-profiles-daemon.enable = true;
|
2026-08-07 14:20:54 +01:00
|
|
|
|
2026-08-09 09:18:06 +01:00
|
|
|
# The SMC holds the fan at its 1200 RPM floor while the package sits at
|
|
|
|
|
# 79C — measured 1210 RPM at settled idle. (An earlier 5813 RPM reading
|
|
|
|
|
# was a rebuild spinning down, not the steady state.) Nothing in-tree
|
2026-08-19 16:53:20 +01:00
|
|
|
# ramps applesmc, so drive it directly. Tjmax is 100C and thermald throttles
|
|
|
|
|
# long before that, so no reason for the fan to leave its floor in the 60s.
|
2026-08-09 09:18:06 +01:00
|
|
|
services.mbpfan = {
|
|
|
|
|
enable = true;
|
|
|
|
|
settings.general = {
|
2026-08-19 16:53:20 +01:00
|
|
|
low_temp = 68; # below this, coast at minimum
|
|
|
|
|
high_temp = 80; # start climbing here
|
|
|
|
|
max_temp = 92; # full tilt, still 8C under Tjmax
|
2026-08-09 09:18:06 +01:00
|
|
|
};
|
|
|
|
|
};
|
2026-08-07 14:20:54 +01:00
|
|
|
|
|
|
|
|
# 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;
|
2026-06-11 11:03:24 +01:00
|
|
|
# Quickshell's battery widget reads org.freedesktop.UPower over DBus
|
|
|
|
|
services.upower.enable = true;
|
2026-04-01 21:14:16 +01:00
|
|
|
|
|
|
|
|
boot.loader.systemd-boot.configurationLimit = 5;
|
|
|
|
|
boot.initrd.systemd.enable = true;
|
2026-05-14 10:44:32 +01:00
|
|
|
|
2026-07-16 11:57:38 +01:00
|
|
|
# Swap Fn and left Ctrl on the internal Apple keyboard (PC layout)
|
|
|
|
|
boot.kernelParams = [ "hid_apple.swap_fn_leftctrl=1" ];
|
|
|
|
|
|
2026-05-17 12:58:06 +01:00
|
|
|
# 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
|
|
|
};
|
|
|
|
|
|
2026-07-16 21:18:56 +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
|
|
|
|
|
'';
|
|
|
|
|
|
2026-05-17 13:47:59 +01:00
|
|
|
home-manager.users.fred = { pkgs, ... }: {
|
2026-05-17 20:38:30 +01:00
|
|
|
wayland.windowManager.hyprland.settings.monitor = [{
|
|
|
|
|
output = "";
|
|
|
|
|
mode = "preferred";
|
|
|
|
|
position = "auto";
|
|
|
|
|
scale = "auto";
|
|
|
|
|
}];
|
2026-05-17 13:18:26 +01:00
|
|
|
|
2026-05-18 16:53:12 +01:00
|
|
|
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" ];
|
|
|
|
|
};
|
|
|
|
|
|
2026-05-17 13:18:26 +01:00
|
|
|
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
|
|
|
};
|
2026-04-01 21:14:16 +01:00
|
|
|
};
|
2025-12-02 21:23:06 +00:00
|
|
|
}
|