summary refs log tree commit diff
path: root/nixos/modules/rename.nix
diff options
context:
space:
mode:
authorGregor Kleen <pngwjpgh@users.noreply.github.com>2017-01-02 18:01:42 +0100
committerGregor Kleen <pngwjpgh@users.noreply.github.com>2017-01-02 18:01:42 +0100
commit9383b2cf347c4181bbdd14b5c8bcb929e4cdcb8b (patch)
tree4994f70024428d1ef64a6516cb0de015528b1946 /nixos/modules/rename.nix
parent65f0ddbd534c1bd74d7fdbd8db3dff0d00a89c5a (diff)
downloadnixlib-9383b2cf347c4181bbdd14b5c8bcb929e4cdcb8b.tar
nixlib-9383b2cf347c4181bbdd14b5c8bcb929e4cdcb8b.tar.gz
nixlib-9383b2cf347c4181bbdd14b5c8bcb929e4cdcb8b.tar.bz2
nixlib-9383b2cf347c4181bbdd14b5c8bcb929e4cdcb8b.tar.lz
nixlib-9383b2cf347c4181bbdd14b5c8bcb929e4cdcb8b.tar.xz
nixlib-9383b2cf347c4181bbdd14b5c8bcb929e4cdcb8b.tar.zst
nixlib-9383b2cf347c4181bbdd14b5c8bcb929e4cdcb8b.zip
postgrey: backwards compatability
Diffstat (limited to 'nixos/modules/rename.nix')
-rw-r--r--nixos/modules/rename.nix11
1 files changed, 11 insertions, 0 deletions
diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix
index 8102e0e1f642..758f229d59d7 100644
--- a/nixos/modules/rename.nix
+++ b/nixos/modules/rename.nix
@@ -153,6 +153,17 @@ with lib;
     # alsa
     (mkRenamedOptionModule [ "sound" "enableMediaKeys" ] [ "sound" "mediaKeys" "enable" ])
 
+    # postgrey
+    (mkMergedOptionModule [ [ "services" "postgrey" "inetAddr" ] [ "services" "postgrey" "inetPort" ] ] [ "services" "postgrey" "socket" ] (config: let
+        value = p: getAttrFromPath p config;
+        inetAddr = [ "services" "postgrey" "inetAddr" ];
+        inetPort = [ "services" "postgrey" "inetPort" ];
+      in
+        if value inetAddr == null
+        then { path = "/var/run/postgrey.sock"; }
+        else { addr = value inetAddr; port = value inetPort; }
+    ))
+
     # Options that are obsolete and have no replacement.
     (mkRemovedOptionModule [ "boot" "initrd" "luks" "enable" ] "")
     (mkRemovedOptionModule [ "programs" "bash" "enable" ] "")