mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
nixos/azure: improve code readability
This commit is contained in:
parent
c198f97a75
commit
6c443658e6
2 changed files with 7 additions and 12 deletions
|
@ -5,7 +5,6 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with lib;
|
|
||||||
let
|
let
|
||||||
cfg = config.virtualisation.azure;
|
cfg = config.virtualisation.azure;
|
||||||
mlxDrivers = [
|
mlxDrivers = [
|
||||||
|
@ -16,7 +15,7 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.virtualisation.azure = {
|
options.virtualisation.azure = {
|
||||||
acceleratedNetworking = mkOption {
|
acceleratedNetworking = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
description = "Whether the machine's network interface has enabled accelerated networking.";
|
description = "Whether the machine's network interface has enabled accelerated networking.";
|
||||||
};
|
};
|
||||||
|
@ -68,7 +67,7 @@ in
|
||||||
services.openssh.settings.ClientAliveInterval = 180;
|
services.openssh.settings.ClientAliveInterval = 180;
|
||||||
|
|
||||||
# Force getting the hostname from Azure
|
# Force getting the hostname from Azure
|
||||||
networking.hostName = mkDefault "";
|
networking.hostName = lib.mkDefault "";
|
||||||
|
|
||||||
# Always include cryptsetup so that NixOps can use it.
|
# Always include cryptsetup so that NixOps can use it.
|
||||||
# sg_scan is needed to finalize disk removal on older kernels
|
# sg_scan is needed to finalize disk removal on older kernels
|
||||||
|
@ -79,12 +78,8 @@ in
|
||||||
|
|
||||||
networking.usePredictableInterfaceNames = false;
|
networking.usePredictableInterfaceNames = false;
|
||||||
|
|
||||||
services.udev.extraRules =
|
services.udev.extraRules = lib.concatMapStrings (i: ''
|
||||||
with builtins;
|
ENV{DEVTYPE}=="disk", KERNEL!="sda" SUBSYSTEM=="block", SUBSYSTEMS=="scsi", KERNELS=="?:0:0:${toString i}", ATTR{removable}=="0", SYMLINK+="disk/by-lun/${toString i}"
|
||||||
concatStringsSep "\n" (
|
'') (lib.range 1 15);
|
||||||
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)
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,6 @@
|
||||||
"${modulesPath}/virtualisation/azure-image.nix"
|
"${modulesPath}/virtualisation/azure-image.nix"
|
||||||
];
|
];
|
||||||
|
|
||||||
# Please update the VM Generation to the actual value
|
# Please set the VM Generation to the actual value
|
||||||
virtualisation.azureImage.vmGeneration = "v1";
|
# virtualisation.azureImage.vmGeneration = "v1";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue