25 lines
754 B
Nix
25 lines
754 B
Nix
{ config, lib, pkgs, spacebar, ... }:
|
|
{
|
|
imports = [
|
|
./nginx
|
|
./user
|
|
];
|
|
|
|
config = lib.mkIf config.system.socialserver.enable {
|
|
systemd.services.spacebar-server = {
|
|
enable = true;
|
|
description = "Spacebar Chat Server";
|
|
documentation = [ "https://docs.spacebar.chat/" ];
|
|
path = [ spacebar.packages.${pkgs.system}.default ];
|
|
wantedBy = [ "multi-user.target" ];
|
|
after = [ "network.target" ];
|
|
serviceConfig = {
|
|
WorkingDirectory = "/var/lib/spacebar";
|
|
ExecStart = "start-bundle";
|
|
Restart = "always";
|
|
User = "spacebar";
|
|
};
|
|
};
|
|
environment.persistence."/persist".directories = [ config.systemd.services.spacebar-server.serviceConfig.WorkingDirectory ];
|
|
};
|
|
}
|