Initial commit
This commit is contained in:
		
				commit
				
					
						6f88b92591
					
				
			
		
					 20 changed files with 395 additions and 0 deletions
				
			
		
							
								
								
									
										15
									
								
								hosts/coturn/configuration.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								hosts/coturn/configuration.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,15 @@
 | 
			
		|||
{ config, pkgs, ... }:
 | 
			
		||||
{
 | 
			
		||||
  boot.loader.grub = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    version = 2;
 | 
			
		||||
    device = "/dev/vda";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  networking = {
 | 
			
		||||
    hostName = "coturn";
 | 
			
		||||
    firewall.enable = false;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  system.stateVersion = "23.05";
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										45
									
								
								hosts/coturn/coturn.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								hosts/coturn/coturn.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,45 @@
 | 
			
		|||
{ ... }:
 | 
			
		||||
{
 | 
			
		||||
  services.coturn = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
 | 
			
		||||
    min-port = 49200;
 | 
			
		||||
    max-port = 49500;
 | 
			
		||||
    use-auth-secret = true;
 | 
			
		||||
    static-auth-secret-file = "/secrets/static-auth-secret.secret";
 | 
			
		||||
    realm = "turn.nekover.se";
 | 
			
		||||
    cert = "/certs/turn.nekover.se/fullchain.pem";
 | 
			
		||||
    pkey = "/certs/turn.nekover.se/key.pem";
 | 
			
		||||
    no-tcp-relay = true;
 | 
			
		||||
    extraConfig = "
 | 
			
		||||
      external-ip=170.133.2.81/10.202.41.118
 | 
			
		||||
      prometheus
 | 
			
		||||
      syslog
 | 
			
		||||
 | 
			
		||||
      no-tlsv1
 | 
			
		||||
      no-tlsv1_1
 | 
			
		||||
 | 
			
		||||
      denied-peer-ip=10.0.0.0-10.255.255.255
 | 
			
		||||
      denied-peer-ip=192.168.0.0-192.168.255.255
 | 
			
		||||
      denied-peer-ip=172.16.0.0-172.31.255.255
 | 
			
		||||
 | 
			
		||||
      no-multicast-peers
 | 
			
		||||
      denied-peer-ip=0.0.0.0-0.255.255.255
 | 
			
		||||
      denied-peer-ip=100.64.0.0-100.127.255.255
 | 
			
		||||
      denied-peer-ip=127.0.0.0-127.255.255.255
 | 
			
		||||
      denied-peer-ip=169.254.0.0-169.254.255.255
 | 
			
		||||
      denied-peer-ip=192.0.0.0-192.0.0.255
 | 
			
		||||
      denied-peer-ip=192.0.2.0-192.0.2.255
 | 
			
		||||
      denied-peer-ip=192.88.99.0-192.88.99.255
 | 
			
		||||
      denied-peer-ip=198.18.0.0-198.19.255.255
 | 
			
		||||
      denied-peer-ip=198.51.100.0-198.51.100.255
 | 
			
		||||
      denied-peer-ip=203.0.113.0-203.0.113.255
 | 
			
		||||
      denied-peer-ip=240.0.0.0-255.255.255.255
 | 
			
		||||
 | 
			
		||||
      allowed-peer-ip=10.202.41.118
 | 
			
		||||
 | 
			
		||||
      user-quota=12
 | 
			
		||||
      total-quota=1200
 | 
			
		||||
      ";
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										8
									
								
								hosts/coturn/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								hosts/coturn/default.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,8 @@
 | 
			
		|||
{ ... }:
 | 
			
		||||
{
 | 
			
		||||
  imports = [
 | 
			
		||||
    ./configuration.nix
 | 
			
		||||
    ./secrets.nix
 | 
			
		||||
    ./coturn.nix
 | 
			
		||||
  ];
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										11
									
								
								hosts/coturn/secrets.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								hosts/coturn/secrets.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,11 @@
 | 
			
		|||
{ ... }:
 | 
			
		||||
{
 | 
			
		||||
  deployment.keys."static-auth-secret.secret" = {
 | 
			
		||||
    keyCommand = [ "env" "GNUPGHOME=/home/yuri/.passinfra_gnupg" "PASSWORD_STORE_DIR=/home/yuri/pass/infra" "pass" "coturn/static-auth-secret" ];
 | 
			
		||||
    destDir = "/secrets";
 | 
			
		||||
    user = "turnserver";
 | 
			
		||||
    group = "turnserver";
 | 
			
		||||
    permissions = "0640";
 | 
			
		||||
    uploadAt = "pre-activation";
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										15
									
								
								hosts/jackett/configuration.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								hosts/jackett/configuration.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,15 @@
 | 
			
		|||
{ config, pkgs, ... }:
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  imports = [
 | 
			
		||||
    ./hardware-configuration.nix
 | 
			
		||||
    ./jackett.nix
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  networking = {
 | 
			
		||||
    hostName = "jackett";
 | 
			
		||||
    firewall.enable = false;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  system.stateVersion = "23.05";
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										6
									
								
								hosts/jackett/jackett.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								hosts/jackett/jackett.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,6 @@
 | 
			
		|||
{ ... }:
 | 
			
		||||
{
 | 
			
		||||
  services.jackett = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										15
									
								
								hosts/netbox/configuration.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								hosts/netbox/configuration.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,15 @@
 | 
			
		|||
{ config, pkgs, ... }:
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  imports = [
 | 
			
		||||
    ./hardware-configuration.nix
 | 
			
		||||
    ./tor.nix
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  networking = {
 | 
			
		||||
    hostName = "tor-relay";
 | 
			
		||||
    firewall.enable = false;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  system.stateVersion = "23.05";
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										10
									
								
								hosts/netbox/netbox.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								hosts/netbox/netbox.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,10 @@
 | 
			
		|||
{ ... }:
 | 
			
		||||
{
 | 
			
		||||
  services.netox = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
 | 
			
		||||
    settings = {
 | 
			
		||||
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										15
									
								
								hosts/nitter/configuration.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								hosts/nitter/configuration.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,15 @@
 | 
			
		|||
{ config, pkgs, ... }:
 | 
			
		||||
{
 | 
			
		||||
  boot.loader.grub = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    version = 2;
 | 
			
		||||
    device = "/dev/vda";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  networking = {
 | 
			
		||||
    hostName = "nitter";
 | 
			
		||||
    firewall.enable = false;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  system.stateVersion = "23.05";
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										8
									
								
								hosts/nitter/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								hosts/nitter/default.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,8 @@
 | 
			
		|||
{ ... }:
 | 
			
		||||
{
 | 
			
		||||
  imports = [
 | 
			
		||||
    ./configuration.nix
 | 
			
		||||
    ./nginx.nix
 | 
			
		||||
    ./nitter.nix
 | 
			
		||||
  ];
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										29
									
								
								hosts/nitter/nginx.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								hosts/nitter/nginx.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,29 @@
 | 
			
		|||
{ ... }:
 | 
			
		||||
{
 | 
			
		||||
  services.nginx = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    enableReload = true;
 | 
			
		||||
    recommendedGzipSettings = true;
 | 
			
		||||
    recommendedOptimisation = true;
 | 
			
		||||
    recommendedProxySettings = true;
 | 
			
		||||
    recommendedTlsSettings = true;
 | 
			
		||||
 | 
			
		||||
    virtualHosts = {
 | 
			
		||||
      "nixos-nitter.vs.grzb.de" = {
 | 
			
		||||
        locations."/robots.txt" = {
 | 
			
		||||
          return = "200 \"User-agent: *\\nDisallow: /\\n\"";
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        locations."/" = {
 | 
			
		||||
          proxyPass = "http://localhost:8080";
 | 
			
		||||
          extraConfig =
 | 
			
		||||
            "proxy_http_version 1.1;" +
 | 
			
		||||
            "proxy_set_header Upgrade $http_upgrade;" +
 | 
			
		||||
            "proxy_set_header Connection \"upgrade\";" +
 | 
			
		||||
            "proxy_set_header Host $host;"
 | 
			
		||||
            ;
 | 
			
		||||
        };
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										19
									
								
								hosts/nitter/nitter.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								hosts/nitter/nitter.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,19 @@
 | 
			
		|||
{ ... }:
 | 
			
		||||
{
 | 
			
		||||
  services.nitter = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
 | 
			
		||||
    server = {
 | 
			
		||||
      title = "Birdsite";
 | 
			
		||||
      https = true;
 | 
			
		||||
      address = "0.0.0.0";
 | 
			
		||||
      port = 8080;
 | 
			
		||||
    };
 | 
			
		||||
    
 | 
			
		||||
    preferences = {
 | 
			
		||||
      theme = "Mastodon";
 | 
			
		||||
      replaceTwitter = "birdsite.nekover.se";
 | 
			
		||||
      infiniteScroll = true;
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										15
									
								
								hosts/tor-relay/configuration.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								hosts/tor-relay/configuration.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,15 @@
 | 
			
		|||
{ config, pkgs, ... }:
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  imports = [
 | 
			
		||||
    ./hardware-configuration.nix
 | 
			
		||||
    ./tor.nix
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  networking = {
 | 
			
		||||
    hostName = "tor-relay";
 | 
			
		||||
    firewall.enable = false;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  system.stateVersion = "23.05";
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										18
									
								
								hosts/tor-relay/tor.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								hosts/tor-relay/tor.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,18 @@
 | 
			
		|||
{ ... }:
 | 
			
		||||
{
 | 
			
		||||
  services.tor = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
 | 
			
		||||
    settings = {
 | 
			
		||||
      Nickname = "vsm";
 | 
			
		||||
      ORPort = 9001;
 | 
			
		||||
      ExitRelay = false;
 | 
			
		||||
      SOCKSPort = 0;
 | 
			
		||||
      ControlSocket = null;
 | 
			
		||||
      ContactInfo = "admin@grzb.de";
 | 
			
		||||
      RelayBandwidthRate = "70 MBits";
 | 
			
		||||
      RelayBandwidthBurst = "150 Mbits";
 | 
			
		||||
      DirPort = 9030;
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue