nixos/lemmy: move systemd script to serviceConfig

Co-authored-by: Shahar Dawn Or <mightyiampresence@gmail.com>
Co-authored-by: Ctem <c@ctem.me>
Co-authored-by: Ilan Joselevich <personal@ilanjoselevich.com>
Co-authored-by: a-kenji <aks.kenji@protonmail.com>
This commit is contained in:
Brian Leung 2022-09-12 01:54:27 -07:00 committed by Yt
parent 5519e1b89b
commit c231a20d98

View File

@ -167,14 +167,11 @@ in
requires = lib.optionals cfg.settings.database.createLocally [ "lemmy-postgresql.service" ];
script = ''
${pkgs.coreutils}/bin/install -m 600 ${settingsFormat.generate "config.hjson" cfg.settings} /run/lemmy/config.hjson
${pkgs.lemmy-server}/bin/lemmy_server
'';
serviceConfig = {
DynamicUser = true;
RuntimeDirectory = "lemmy";
ExecStartPre = "${pkgs.coreutils}/bin/install -m 600 ${settingsFormat.generate "config.hjson" cfg.settings} /run/lemmy/config.hjson";
ExecStart = "${pkgs.lemmy-server}/bin/lemmy_server";
};
};