feat: moved services over to using the new storage datasets

This commit is contained in:
Leyla Becker 2025-11-15 16:37:10 -06:00
parent 757a3892e1
commit c2701ea8f0
23 changed files with 281 additions and 606 deletions

View file

@ -10,53 +10,35 @@ in {
default = config.services.qbittorrent.enable && config.storage.impermanence.enable;
};
config = lib.mkIf config.services.qbittorrent.enable (lib.mkMerge [
(lib.mkIf config.storage.zfs.enable (lib.mkMerge [
{
assertions = [
{
assertion = config.services.qbittorrent.profileDir == qbittorent_profile_directory;
message = "qbittorrent data directory does not match persistence";
}
];
}
(lib.mkIf (!config.services.qbittorrent.impermanence.enable) {
# TODO: placeholder to configure a unique dataset for this service
})
(
lib.mkIf config.services.qbittorrent.impermanence.enable
{
storage.impermanence.datasets = {
"persist/replicate/system/root" = {
directories."${qbittorent_profile_directory}" = {
owner.name = "qbittorrent";
group.name = "qbittorrent";
};
};
"persist/replicate/system/qbittorrent" = {
directories."${config.services.qbittorrent.mediaDir}" = {
owner.name = "qbittorrent";
group.name = "qbittorrent";
owner.permissions = {
read = true;
write = true;
execute = true;
};
group.permissions = {
read = true;
write = true;
execute = true;
};
other.permissions = {
read = true;
write = false;
execute = true;
};
};
};
config = lib.mkIf config.services.qbittorrent.enable {
storage.datasets.replicate = {
"system/root" = {
directories."${qbittorent_profile_directory}" = lib.mkIf config.services.qbittorrent.impermanence.enable {
owner.name = "qbittorrent";
group.name = "qbittorrent";
};
};
"system/qbittorrent" = {
directories."${config.services.qbittorrent.mediaDir}" = lib.mkIf config.services.qbittorrent.impermanence.enable {
owner.name = "qbittorrent";
group.name = "qbittorrent";
owner.permissions = {
read = true;
write = true;
execute = true;
};
}
)
]))
]);
group.permissions = {
read = true;
write = true;
execute = true;
};
other.permissions = {
read = true;
write = false;
execute = true;
};
};
};
};
};
}