nixpkgs/nixos
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
..
doc/manual releasenotes: fix opengl.extraPackages option name 2016-05-21 16:35:31 +02:00
lib test-driver: Fix "unit X is inactive and there are no pending jobs" 2016-05-24 20:01:52 +01:00
maintainers Add AMIs in ap-northeast-2 and ap-south-1 2016-07-13 10:40:00 +02:00
modules nixos/swap: support for resizing swapfile 2016-07-16 09:41:52 +02:00
tests NixOS installer tests: Add a test using Gummiboot 2016-05-31 17:04:24 +02:00
COPYING
default.nix Revert "Add a way to pin a NixOS version within the module system." 2016-02-27 20:48:12 +01:00
README
release-combined.nix nixos/release-combined: Add boot-stage1 test 2016-05-06 22:06:34 +02:00
release-small.nix
release.nix nixos/tests: Add a test for boot stage 1 2016-05-06 22:06:34 +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.