servo: migrate /var/media to be 100% on zfs pool

This commit is contained in:
Colin 2024-04-04 06:20:40 +00:00
parent 0dfeec3260
commit 7ab148ea58
2 changed files with 4 additions and 30 deletions

View File

@ -51,7 +51,7 @@
fileSystems."/mnt/pool" = {
device = "pool";
fsType = "zfs";
# options = [ "acl" ];
options = [ "acl" ]; #< not sure if this `acl` flag is actually necessary. it mounts without it.
};
# services.zfs.zed = ... # TODO: zfs can send me emails when disks fail
sane.programs.sysadminUtils.suggestedPrograms = [ "zfs" ];
@ -97,12 +97,11 @@
# - ensure everything under /var/media is mounted with `-o acl`, to support acls
# - ensure all files are rwx by group: `setfacl --recursive --modify d:g::rwx /var/media`
# - alternatively, `d:g:media:rwx` to grant `media` group even when file has a different owner, but that's a bit complex
sane.persist.sys.byStore.plaintext = [{
sane.persist.sys.byStore.ext = [{
path = "/var/media";
method = "bind"; #< this HAS to be `bind` if we're going to persist the whole thing but create subdirs, as below.
user = "colin";
group = "media";
mode = "0755";
mode = "0775";
}];
sane.fs."/var/media/archive".dir = {};
# this is file.text instead of symlink.text so that it may be read over a remote mount (where consumers might not have any /nix/store/.../README.md path)
@ -116,7 +115,7 @@
sane.fs."/var/media/Books/Books".dir = {};
sane.fs."/var/media/Books/Visual".dir = {};
sane.fs."/var/media/collections".dir = {};
sane.fs."/var/media/datasets".dir = {};
# sane.fs."/var/media/datasets".dir = {};
sane.fs."/var/media/freeleech".dir = {};
sane.fs."/var/media/Music".dir = {};
sane.fs."/var/media/Pictures".dir = {};
@ -131,27 +130,6 @@
this directory exists on SSD, allowing for speedy access to specific datasets when necessary.
the contents should be a subset of what's in ../media/datasets.
'';
# make sure large media is stored to the HDD
sane.persist.sys.byStore.ext = [
{
user = "colin";
group = "users";
mode = "0777";
path = "/var/media/Videos";
}
{
user = "colin";
group = "users";
mode = "0777";
path = "/var/media/freeleech";
}
{
user = "colin";
group = "users";
mode = "0775";
path = "/var/lib/uninsane/datasets";
}
];
# btrfs doesn't easily support swapfiles
# swapDevices = [

View File

@ -63,10 +63,6 @@ in
# TODO: mode? we need this specifically for the stats tracking in .config/
{ user = "transmission"; group = config.users.users.transmission.group; path = "/var/lib/transmission"; method = "bind"; }
];
sane.persist.sys.byStore.ext = [
# TODO: move ALL /var/media to the same zfs pool; remove this
{ user = "transmission"; group = "media"; path = download-dir; method = "bind"; }
];
users.users.transmission.extraGroups = [ "media" ];
services.transmission.enable = true;