Lots of user changes and also Spacebar

This commit is contained in:
Bun 2025-03-14 18:23:32 -04:00
parent b5ec4cbf68
commit 36c3f778c8
19 changed files with 69 additions and 43 deletions

View file

@ -3,7 +3,7 @@
imports = [
./mastodon
./owncast
#./spacebar
./spacebar
];
options.system.socialserver.enable = lib.mkEnableOption "Enable social media like services";

View file

@ -0,0 +1,25 @@
{ 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 ];
};
}

View file

@ -0,0 +1,11 @@
{ config, lib, ... }:
{
users = lib.mkIf config.system.socialserver.enable {
users.spacebar = {
group = "spacebar";
isSystemUser = true;
uid = 138;
};
groups.spacebar = {};
};
}