clight: include location assertion
This commit is contained in:
parent
28d8bc7251
commit
13f9a356e0
1 changed files with 8 additions and 0 deletions
|
@ -63,6 +63,14 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = let
|
||||||
|
inRange = v: l: r: v >= l && v <= r;
|
||||||
|
in [
|
||||||
|
{ assertion = config.location.provider == "manual" ->
|
||||||
|
inRange config.location.latitude (-90) 90 && inRange config.location.longitude (-180) 180;
|
||||||
|
message = "You must specify a valid latitude and longitude if manually providing location"; }
|
||||||
|
];
|
||||||
|
|
||||||
boot.kernelModules = [ "i2c_dev" ];
|
boot.kernelModules = [ "i2c_dev" ];
|
||||||
environment.systemPackages = with pkgs; [ clight clightd ];
|
environment.systemPackages = with pkgs; [ clight clightd ];
|
||||||
services.dbus.packages = with pkgs; [ clight clightd ];
|
services.dbus.packages = with pkgs; [ clight clightd ];
|
||||||
|
|
Loading…
Reference in a new issue