mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-29 06:45:54 +03:00
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;
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user