nixpkgs/nixos/modules/config
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
..
fonts fontconfig service: add pre-generated fonts caches 2016-01-29 14:41:26 +03:00
debug-info.nix Add option environment.enableDebugInfo 2015-10-30 15:21:16 +01:00
gnu.nix
i18n.nix i18n: add color scheme option (close #9626) 2015-11-09 14:53:59 +01:00
krb5.nix Add kerberos mappings for MIT exchange server 2016-05-11 09:09:34 -04:00
ldap.nix Add missing 'type', 'defaultText' and 'literalExample' in module definitions 2016-01-17 19:41:23 +01:00
networking.nix nixos: fix evaluation 2016-01-20 01:19:03 +01:00
no-x-libs.nix dbus: rename useX11 option into x11Support, cleanup a bit 2015-03-29 23:28:30 +00:00
nsswitch.nix nsswitch.conf: Omit ldap unless ldap is enabled 2015-02-25 14:31:13 +01:00
power-management.nix Remove default scsiLinkPolicy 2015-12-17 16:40:35 +01:00
pulseaudio.nix Add missing 'type', 'defaultText' and 'literalExample' in module definitions 2016-01-17 19:41:23 +01:00
shells-environment.nix Add missing 'type', 'defaultText' and 'literalExample' in module definitions 2016-01-17 19:41:23 +01:00
swap.nix nixos/swap: support for resizing swapfile 2016-07-16 09:41:52 +02:00
sysctl.nix sysctl: use literalExample in docs 2015-12-30 10:22:04 -08:00
system-environment.nix nixos,lib: move environment generation related copy-paste to lib 2015-09-18 18:48:49 +00:00
system-path.nix nixos: improve mime DB cache generation (close #11785) 2015-12-17 14:58:24 +01:00
timezone.nix nixos: let's not forget types in the timezone module 2015-07-31 01:57:47 +00:00
unix-odbc-drivers.nix Add missing 'type', 'defaultText' and 'literalExample' in module definitions 2016-01-17 19:41:23 +01:00
update-users-groups.pl nixos/update-users-groups.pl: print UIDs and GIDs 2016-07-01 14:23:32 +02:00
users-groups.nix Fix package name typo 2016-01-02 12:37:20 -08:00
vpnc.nix nixos/vpnc: fix formatting of example 2016-02-27 22:25:39 +13:00
zram.nix zram: simplified totalmem calculation for zram.nix 2016-01-29 22:41:20 +11:00