-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ config, lib, pkgs, ... }: | ||
|
||
with lib; | ||
|
||
let | ||
cfg = config.hardware.tuxedo-control-center; | ||
in | ||
{ | ||
options.hardware.tuxedo-control-center = { | ||
enable = mkEnableOption '' | ||
Tuxedo Control Center, the official fan and power management UI | ||
for Tuxedo laptops. | ||
This module does not offer any hardcoded configuration. So you | ||
will get the default configuration until you change it in the | ||
Tuxedo Control Center. | ||
''; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
|
||
hardware.tuxedo-keyboard.enable = true; | ||
boot.kernelModules = [ "tuxedo_io" ]; | ||
|
||
environment.systemPackages = [ | ||
pkgs.tuxedo-control-center | ||
]; | ||
|
||
services.dbus.packages = [ pkgs.tuxedo-control-center ]; | ||
|
||
systemd.services.tccd = { | ||
path = [ pkgs.tuxedo-control-center ]; | ||
|
||
description = "Tuxedo Control Center Service"; | ||
|
||
wantedBy = [ "multi-user.target" ]; | ||
|
||
serviceConfig = { | ||
Type = "simple"; | ||
ExecStart = "${pkgs.tuxedo-control-center}/bin/tccd --start"; | ||
ExecStop = "${pkgs.tuxedo-control-center}/bin/tccd --stop"; | ||
}; | ||
}; | ||
|
||
systemd.services.tccd-sleep = { | ||
path = [ pkgs.tuxedo-control-center ]; | ||
|
||
description = "Tuxedo Control Center Service (sleep/resume)"; | ||
|
||
wantedBy = [ "sleep.target" ]; | ||
|
||
unitConfig = { | ||
StopWhenUnneeded = "yes"; | ||
}; | ||
|
||
serviceConfig = { | ||
Type = "oneshot"; | ||
RemainAfterExit = "yes"; | ||
|
||
ExecStart = "systemctl stop tccd"; | ||
ExecStop = "systemctl start tccd"; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import ./make-test-python.nix ({ pkgs, lib, ... }: { | ||
name = "tuxedo"; | ||
|
||
meta = with pkgs.lib.maintainers; { | ||
maintainers = [ blitz ]; | ||
}; | ||
|
||
machine = | ||
{ ... }: | ||
|
||
{ | ||
hardware.tuxedo-control-center.enable = true; | ||
}; | ||
|
||
testScript = '' | ||
start_all(); | ||
machine.wait_for_unit("tccd.service") | ||
''; | ||
}) |