nixos-generate-config: don't generate swapDevices for zram devices (#75921)

This commit is contained in:
buckley310 2019-12-19 15:03:21 -05:00 committed by Danylo Hlynskyi
parent 5b210859f6
commit ebbb7165c5

View File

@ -335,6 +335,9 @@ if (@swaps) {
next unless -e $swapFilename;
my $dev = findStableDevPath $swapFilename;
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\"; }";
} elsif ($swapType =~ "file") {
# swap *files* are more likely specified in configuration.nix, so