hardware/form: add form module with common forms

This commit is contained in:
Infinidoge 2021-11-21 00:24:57 -05:00
parent fb6e71dadc
commit 9082dd0de4
7 changed files with 50 additions and 17 deletions

View file

@ -0,0 +1,43 @@
{ config, lib, ... }:
with lib;
with lib.hlissner;
let
cfg = config.modules.hardware.form;
in
{
options.modules.hardware.form = with types; {
desktop = mkBoolOpt false;
laptop = mkBoolOpt false;
portable = mkBoolOpt false;
raspi = mkBoolOpt false;
server = mkBoolOpt false;
};
config = mkMerge [
(mkIf cfg.desktop {
modules.hardware.audio.enable = true;
})
(mkIf cfg.laptop {
modules.hardware.audio.enable = true;
services = {
xserver.libinput = {
enable = true;
touchpad.naturalScrolling = true;
};
logind.lidSwitch = "ignore";
};
environment = {
variables.LAPTOP = "True";
systemPackages = with pkgs; [ acpi ];
};
})
(mkIf cfg.portable { })
(mkIf cfg.raspi { })
(mkIf cfg.server { })
];
}