nixpkgs/nixos
Bjørn Forsman b30852ed41 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.
2016-07-06 16:04:27 +02:00
..
doc/manual documentation: fix start display-manager command 2016-07-04 10:25:31 +02:00
lib Merge 'master' into staging and re-revert merge 2016-06-23 12:09:03 +02:00
maintainers ec2/create-amis.sh: specify the approriate size on snapshots 2016-05-07 19:44:39 +01:00
modules nixos/swap: support for resizing swapfile 2016-07-06 16:04:27 +02:00
tests Add test for emacs module 2016-07-01 11:37:57 +02:00
COPYING
default.nix nix: Add a "dev" output 2016-04-18 21:13:18 +02:00
README
release-combined.nix Make i3wm test a release blocker 2016-05-26 10:47:15 +01:00
release-small.nix containers: test imperative and ipv4 in small-release (#15015) 2016-04-26 22:38:47 +02:00
release.nix nixos/tests: Add a test for boot stage 1 2016-05-06 16:56:43 +02:00

*** NixOS ***

NixOS is a Linux distribution based on the purely functional package
management system Nix.  More information can be found at
http://nixos.org/nixos and in the manual in doc/manual.