nixpkgs/nixos/modules
Bjørn Forsman bd1d9ffa91 nixos/swap: support for resizing swapfile
Currently NixOS creates the swapfile (with the specified size) only if
it doesn't already exist. Changing the swapfile size afterwards will not
have any effect.

This commit changes that so the swapfile will be recreated whenever
swapDevices.*.size is changed (or more precisely, whenever the actual
file size differs from the configured one), allowing both growing and
shrinking the swapfile.

The service unit has "restartIfChanged = false", so we don't have to
worry about the swapfile being in use at the time this code is run (you
have to reboot for swapfile changes).

fallocate doesn't shrink files, use truncate for that. truncate can also
be used to grow files, but it creates "holes" in the file which doesn't
work with swapfiles.

(cherry picked from commit b30852ed41)
2016-07-16 09:41:52 +02:00
..
config nixos/swap: support for resizing swapfile 2016-07-16 09:41:52 +02:00
hardware facetimehd: Only unload module if it is loaded 2016-04-23 11:59:00 -05:00
i18n/inputMethod fcitx: show available engines in module description 2016-02-28 07:12:55 -06:00
installer nixos-install: fix SSL certificate error 2016-06-24 19:18:34 +03:00
misc nixos/elasticsearch: Set a group on the user 2016-07-01 19:10:16 +02:00
profiles Fix the boot-ec2-config test 2016-03-31 13:32:56 +02:00
programs ssh: Fix support for ssh-dss host keys 2016-04-01 16:04:15 +02:00
security setuid-wrappers: remove config.system.path from the closure 2016-05-23 13:50:50 +01:00
services ddclient service: use environment.etc 2016-07-09 14:56:28 +02:00
system nixos/grub: change state file device separator from ':' to ',' 2016-07-16 09:41:52 +02:00
tasks nixos/filesystems: Fix fs options type error 2016-03-30 21:51:10 +02:00
testing KDE test: Bump kdm start timeout 2016-05-27 13:39:56 +02:00
virtualisation Update 16.03 AMIs 2016-07-13 10:40:29 +02:00
module-list.nix colord service: init 2016-07-01 07:34:19 +02:00
rename.nix gitlab: 8.0.5 -> 8.5.0, service improvements 2016-02-26 07:08:31 +01:00