1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
{ config, lib, ... }: with lib; let cfg = config.local.hardware.laptop; in { options.local.hardware.laptop = { enable = mkEnableOption "laptop stuff"; }; config = mkIf cfg.enable { local.boot.impermanence.directories = [ "/var/lib/upower" ]; services = { tlp.enable = true; upower.enable = true; }; }; }