Move media dirs to btrfs subvolume

This commit is contained in:
Valentin Brandl 2023-03-06 12:10:39 +01:00
parent 2bbab5fede
commit f4c382507e
Signed by: vbrandl
GPG Key ID: CAD4DA1A789125F9
2 changed files with 26 additions and 2 deletions

View File

@ -1,3 +1,21 @@
{ ... }: {
xdg.enable = true;
{ config, ... }:
let
mediaDirectory = "\$HOME/media";
in {
xdg = {
enable = true;
userDirs = {
enable = true;
createDirectories = true;
/* TODO: this can be a btrfs subvolume to exclude those directories from snapshots */
download = "${mediaDirectory}/Downloads";
music = "${mediaDirectory}/Music";
pictures = "${mediaDirectory}/Pictures";
publicShare = "${mediaDirectory}/Public";
templates = "${mediaDirectory}/Templates";
videos = "${mediaDirectory}/Videos";
};
};
}

View File

@ -121,6 +121,12 @@ inputs.nixpkgs.lib.nixosSystem {
options = [ "subvol=home" "compress=zstd" ];
};
fileSystems."/home/me/media" =
{ device = "/dev/disk/by-uuid/93bdadfc-961a-4ea6-aef0-d3cd50847f0b";
fsType = "btrfs";
options = [ "subvol=home/me/media" "compress=zstd" ];
};
fileSystems."/swap" =
{ device = "/dev/disk/by-uuid/" + swapUUID;
fsType = "btrfs";