types swap: check real path of the device before mount

This commit is contained in:
lassulus authored and mergify[bot] committed 2023-07-19 19:07:40 +00:00
1 parent 96815862d8
commit c77e66cea1
1 file changed
+1 -1
+1 -1
View File
@@ -42,7 +42,7 @@
inherit config options;
default = {
fs.${config.device} = ''
if ! swapon --show | grep -q '^${config.device} '; then
if ! swapon --show | grep -q "^$(readlink -f ${config.device}) "; then
swapon ${config.device}
fi
'';