swapfile for server
This commit is contained in:
parent
12e3a921dc
commit
f2373abdc2
4 changed files with 10 additions and 16 deletions
|
|
@ -1,5 +1,5 @@
|
|||
{ swapfile, ... }:
|
||||
{
|
||||
{ ... }: {
|
||||
services.fstrim.enable = true;
|
||||
boot.supportedFilesystems = [
|
||||
"ext4"
|
||||
"btrfs"
|
||||
|
|
@ -7,17 +7,4 @@
|
|||
"ntfs"
|
||||
"exfat"
|
||||
];
|
||||
|
||||
swapDevices =
|
||||
if swapfile == 0 then
|
||||
[ ]
|
||||
else
|
||||
[
|
||||
{
|
||||
device = "/swapfile";
|
||||
size = swapfile;
|
||||
}
|
||||
];
|
||||
|
||||
services.fstrim.enable = true;
|
||||
}
|
||||
6
modules/system/core/swapfile.nix
Normal file
6
modules/system/core/swapfile.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ swapfile, ... }: {
|
||||
swapDevices = if swapfile == 0 then [] else [{
|
||||
device = "/swapfile";
|
||||
size = swapfile;
|
||||
}];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue