nixos-generate-config: don't generate swapDevices for zram devices (#75921)
This commit is contained in:
parent
5b210859f6
commit
ebbb7165c5
|
@ -335,6 +335,9 @@ if (@swaps) {
|
||||||
next unless -e $swapFilename;
|
next unless -e $swapFilename;
|
||||||
my $dev = findStableDevPath $swapFilename;
|
my $dev = findStableDevPath $swapFilename;
|
||||||
if ($swapType =~ "partition") {
|
if ($swapType =~ "partition") {
|
||||||
|
# zram devices are more likely created by configuration.nix, so
|
||||||
|
# ignore them here
|
||||||
|
next if ($swapFilename =~ /^\/dev\/zram/);
|
||||||
push @swapDevices, "{ device = \"$dev\"; }";
|
push @swapDevices, "{ device = \"$dev\"; }";
|
||||||
} elsif ($swapType =~ "file") {
|
} elsif ($swapType =~ "file") {
|
||||||
# swap *files* are more likely specified in configuration.nix, so
|
# swap *files* are more likely specified in configuration.nix, so
|
||||||
|
|
Loading…
Reference in New Issue