From ebbb7165c5509963bd19db565cee3b8a26853b64 Mon Sep 17 00:00:00 2001 From: buckley310 Date: Thu, 19 Dec 2019 15:03:21 -0500 Subject: [PATCH] nixos-generate-config: don't generate swapDevices for zram devices (#75921) --- nixos/modules/installer/tools/nixos-generate-config.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl index f2ffe61c42cb..7f98756a7d9f 100644 --- a/nixos/modules/installer/tools/nixos-generate-config.pl +++ b/nixos/modules/installer/tools/nixos-generate-config.pl @@ -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