mirror of
https://codeberg.org/privacy1st/nix-git
synced 2025-02-11 08:50:59 +01:00
yodaTux swapfile
This commit is contained in:
parent
1416938571
commit
d3468aa5e1
17
README.md
17
README.md
@ -306,10 +306,19 @@ Filtering:
|
|||||||
Summary:
|
Summary:
|
||||||
|
|
||||||
* Create subvolume `@swap` directly below top-level subvolume.
|
* Create subvolume `@swap` directly below top-level subvolume.
|
||||||
* Mount at `/swap`
|
* `sudo mkdir -p /mnt/ssd`
|
||||||
* Create swapfile: `sudo btrfs filesystem mkswapfile --size 8g --uuid clear /swap/swapfile`
|
* `sudo mount /dev/disk/by-uuid/01f67928-9b35-48b2-aaa6-c58ff6c440a8 /mnt/ssd`
|
||||||
* Regenerate hardware-configuration: `sudo nixos-generate-config --dir hosts/$(hostname)`
|
* `sudo btrfs subvolume create /mnt/ssd/@swap`
|
||||||
* Add `swapDevices = [ { device = "/swap/swapfile"; } ];` to hardware configuration and run `nixos-rebuild switch` (see above).
|
* `sudo umount /mnt/ssd`
|
||||||
|
* Mount subvolume at `/swap`.
|
||||||
|
* `sudo mkdir /swap`
|
||||||
|
* `sudo mount -o subvol=@swap /dev/disk/by-uuid/01f67928-9b35-48b2-aaa6-c58ff6c440a8 /swap`
|
||||||
|
* Create swapfile `/swap/swapfile`.
|
||||||
|
* `sudo btrfs filesystem mkswapfile --size 8g --uuid clear /swap/swapfile`
|
||||||
|
* Regenerate hardware-configuration. This will add `fileSystems."/swap"` to it.
|
||||||
|
* `sudo nixos-generate-config --dir hosts/$(hostname)`
|
||||||
|
* Add `swapDevices = [ { device = "/swap/swapfile"; } ];` to hardware-configuration.
|
||||||
|
* Apply your new NixOS config. This will activate the swapfile.
|
||||||
|
|
||||||
## BTRFS CoW
|
## BTRFS CoW
|
||||||
|
|
||||||
|
@ -24,9 +24,16 @@
|
|||||||
fileSystems."/boot" =
|
fileSystems."/boot" =
|
||||||
{ device = "/dev/disk/by-uuid/4840-0BFE";
|
{ device = "/dev/disk/by-uuid/4840-0BFE";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
|
options = [ "fmask=0022" "dmask=0022" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices = [ ];
|
fileSystems."/swap" =
|
||||||
|
{ device = "/dev/disk/by-uuid/01f67928-9b35-48b2-aaa6-c58ff6c440a8";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [ "subvol=@swap" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [ { device = "/swap/swapfile"; } ];
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
Loading…
x
Reference in New Issue
Block a user