Skip to content

Instantly share code, notes, and snippets.

@RomeoV
Last active May 7, 2024 20:03
Show Gist options
  • Save RomeoV/ba43ab24401dba2023e5096950375c30 to your computer and use it in GitHub Desktop.
Save RomeoV/ba43ab24401dba2023e5096950375c30 to your computer and use it in GitHub Desktop.
Setup invidious on NixOS
{ config, lib, pkgs, ... }: {
networking.hostName = "mycloud-nixos";
services.tailscale = {
enable = true;
};
services.invidious = {
enable = true;
port = 8090;
};
networking.firewall = {
enable = true;
trustedInterfaces = [
"tailscale0"
];
};
## OPTIONAL: Expose to internet via nginx; automatic HTTPS cert fetching and renewal.
services.nginx = {
enable = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
clientMaxBodySize = "40M";
virtualHosts = {
"invidious.romeov.me" = {
forceSSL = true;
enableACME = true;
proxyPass = "http://127.0.0.1:${toString config.services.invidious.port}";
};
};
};
networking.firewall.allowedTCPPorts = [ # necessar for https certs
80
443
];
security.acme = {
acceptTerms = true;
defaults.email = "contact@romeov.me";
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment