Files
nixos/hosts/tower/disko.nix
T
Hermes Agent 667a072937 feat(media): migrer la bibliothèque partagée vers /srv/media (dataset ZFS dédié)
/home/marc/media posait deux problèmes : /home/marc est 0700 (chaque service
devait recevoir un droit de traversée) et systemd-tmpfiles refuse de créer
quoi que ce soit sous /home/marc (« unsafe path transition », exit 73).

- services/media (nouveau) : dataset nixos/media -> /srv/media, groupe media
  (setgid, dossiers 2775/2770), arborescence movies/tvshows/music/books/downloads
- disko.nix : dataset media à côté de marc/nix
- navidrome, jellyfin, kodi : bibliothèque -> /srv/media/{music,movies,tvshows}
- qbittorrent : téléchargements dans le même dataset que la bibliothèque
  (permet aux *arr d'importer par lien dur au lieu de copier)
- radarr : dataDir corrigé (pointait sur celui de sonarr par copier-coller),
  déplacé hors /home (impossible avec ProtectHome+tmpfiles du module)
- sonarr : dataDir dédié + migration depuis /home/marc/radarr (était figé
  depuis le 28/07, port 8006 muet) ; réparé le 27/09/2026
- readarr : bibliothèque -> /srv/media/books
2026-09-27 21:19:52 -04:00

122 lines
3.3 KiB
Nix

{
disko.devices = {
disk = {
root = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {
ESP = {
size = "1G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = ["nofail"];
};
};
swap = {
# name = "swap";
# type = "8200"; # Linux swap
size = "16G";
content = {
type = "swap";
randomEncryption = true;
priority = 100;
};
};
zfs = {
size = "1024G";
content = {
type = "zfs";
pool = "nixos";
};
};
};
};
};
};
zpool = {
nixos = {
type = "zpool";
rootFsOptions = {
mountpoint = "none";
compression = "lz4";
acltype = "posixacl";
xattr = "sa";
"com.sun:auto-snapshot" = "true";
};
options.ashift = "12";
datasets = {
"root" = {
type = "zfs_fs";
# options = {
# encryption = "aes-256-gcm";
# keyformat = "passphrase";
# #keylocation = "file:///tmp/secret.key";
# keylocation = "prompt";
# };
mountpoint = "/";
};
"nix" = {
type = "zfs_fs";
options.mountpoint = "/nix";
mountpoint = "/nix";
};
# Média partagé (Jellyfin, Navidrome, Radarr, Sonarr, Nextcloud) :
# groupe `media` + dossiers setgid, hors des homes pour que
# systemd-tmpfiles puisse y créer les dossiers (voir services/media).
"media" = {
type = "zfs_fs";
options.mountpoint = "/srv/media";
};
"marc" = {
type = "zfs_fs";
options.mountpoint = "none";
};
"marc/data" = {
type = "zfs_fs";
options.mountpoint = "/home/marc";
};
"marc/git" = {
type = "zfs_fs";
options.mountpoint = "/home/marc/git";
};
"marc/media" = {
type = "zfs_fs";
options.mountpoint = "/home/marc/media";
};
"marc/downloads" = {
type = "zfs_fs";
options.mountpoint = "/home/marc/downloads";
};
"marc/syncthing" = {
type = "zfs_fs";
options.mountpoint = "/home/marc/sync";
};
# # README MORE: https://wiki.archlinux.org/title/ZFS#Swap_volume
# "root/swap" = {
# type = "zfs_volume";
# size = "16G";
# content = {
# type = "swap";
# };
# options = {
# volblocksize = "4096";
# compression = "zle";
# logbias = "throughput";
# sync = "always";
# primarycache = "metadata";
# secondarycache = "none";
# "com.sun:auto-snapshot" = "false";
# };
# };
};
};
};
};
}