Branch: refs/heads/master
  Home:   https://github.com/NixOS/nixpkgs
  Commit: b30852ed41f7e6729de9a75a71a671ce7d03dff9
      
https://github.com/NixOS/nixpkgs/commit/b30852ed41f7e6729de9a75a71a671ce7d03dff9
  Author: Bjørn Forsman <[email protected]>
  Date:   2016-07-06 (Wed, 06 Jul 2016)

  Changed paths:
    M nixos/modules/config/swap.nix

  Log Message:
  -----------
  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.


  Commit: 0d5be595a7c707be1cedebf1f14a47cafdf0a3f4
      
https://github.com/NixOS/nixpkgs/commit/0d5be595a7c707be1cedebf1f14a47cafdf0a3f4
  Author: Eelco Dolstra <[email protected]>
  Date:   2016-07-06 (Wed, 06 Jul 2016)

  Changed paths:
    M nixos/modules/config/swap.nix

  Log Message:
  -----------
  Merge pull request #16755 from bjornfor/swapfile-resize

nixos/swap: support for resizing swapfile


Compare: https://github.com/NixOS/nixpkgs/compare/851cd1e6af3e...0d5be595a7c7
_______________________________________________
nix-commits mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-commits

Reply via email to