nixos/swap: detect whether swap is a device

(cherry picked from commit fe18bb82a1)
This commit is contained in:
Atemu
2026-06-09 22:32:34 +02:00
committed by github-actions[bot]
parent 5e847c30f7
commit 79ed1b7bd1

View File

@@ -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;