this repo has no description
1{
2 config,
3 lib,
4 ...
5}: {
6 options.cow.role-laptop = {
7 enable = lib.mkEnableOption "configuring a laptop with a GUI and bean setup for mobile use";
8 fingerPrintSensor = lib.mkEnableOption "fprintd and persist prints";
9 powersave =
10 (lib.mkEnableOption "power saving and battery health options with TLP")
11 // {
12 default = true;
13 };
14 };
15
16 config = lib.mkIf config.cow.role-laptop.enable {
17 home-manager.users.bean.cow = lib.mkIf config.cow.bean.enable {
18 music.enable = true;
19 qmplay2.enable = true;
20 sync.enable = true;
21 dev.enable = true;
22 };
23
24 cow = {
25 base.enable = true;
26 bean.enable = true;
27 firewall.openForUsers = true;
28 print.enable = true;
29 hm.enable = true;
30 network = {
31 enable = true;
32 bluetooth = true;
33 wireless = true;
34 };
35 cat.enable = true;
36 gdi = {
37 enable = true;
38 doIdle = true;
39 showGreet = true;
40 };
41 audio.enable = true;
42 imperm.keep = lib.optional config.cow.role-laptop.fingerPrintSensor "/var/lib/fprint";
43 };
44
45 # Set to null as TLP will manage the frequency governor for us
46 powerManagement.cpuFreqGovernor = lib.mkIf config.cow.role-laptop.powersave null;
47
48 services.tlp = lib.mkIf config.cow.role-laptop.powersave {
49 enable = true;
50 pd.enable = true;
51 settings = {
52 CPU_BOOST_ON_AC = 1;
53 CPU_BOOST_ON_BAT = 0;
54 CPU_SCALING_GOVERNOR_ON_AC = "performance";
55 CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
56 };
57 };
58
59 services.fprintd = lib.mkIf config.cow.role-laptop.fingerPrintSensor {
60 enable = true;
61 };
62 };
63}