modules: hardware: put modules into folders

This commit is contained in:
Bruno BELANYI 2021-09-25 15:08:43 +02:00
parent 7bec7ae0f9
commit 836b54b8eb
7 changed files with 6 additions and 6 deletions

View file

@ -0,0 +1,44 @@
{ config, lib, ... }:
let
cfg = config.my.hardware.upower;
in
{
options.my.hardware.upower = with lib; {
enable = mkEnableOption "upower configuration";
levels = {
low = mkOption {
type = types.ints.unsigned;
default = 25;
example = 10;
description = "Low percentage";
};
critical = mkOption {
type = types.ints.unsigned;
default = 15;
example = 5;
description = "Critical percentage";
};
action = mkOption {
type = types.ints.unsigned;
default = 5;
example = 3;
description = "Percentage at which point an action must be taken";
};
};
};
config = lib.mkIf cfg.enable {
services.upower = {
enable = true;
percentageLow = cfg.levels.low;
percentageCritical = cfg.levels.critical;
percentageAction = cfg.levels.action;
};
};
}