refactor(hardware): add options to module file
This commit is contained in:
parent
a9f0e4317a
commit
776f44f0bb
4 changed files with 26 additions and 25 deletions
|
|
@ -1,11 +0,0 @@
|
||||||
{ lib, config, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.systemModules.hardware.backlight;
|
|
||||||
in
|
|
||||||
|
|
||||||
{
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
hardware.brillo.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
16
system/modules/hardware/backlight/default.nix
Normal file
16
system/modules/hardware/backlight/default.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
{ lib, config, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.systemModules.hardware.backlight;
|
||||||
|
inherit (lib) mkIf mkEnableOption;
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
options.systemModules.hardware.backlight = {
|
||||||
|
enable = mkEnableOption "Enable backlight module";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
hardware.brillo.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -2,10 +2,16 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.systemModules.hardware.bluetooth;
|
cfg = config.systemModules.hardware.bluetooth;
|
||||||
|
inherit (lib) mkIf mkEnableOption;
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
config = lib.mkIf cfg.enable {
|
options.systemModules.hardware.bluetooth = {
|
||||||
|
enable = mkEnableOption "Enable bluetooth module";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
hardware.bluetooth = {
|
hardware.bluetooth = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.bluez5-experimental;
|
package = pkgs.bluez5-experimental;
|
||||||
|
|
@ -1,17 +1,7 @@
|
||||||
{ lib, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./bluetooth.nix
|
./bluetooth
|
||||||
./backlight.nix
|
./backlight
|
||||||
|
./ssd
|
||||||
];
|
];
|
||||||
|
|
||||||
options.systemModules.hardware = {
|
|
||||||
bluetooth = {
|
|
||||||
enable = lib.mkEnableOption "Enable bluetooth module";
|
|
||||||
};
|
|
||||||
backlight= {
|
|
||||||
enable = lib.mkEnableOption "Enable backlight module";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue