snowfall migration wip homepc done
This commit is contained in:
parent
ed08a98651
commit
25774148e4
37 changed files with 1943 additions and 1447 deletions
38
modules/nixos/hardware/battery/default.nix
Normal file
38
modules/nixos/hardware/battery/default.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
namespace,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with lib.${namespace}; let
|
||||
cfg = config.${namespace}.hardware.battery;
|
||||
in {
|
||||
options.${namespace}.hardware.battery = with types; {
|
||||
enable = mkBoolOpt false "If you have a battery in your hardware, enable this";
|
||||
batteryName = mkOpt str "BAT1" ''
|
||||
Put your battery name here. You can find it at "/sys/class/power_supply/"
|
||||
'';
|
||||
remainingEnergy = mkOpt str "charge_now" ''
|
||||
File in your battery, that tells the current amount of energy
|
||||
'';
|
||||
powerUsage = mkOpt str "current_now" ''
|
||||
File in your battery, that tells, how much energy your hardware is using
|
||||
'';
|
||||
scripts = {
|
||||
icon = mkOpt' str "";
|
||||
status = mkOpt' str "";
|
||||
time = mkOpt' str "";
|
||||
level = mkOpt' str "";
|
||||
labelAdaptive = mkOpt' str "";
|
||||
labelPercent = mkOpt' str "";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (import ./batteryStatus.nix {
|
||||
inherit config;
|
||||
inherit namespace;
|
||||
inherit pkgs;
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue