added plex_permission service

This commit is contained in:
Richie Cahill 2024-06-22 12:40:50 -04:00
parent ec00ec53a2
commit 166647ce92
2 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,7 @@
#!/bin/bash
plex_dir="/zfs/storage/plex/"
chown docker-service:users -R "$plex_dir"
find "$plex_dir" -type f -exec chmod 664 {} \;
find "$plex_dir" -type d -exec chmod 775 {} \;

View File

@ -0,0 +1,20 @@
{ pkgs, ... }:
{
systemd = {
services."plex_permission" = {
description = "maintains /zfs/storage/plex permissions";
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.bash}/bin/bash /root/nix-dotfiles/systems/jeeves/scripts/plex_permission.sh";
};
};
timers."plex_permission" = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "1h";
OnCalendar = "daily 03:00";
Unit = "plex_permission.service";
};
};
};
}