git.iko.soy/typeable/nixpkgs
on master help sign in
Fix `services.redshift.provider` backwards-incompatibility (#68852)

Fix `services.redshift.provider` backwards-incompatibility

commit92e653b19b613bba25cdd7367fe039697d70ecdf authorSilvan Mosberger <contact@infinisil.com> dateSun 15 Sep 2019, 21:45 (7 years ago) parentca2910fe686b39
2 files changed+16−14
nixos/modules/rename.nix−14 nixos/modules/services/x11/redshift.nix+16
nixos/modules/rename.nix−14
@@ -273,20 +273,6 @@ with lib;
273273 (mkRenamedOptionModule [ "networking" "extraResolvconfConf" ] [ "networking" "resolvconf" "extraConfig" ])
274274 (mkRenamedOptionModule [ "networking" "resolvconfOptions" ] [ "networking" "resolvconf" "extraOptions" ])
275275
276− # Redshift
277− (mkChangedOptionModule [ "services" "redshift" "latitude" ] [ "location" "latitude" ]
278− (config:
279− let value = getAttrFromPath [ "services" "redshift" "latitude" ] config;
280− in if value == null then
281− throw "services.redshift.latitude is set to null, you can remove this"
282− else builtins.fromJSON value))
283− (mkChangedOptionModule [ "services" "redshift" "longitude" ] [ "location" "longitude" ]
284− (config:
285− let value = getAttrFromPath [ "services" "redshift" "longitude" ] config;
286− in if value == null then
287− throw "services.redshift.longitude is set to null, you can remove this"
288− else builtins.fromJSON value))
289−
290276 # Redis
291277 (mkRemovedOptionModule [ "services" "redis" "user" ] "The redis module now is hardcoded to the redis user.")
292278 (mkRemovedOptionModule [ "services" "redis" "dbpath" ] "The redis module now uses /var/lib/redis as data directory.")
nixos/modules/services/x11/redshift.nix+16
@@ -9,6 +9,22 @@ let
99
1010in {
1111
12+ imports = [
13+ (mkChangedOptionModule [ "services" "redshift" "latitude" ] [ "location" "latitude" ]
14+ (config:
15+ let value = getAttrFromPath [ "services" "redshift" "latitude" ] config;
16+ in if value == null then
17+ throw "services.redshift.latitude is set to null, you can remove this"
18+ else builtins.fromJSON value))
19+ (mkChangedOptionModule [ "services" "redshift" "longitude" ] [ "location" "longitude" ]
20+ (config:
21+ let value = getAttrFromPath [ "services" "redshift" "longitude" ] config;
22+ in if value == null then
23+ throw "services.redshift.longitude is set to null, you can remove this"
24+ else builtins.fromJSON value))
25+ (mkRenamedOptionModule [ "services" "redshift" "provider" ] [ "location" "provider" ])
26+ ];
27+
1228 options.services.redshift = {
1329 enable = mkOption {
1430 type = types.bool;