Created
March 16, 2024 08:36
-
-
Save grantstephens/17d79daa8966468485c98e7cbd47a5ee to your computer and use it in GitHub Desktop.
Self Hosted Mastodon using Minio and NixOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs, modulesPath, ... }: | |
{ | |
security.acme = { | |
acceptTerms = true; | |
defaults.email = "~your-email-here~"; | |
}; | |
networking = { | |
hostName = "mastodon"; | |
hostId = "3e55fdff"; | |
firewall = { | |
enable = true; | |
allowedTCPPorts = [ 80 443 ]; | |
allowedUDPPorts = [ 80 443 ]; | |
}; | |
}; | |
services.mastodon = { | |
enable = true; | |
localDomain = "~your-mastodon-domain-here~"; | |
configureNginx = true; | |
smtp.fromAddress = "~some-social@-email-address~"; | |
trustedProxy = "~if required~"; | |
streamingProcesses = 1; | |
extraConfig = { | |
S3_ENABLED = "true"; | |
S3_BUCKET = "mastodon"; | |
AWS_ACCESS_KEY_ID = "~key id here~"; | |
AWS_SECRET_ACCESS_KEY = "~access key here~"; | |
S3_ALIAS_HOST = "~minio-domain-here~"; | |
S3_HOSTNAME = "~minio-domain-here~"; | |
S3_REGION = "us-east-1"; | |
S3_PROTOCOL= "https"; | |
S3_ENDPOINT = "https://~minio-domain-here~"; | |
S3_SIGNATURE_VERSION = "v4"; | |
SINGLE_USER_MODE = "true"; | |
}; | |
}; | |
environment.systemPackages = [ | |
pkgs.vim | |
]; | |
system = { | |
stateVersion = "24.05"; | |
autoUpgrade = { | |
enable = true; | |
allowReboot = true; | |
}; | |
}; | |
nix.optimise.automatic = true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs, modulesPath, ... }: | |
{ | |
networking = { | |
hostName = "minio"; | |
hostId = "3e42edff"; | |
firewall = { | |
enable = true; | |
allowedTCPPorts = [ 9000 9001 ]; | |
allowedUDPPorts = [ 9000 9001 ]; | |
}; | |
}; | |
environment.variables = { | |
MINIO_SERVER_URL = "~YOUR-URL-HERE~"; | |
}; | |
environment.systemPackages = [ | |
pkgs.vim | |
]; | |
services.minio = { | |
enable = true; | |
}; | |
system = { | |
stateVersion = "24.05"; | |
autoUpgrade = { | |
enable = true; | |
allowReboot = true; | |
}; | |
}; | |
nix.optimise.automatic = true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment