mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-03-21 08:59:28 +01:00
feat: mount swap subvolume in read-only mode
This commit is contained in:
@@ -77,10 +77,22 @@
|
||||
options = [ "subvol=@home" "compress-force=zstd:1" ];
|
||||
};
|
||||
|
||||
# mount swap subvolume in readonly mode.
|
||||
fileSystems."/swap" =
|
||||
{ device = "/dev/disk/by-uuid/836b93a9-324f-45e6-ac1d-964becd7520c";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=@swap" ];
|
||||
options = [ "subvol=@swap" "ro" ];
|
||||
};
|
||||
|
||||
# remount swapfile in read-write mode
|
||||
fileSystems."/swap/swapfile" =
|
||||
{
|
||||
# the swapfile is located in /swap subvolume, so we need to mount /swap first.
|
||||
depends = [ "/swap"];
|
||||
|
||||
device = "/swap/swapfile";
|
||||
fsType = "none";
|
||||
options = [ "bind" "rw" ];
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
|
||||
Reference in New Issue
Block a user