nixos/hosts/FredOS-Macbook.nix
rope a07759a40d macbook: drop DWT daemon, native libinput DWT works
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 21:27:56 +01:00

106 lines
3.3 KiB
Nix

{ config, pkgs, lib, inputs, ... }:
{
config = lib.mkIf (config.networking.hostName == "FredOS-Macbook") {
environment.systemPackages = with pkgs; [
tlp
vesktop
adwaita-icon-theme
mission-center
vlc
gnome-text-editor
proton-vpn
onlyoffice-desktopeditors
woeusb
vscodium
];
programs.geary.enable = true;
nix.settings.max-jobs = 0;
services.tlp.enable = false;
services.power-profiles-daemon.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;
# 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;
services.logind.settings.Login = {
HandleLidSwitch = "suspend";
HandleLidSwitchExternalPower = "suspend";
};
# 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";
}];
# wob reads 0-100 integers from a FIFO and shows a progress bar overlay
systemd.user.services.wob = {
Unit = {
Description = "Wayland OSD Bar";
After = [ "graphical-session.target" ];
PartOf = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart = "${pkgs.writeShellScript "wob-start" ''
rm -f "%t/wob.fifo"
mkfifo "%t/wob.fifo"
tail -f "%t/wob.fifo" | ${pkgs.wob}/bin/wob
''}";
ExecStopPost = "${pkgs.coreutils}/bin/rm -f %t/wob.fifo";
Restart = "on-failure";
};
Install.WantedBy = [ "graphical-session.target" ];
};
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" ];
};
};
};
}