Add a night-light module
This commit is contained in:
parent
5961a65af5
commit
5aab908591
2 changed files with 26 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
outputs =
|
||||
{
|
||||
|
|
@ -19,5 +20,10 @@
|
|||
buildInputs = [ pkgs.dotnet-sdk_10 ];
|
||||
};
|
||||
}
|
||||
);
|
||||
)
|
||||
// {
|
||||
nixosModules = {
|
||||
night-light = import ./module.nix;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
19
module.nix
Normal file
19
module.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.services.nightLight;
|
||||
in
|
||||
{
|
||||
options.services.nightLight = {
|
||||
enable = mkEnableOption "Night Light";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.zigbee2mqtt.enable = true;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue