Skip to content

Commit

Permalink
Add mastodon
Browse files Browse the repository at this point in the history
  • Loading branch information
balsoft committed Mar 18, 2021
1 parent e54fd18 commit 9d1b643
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 1 deletion.
1 change: 1 addition & 0 deletions machines/T420-Laptop/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
nginx
vsftpd
home-assistant
mastodon
];

services.logind.lidSwitch = "ignore";
Expand Down
1 change: 1 addition & 0 deletions modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ builtins.listToAttrs (builtins.map (path: {
./servers/nginx.nix
./servers/vsftpd.nix
./servers/home-assistant.nix
./servers/mastodon.nix
./services.nix
./themes.nix
./virtualisation.nix
Expand Down
8 changes: 8 additions & 0 deletions modules/servers/mailserver.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ in {
owner = "dovecot2:dovecot2";
services = [ "dovecot2" ];
};
secrets.mailserver-mastodon = {
owner = "dovecot2:dovecot2";
services = [ "dovecot2" ];
};
services.postfix = {
dnsBlacklists = [
"all.s5h.net"
Expand Down Expand Up @@ -79,6 +83,10 @@ in {
[ "balsoft" "[email protected]" "patches" "[email protected]" "issues" "[email protected]" "admin" "[email protected]" "root" ];
hashedPasswordFile = config.secrets.mailserver.decrypted;
};
"[email protected]" = {
aliases = [ "mastodon" ];
hashedPasswordFile = config.secrets.mailserver-mastodon.decrypted;
};
};
localDnsResolver = false;
certificateScheme = 1;
Expand Down
19 changes: 19 additions & 0 deletions modules/servers/mastodon.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{ config, pkgs, lib, ... }: {
secrets.email-mastodon = {
owner = "mastodon:mastodon";
encrypted = "/home/balsoft/.password-store/email/[email protected]";
services = [ "mastodon-web" ];
};
services.mastodon = {
enable = true;
configureNginx = true;
localDomain = "social.balsoft.ru";
smtp = {
createLocally = false;
fromAddress = "[email protected]";
user = "mastodon";
host = "balsoft.ru";
passwordFile = config.secrets.email-mastodon.decrypted;
};
};
}
2 changes: 1 addition & 1 deletion modules/servers/nginx.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
proxyPass = "http://localhost:13748";
};
enableACME = true;
addSSL = true;
forceSSL = true;
};
"code.balsoft.ru" = {
locations."/" = { proxyPass = "http://localhost:6000"; };
Expand Down

0 comments on commit 9d1b643

Please sign in to comment.