fix misskey-files service
This commit is contained in:
parent
0e9f98f627
commit
2da13bd3ee
|
@ -67,22 +67,29 @@ in {
|
||||||
systemd.services.misskey-files = {
|
systemd.services.misskey-files = {
|
||||||
serviceConfig.Type = "oneshot";
|
serviceConfig.Type = "oneshot";
|
||||||
wantedBy = ["misskey.service"];
|
wantedBy = ["misskey.service"];
|
||||||
|
partOf = ["misskey.service"];
|
||||||
after = ["home-manager-misskey.service" "network.target"];
|
after = ["home-manager-misskey.service" "network.target"];
|
||||||
path = with pkgs; [bash git rsync] ++ misskeyPackages;
|
path = with pkgs; [bash sudo git rsync] ++ misskeyPackages;
|
||||||
|
|
||||||
script = ''
|
script = let
|
||||||
mkdir -p /home/misskey/misskey || true
|
asMisskey = "sudo -u misskey";
|
||||||
rsync -avh ${misskeyPackage}/ /home/misskey/misskey/ --delete --exclude node_modules
|
in ''
|
||||||
|
set -e
|
||||||
|
|
||||||
|
(mkdir -p /home/misskey/misskey && chown misskey:users /home/misskey/misskey) || true
|
||||||
|
|
||||||
|
${asMisskey} rsync -arvh --delete --exclude node_modules ya${misskeyPackage}/ /home/misskey/misskey/
|
||||||
|
chown -R misskey:users /home/misskey/misskey
|
||||||
|
|
||||||
rm -rf /home/misskey/misskey/.config
|
rm -rf /home/misskey/misskey/.config
|
||||||
mkdir /home/misskey/misskey/.config
|
${asMisskey} mkdir /home/misskey/misskey/.config
|
||||||
cat ${misskeyConfigFile} > /home/misskey/misskey/.config/default.yml
|
cat ${misskeyConfigFile} | ${asMisskey} tee /home/misskey/misskey/.config/default.yml
|
||||||
|
|
||||||
ln -s /home/misskey/misskey-files /home/misskey/misskey/files
|
${asMisskey} ln -s /home/misskey/misskey-files /home/misskey/misskey/files
|
||||||
|
|
||||||
cd /home/misskey/misskey
|
cd /home/misskey/misskey
|
||||||
yarn install
|
${asMisskey} yarn install
|
||||||
NODE_ENV=production yarn build
|
${asMisskey} env NODE_ENV=production yarn build
|
||||||
|
|
||||||
chown -R misskey:users /home/misskey/misskey
|
chown -R misskey:users /home/misskey/misskey
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -41,7 +41,6 @@ in {
|
||||||
"/var/lib/redis-rspamd"
|
"/var/lib/redis-rspamd"
|
||||||
|
|
||||||
# misskey
|
# misskey
|
||||||
"/home/misskey/misskey-files"
|
|
||||||
"/var/lib/redis-misskey"
|
"/var/lib/redis-misskey"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue