nixos/azure: improve code readability

codgician 6c443658 c198f97a

Changed files
+7 -12
nixos
modules
+5 -10
nixos/modules/virtualisation/azure-common.nix
···
...
}:
-
with lib;
let
cfg = config.virtualisation.azure;
mlxDrivers = [
···
in
{
options.virtualisation.azure = {
-
acceleratedNetworking = mkOption {
+
acceleratedNetworking = lib.mkOption {
default = false;
description = "Whether the machine's network interface has enabled accelerated networking.";
};
···
services.openssh.settings.ClientAliveInterval = 180;
# Force getting the hostname from Azure
-
networking.hostName = mkDefault "";
+
networking.hostName = lib.mkDefault "";
# Always include cryptsetup so that NixOps can use it.
# sg_scan is needed to finalize disk removal on older kernels
···
networking.usePredictableInterfaceNames = false;
-
services.udev.extraRules =
-
with builtins;
-
concatStringsSep "\n" (
-
map (i: ''
-
ENV{DEVTYPE}=="disk", KERNEL!="sda" SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNELS=="?:0:0:${toString i}", ATTR{removable}=="0", SYMLINK+="disk/by-lun/${toString i}"
-
'') (lib.range 1 15)
-
);
+
services.udev.extraRules = lib.concatMapStrings (i: ''
+
ENV{DEVTYPE}=="disk", KERNEL!="sda" SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNELS=="?:0:0:${toString i}", ATTR{removable}=="0", SYMLINK+="disk/by-lun/${toString i}"
+
'') (lib.range 1 15);
};
}
+2 -2
nixos/modules/virtualisation/azure-config-user.nix
···
"${modulesPath}/virtualisation/azure-image.nix"
];
-
# Please update the VM Generation to the actual value
-
virtualisation.azureImage.vmGeneration = "v1";
+
# Please set the VM Generation to the actual value
+
# virtualisation.azureImage.vmGeneration = "v1";
}