nixos/swap: trigger device readiness (#530286)
This commit is contained in:
@@ -106,6 +106,11 @@ let
|
||||
description = "Path of the device or swap file.";
|
||||
};
|
||||
|
||||
isDevice = mkOption {
|
||||
default = lib.substring 0 5 config.device == "/dev/";
|
||||
internal = true;
|
||||
};
|
||||
|
||||
label = mkOption {
|
||||
example = "swap";
|
||||
type = types.str;
|
||||
@@ -329,6 +334,7 @@ in
|
||||
)
|
||||
} ${sw.device} ${sw.deviceName}
|
||||
mkswap ${sw.realDevice}
|
||||
${lib.optionalString sw.isDevice "udevadm trigger ${sw.realDevice}"}
|
||||
''}
|
||||
'';
|
||||
enableStrictShellChecks = true;
|
||||
|
||||
Reference in New Issue
Block a user