summary refs log tree commit diff
path: root/nixos/modules/tasks/network-interfaces.nix
diff options
context:
space:
mode:
authorFlorian Jacob <projects+git@florianjacob.de>2017-11-09 20:27:33 +0100
committerFlorian Jacob <projects+git@florianjacob.de>2017-11-09 20:27:33 +0100
commitfe3751df8a7daa0d3ec72bda4c4a5b098b1530c0 (patch)
tree644574b93cd054ea7e320f9a8f3f83ccfb1f6d61 /nixos/modules/tasks/network-interfaces.nix
parentaec3326ca4aa7e5186da9fddcab7fdf8356865ab (diff)
downloadnixpkgs-fe3751df8a7daa0d3ec72bda4c4a5b098b1530c0.tar
nixpkgs-fe3751df8a7daa0d3ec72bda4c4a5b098b1530c0.tar.gz
nixpkgs-fe3751df8a7daa0d3ec72bda4c4a5b098b1530c0.tar.bz2
nixpkgs-fe3751df8a7daa0d3ec72bda4c4a5b098b1530c0.tar.lz
nixpkgs-fe3751df8a7daa0d3ec72bda4c4a5b098b1530c0.tar.xz
nixpkgs-fe3751df8a7daa0d3ec72bda4c4a5b098b1530c0.tar.zst
nixpkgs-fe3751df8a7daa0d3ec72bda4c4a5b098b1530c0.zip
nixos/network-interfaces: Add " around network interface names
in assertion messages to avoid misinterpretations when the interface name contains a dot.
Diffstat (limited to 'nixos/modules/tasks/network-interfaces.nix')
-rw-r--r--nixos/modules/tasks/network-interfaces.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/nixos/modules/tasks/network-interfaces.nix b/nixos/modules/tasks/network-interfaces.nix
index 1741d2c7e1f..b7e85e402aa 100644
--- a/nixos/modules/tasks/network-interfaces.nix
+++ b/nixos/modules/tasks/network-interfaces.nix
@@ -923,7 +923,9 @@ in
     assertions =
       (flip map interfaces (i: {
         assertion = i.subnetMask == null;
-        message = "The networking.interfaces.${i.name}.subnetMask option is defunct. Use prefixLength instead.";
+        message = ''
+          The networking.interfaces."${i.name}".subnetMask option is defunct. Use prefixLength instead.
+        '';
       })) ++ (flip map interfaces (i: {
         # With the linux kernel, interface name length is limited by IFNAMSIZ
         # to 16 bytes, including the trailing null byte.
@@ -934,7 +936,9 @@ in
         '';
       })) ++ (flip map slaveIfs (i: {
         assertion = i.ip4 == [ ] && i.ipAddress == null && i.ip6 == [ ] && i.ipv6Address == null;
-        message = "The networking.interfaces.${i.name} must not have any defined ips when it is a slave.";
+        message = ''
+          The networking.interfaces."${i.name}" must not have any defined ips when it is a slave.
+        '';
       })) ++ [
         {
           assertion = cfg.hostId == null || (stringLength cfg.hostId == 8 && isHexString cfg.hostId);