redshift: add assertion on latitude and longitude
These two options must be set if the provider is set to "manual". Closes #841
This commit is contained in:
parent
e8dbc35613
commit
8bddc1adab
|
@ -123,6 +123,18 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion =
|
||||||
|
cfg.provider == "manual"
|
||||||
|
-> cfg.latitude != null && cfg.longitude != null;
|
||||||
|
message =
|
||||||
|
"Must provide services.redshift.latitude and"
|
||||||
|
+ " services.redshift.latitude when"
|
||||||
|
+ " services.redshift.provider is set to \"manual\".";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
systemd.user.services.redshift = {
|
systemd.user.services.redshift = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Redshift colour temperature adjuster";
|
Description = "Redshift colour temperature adjuster";
|
||||||
|
|
Loading…
Reference in a new issue