mirror of
https://github.com/nix-community/home-manager.git
synced 2024-12-14 11:57:55 +00:00
redshift: add assertion on latitude and longitude
These two options must be set if the provider is set to "manual".
Closes #841
(cherry picked from commit 8bddc1adab
)
This commit is contained in:
parent
8def383511
commit
ef64bc598f
1 changed files with 12 additions and 0 deletions
|
@ -123,6 +123,18 @@ in
|
|||
};
|
||||
|
||||
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 = {
|
||||
Unit = {
|
||||
Description = "Redshift colour temperature adjuster";
|
||||
|
|
Loading…
Reference in a new issue