2022-05-17 13:17:02 +01:00
|
|
|
{ pkgs, ... }:
|
|
|
|
let
|
|
|
|
misskeyDomain = "social.owo.monster";
|
|
|
|
misskeyPort = 3020;
|
|
|
|
redisPort = 3019;
|
|
|
|
in {
|
|
|
|
users.users."misskey" = {
|
|
|
|
isNormalUser = true;
|
|
|
|
createHome = true;
|
2022-06-01 07:13:31 +01:00
|
|
|
extraGroups = [ "docker" ];
|
2022-05-17 13:17:02 +01:00
|
|
|
};
|
2022-06-01 07:13:31 +01:00
|
|
|
home-manager.users."misskey".home.packages = with pkgs; [
|
|
|
|
git
|
|
|
|
docker-compose
|
|
|
|
];
|
|
|
|
|
|
|
|
virtualisation.docker.enable = true;
|
2022-05-17 13:17:02 +01:00
|
|
|
|
|
|
|
# make .config/default.yml a symlink to /etc/misskey.yml
|
2022-06-01 07:13:31 +01:00
|
|
|
environment.etc."misskey.yml".text = pkgs.lib.generators.toYAML { } {
|
2022-05-17 13:17:02 +01:00
|
|
|
url = "https://${misskeyDomain}/";
|
|
|
|
port = misskeyPort;
|
|
|
|
|
|
|
|
db = {
|
2022-06-01 07:13:31 +01:00
|
|
|
host = "localhost";
|
|
|
|
port = "5432";
|
|
|
|
db = "misskey";
|
|
|
|
user = "misskey";
|
|
|
|
pass = "a";
|
2022-05-17 13:17:02 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
redis = {
|
2022-06-01 07:13:31 +01:00
|
|
|
host = "127.0.0.1";
|
|
|
|
port = redisPort;
|
2022-05-17 13:17:02 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.nginx.virtualHosts."${misskeyDomain}" = {
|
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
|
|
|
locations = {
|
|
|
|
"/" = {
|
|
|
|
proxyPass = "http://127.0.0.1:${toString misskeyPort}";
|
|
|
|
proxyWebsockets = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.postgresql = {
|
|
|
|
enable = true;
|
|
|
|
ensureUsers = [{
|
|
|
|
name = "misskey";
|
|
|
|
ensurePermissions."DATABASE misskey" = "ALL PRIVILEGES";
|
|
|
|
}];
|
|
|
|
ensureDatabases = [ "misskey" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
services.redis.servers."misskey" = {
|
|
|
|
enable = true;
|
|
|
|
port = redisPort;
|
|
|
|
};
|
|
|
|
}
|