mirror of
https://codeberg.org/privacy1st/nix-git
synced 2024-11-20 21:58:06 +01:00
BTRFS swap file
This commit is contained in:
parent
073c854660
commit
3952094233
13
README.md
13
README.md
@ -98,6 +98,19 @@ Use the corresponding branch:
|
||||
# TODO (!)
|
||||
```
|
||||
|
||||
## BTRFS Swap file
|
||||
|
||||
* https://nixos.wiki/wiki/Btrfs#Swap_file
|
||||
* https://wiki.archlinux.org/title/btrfs#Swap_file
|
||||
|
||||
Summary:
|
||||
|
||||
* Create subvolume `@swap` directly below top-level subvolume.
|
||||
* Mount at `/swap`
|
||||
* Create swapfile: `sudo btrfs filesystem mkswapfile --size 8g --uuid clear /swap/swapfile`
|
||||
* Regenerate hardware-configuration: `sudo nixos-generate-config --dir yodaTab`
|
||||
* Add `swapDevices = [ { device = "/swap/swapfile"; } ];` to hardware configuration and run `nixos-rebuild switch` (see above).
|
||||
|
||||
## Automount Encrypted Drive
|
||||
|
||||
* Generate and add keyfile to LUKS device
|
||||
|
@ -35,7 +35,13 @@
|
||||
|
||||
boot.initrd.luks.devices."512gb".device = "/dev/disk/by-uuid/03d4ac28-2c81-463e-b615-fb623d40b6fa";
|
||||
|
||||
swapDevices = [ ];
|
||||
fileSystems."/swap" =
|
||||
{ device = "/dev/disk/by-uuid/f87e6b3c-12f2-4fda-92b3-06b07bdad58f";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=@swap" ];
|
||||
};
|
||||
|
||||
swapDevices = [ { device = "/swap/swapfile"; } ];
|
||||
|
||||
# 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
|
||||
|
Loading…
Reference in New Issue
Block a user