mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 07:01:54 +00:00
parent
fccfc775d1
commit
ce65df3a36
@ -314,14 +314,16 @@ push @attrs, "services.xserver.videoDrivers = [ \"$videoDriver\" ];" if $videoDr
|
|||||||
|
|
||||||
# Generate the swapDevices option from the currently activated swap
|
# Generate the swapDevices option from the currently activated swap
|
||||||
# devices.
|
# devices.
|
||||||
my @swaps = read_file("/proc/swaps");
|
my @swaps = read_file("/proc/swaps", err_mode => 'carp');
|
||||||
shift @swaps;
|
|
||||||
my @swapDevices;
|
my @swapDevices;
|
||||||
foreach my $swap (@swaps) {
|
if (@swaps) {
|
||||||
$swap =~ /^(\S+)\s/;
|
shift @swaps;
|
||||||
next unless -e $1;
|
foreach my $swap (@swaps) {
|
||||||
my $dev = findStableDevPath $1;
|
$swap =~ /^(\S+)\s/;
|
||||||
push @swapDevices, "{ device = \"$dev\"; }";
|
next unless -e $1;
|
||||||
|
my $dev = findStableDevPath $1;
|
||||||
|
push @swapDevices, "{ device = \"$dev\"; }";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user