Skip to content

Commit

Permalink
nixos/emby: ensure plugins are writeable
Browse files Browse the repository at this point in the history
  • Loading branch information
worldofpeace committed Sep 20, 2018
1 parent e8a3591 commit a16c6d8
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions nixos/modules/services/misc/emby.nix
Expand Up @@ -36,11 +36,18 @@ in
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
preStart = ''
test -d ${cfg.dataDir} || {
echo "Creating initial Emby data directory in ${cfg.dataDir}"
mkdir -p ${cfg.dataDir}
chown -R ${cfg.user}:${cfg.group} ${cfg.dataDir}
}
if [ -d ${cfg.dataDir} ]
then
for plugin in ${cfg.dataDir}/plugins/*
do
echo "Correcting permissions of plugin: $plugin"
chmod u+w $plugin
done
else
echo "Creating initial Emby data directory in ${cfg.dataDir}"
mkdir -p ${cfg.dataDir}
chown -R ${cfg.user}:${cfg.group} ${cfg.dataDir}
fi
'';

serviceConfig = {
Expand Down

0 comments on commit a16c6d8

Please sign in to comment.