Work on hydra config, fix tor relay config, prepare web-public-2 host
This commit is contained in:
		
					parent
					
						
							
								64d9dbd4b0
							
						
					
				
			
			
				commit
				
					
						c6f4780ccd
					
				
			
		
					 15 changed files with 176 additions and 9 deletions
				
			
		
							
								
								
									
										14
									
								
								hosts/hydra/configuration.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								hosts/hydra/configuration.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,14 @@
 | 
			
		|||
{ ... }:
 | 
			
		||||
{
 | 
			
		||||
  boot.loader.grub = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    device = "/dev/vda";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  networking = {
 | 
			
		||||
    hostName = "hydra";
 | 
			
		||||
    firewall.enable = false;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  system.stateVersion = "23.05";
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										10
									
								
								hosts/hydra/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								hosts/hydra/default.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,10 @@
 | 
			
		|||
{ ... }:
 | 
			
		||||
{
 | 
			
		||||
  imports = [
 | 
			
		||||
    ./configuration.nix
 | 
			
		||||
    ./secrets.nix
 | 
			
		||||
    ./hydra.nix
 | 
			
		||||
    ./nix-serve.nix
 | 
			
		||||
    ./nginx.nix
 | 
			
		||||
  ];
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										14
									
								
								hosts/hydra/hydra.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								hosts/hydra/hydra.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,14 @@
 | 
			
		|||
{ ... }:
 | 
			
		||||
{
 | 
			
		||||
  services.hydra = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    hydraURL = "https://hydra.nekover.se";
 | 
			
		||||
    listenHost = "localhost";
 | 
			
		||||
    port = 3001;
 | 
			
		||||
    useSubstitutes = true;
 | 
			
		||||
    notificationSender = "hydra@robot.grzb.de";
 | 
			
		||||
    extraConfig = "
 | 
			
		||||
      binary_cache_public_uri = https://nix-cache.nekover.se
 | 
			
		||||
    ";
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										33
									
								
								hosts/hydra/nginx.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								hosts/hydra/nginx.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,33 @@
 | 
			
		|||
{ ... }:
 | 
			
		||||
{
 | 
			
		||||
  services.nginx = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    virtualHosts = {
 | 
			
		||||
 | 
			
		||||
      "hydra.nekover.se" = {
 | 
			
		||||
        enableACME = true;
 | 
			
		||||
        listen = [{
 | 
			
		||||
          addr = "0.0.0.0";
 | 
			
		||||
          port = 8443;
 | 
			
		||||
          ssl = true;
 | 
			
		||||
        }];
 | 
			
		||||
        locations."/" = {
 | 
			
		||||
          proxyPass = "http://localhost:3001";
 | 
			
		||||
        };
 | 
			
		||||
      };
 | 
			
		||||
 | 
			
		||||
      "nix-cache.nekover.se" = {
 | 
			
		||||
        enableACME = true;
 | 
			
		||||
        listen = [{
 | 
			
		||||
          addr = "0.0.0.0";
 | 
			
		||||
          port = 8443;
 | 
			
		||||
          ssl = true;
 | 
			
		||||
        }];
 | 
			
		||||
        locations."/" = {
 | 
			
		||||
          proxyPass = "http://localhost:5005";
 | 
			
		||||
        };
 | 
			
		||||
      };
 | 
			
		||||
      
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										9
									
								
								hosts/hydra/nix-serve.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								hosts/hydra/nix-serve.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,9 @@
 | 
			
		|||
{ ... }:
 | 
			
		||||
{
 | 
			
		||||
  services.nix-serve = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    port = 5005;
 | 
			
		||||
    bindAddress = "localhost";
 | 
			
		||||
    secretKeyFile = "/secrets/signing-key.secret";
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										11
									
								
								hosts/hydra/secrets.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								hosts/hydra/secrets.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,11 @@
 | 
			
		|||
{ ... }:
 | 
			
		||||
{
 | 
			
		||||
  deployment.keys."signing-key.secret" = {
 | 
			
		||||
    keyCommand = [ "env" "GNUPGHOME=/home/yuri/.passinfra_gnupg" "PASSWORD_STORE_DIR=/home/yuri/pass/infra" "pass" "hydra/signing-key" ];
 | 
			
		||||
    destDir = "/secrets";
 | 
			
		||||
    user = "root";
 | 
			
		||||
    group = "root";
 | 
			
		||||
    permissions = "0640";
 | 
			
		||||
    uploadAt = "pre-activation";
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
{ config, pkgs, ... }:
 | 
			
		||||
{ ... }:
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  imports = [
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,16 +3,18 @@
 | 
			
		|||
  services.tor = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
 | 
			
		||||
    relay = {
 | 
			
		||||
      enable = true;
 | 
			
		||||
      role = "relay";
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    settings = {
 | 
			
		||||
      Nickname = "vsm";
 | 
			
		||||
      ORPort = 9001;
 | 
			
		||||
      ExitRelay = false;
 | 
			
		||||
      SOCKSPort = 0;
 | 
			
		||||
      ControlSocket = null;
 | 
			
		||||
      DirPort = 9030;
 | 
			
		||||
      ContactInfo = "admin@grzb.de";
 | 
			
		||||
      RelayBandwidthRate = "40 MBits";
 | 
			
		||||
      RelayBandwidthBurst = "50 Mbits";
 | 
			
		||||
      DirPort = 9030;
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										14
									
								
								hosts/web-public-2/configuration.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								hosts/web-public-2/configuration.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,14 @@
 | 
			
		|||
{ ... }:
 | 
			
		||||
{
 | 
			
		||||
  boot.loader.grub = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    device = "/dev/vda";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  networking = {
 | 
			
		||||
    hostName = "web-public-02";
 | 
			
		||||
    firewall.enable = false;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  system.stateVersion = "23.05";
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										7
									
								
								hosts/web-public-2/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								hosts/web-public-2/default.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,7 @@
 | 
			
		|||
{ ... }:
 | 
			
		||||
{
 | 
			
		||||
  imports = [
 | 
			
		||||
    ./configuration.nix
 | 
			
		||||
    ./nginx.nix
 | 
			
		||||
  ];
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										6
									
								
								hosts/web-public-2/nginx.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								hosts/web-public-2/nginx.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,6 @@
 | 
			
		|||
{ ... }:
 | 
			
		||||
{
 | 
			
		||||
  services.nginx = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue