Setup mail server and restructure some things
This commit is contained in:
		
					parent
					
						
							
								fa3db3bad6
							
						
					
				
			
			
				commit
				
					
						4a802ab44d
					
				
			
		
					 90 changed files with 512 additions and 66 deletions
				
			
		
							
								
								
									
										17
									
								
								config/hosts/netbox/configuration.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								config/hosts/netbox/configuration.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,17 @@
 | 
			
		|||
{ ... }:
 | 
			
		||||
{
 | 
			
		||||
  boot.loader.grub = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    device = "/dev/vda";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  networking = {
 | 
			
		||||
    hostName = "netbox";
 | 
			
		||||
    firewall = {
 | 
			
		||||
      enable = true;
 | 
			
		||||
      allowedTCPPorts = [ 80 443 ];
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  system.stateVersion = "23.05";
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										8
									
								
								config/hosts/netbox/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								config/hosts/netbox/default.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,8 @@
 | 
			
		|||
{ ... }:
 | 
			
		||||
{
 | 
			
		||||
  imports = [
 | 
			
		||||
    ./configuration.nix
 | 
			
		||||
    ./netbox.nix
 | 
			
		||||
    ./nginx.nix
 | 
			
		||||
  ];
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										7
									
								
								config/hosts/netbox/netbox.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								config/hosts/netbox/netbox.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,7 @@
 | 
			
		|||
{ ... }:
 | 
			
		||||
{
 | 
			
		||||
  services.netbox = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    secretKeyFile = "/secrets/netbox-secret-key.secret";
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										29
									
								
								config/hosts/netbox/nginx.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								config/hosts/netbox/nginx.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,29 @@
 | 
			
		|||
{ config, ... }:
 | 
			
		||||
{
 | 
			
		||||
  services.nginx = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    clientMaxBodySize = "25m";
 | 
			
		||||
    user = "netbox";
 | 
			
		||||
    virtualHosts."netbox.grzb.de" = {
 | 
			
		||||
      forceSSL = true;
 | 
			
		||||
      enableACME = true;
 | 
			
		||||
      listen = [
 | 
			
		||||
        {
 | 
			
		||||
          addr = "0.0.0.0";
 | 
			
		||||
          port = 80;
 | 
			
		||||
        }
 | 
			
		||||
        {
 | 
			
		||||
          addr = "0.0.0.0";
 | 
			
		||||
          port = 443;
 | 
			
		||||
          ssl = true;
 | 
			
		||||
        }
 | 
			
		||||
      ];
 | 
			
		||||
      locations."/static/" = {
 | 
			
		||||
        alias = "${config.services.netbox.dataDir}/static/";
 | 
			
		||||
      };
 | 
			
		||||
      locations."/" = {
 | 
			
		||||
        proxyPass = "http://${config.services.netbox.listenAddress}:${builtins.toString config.services.netbox.port}";
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										11
									
								
								config/hosts/netbox/secrets.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								config/hosts/netbox/secrets.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,11 @@
 | 
			
		|||
{ ... }:
 | 
			
		||||
{
 | 
			
		||||
  deployment.keys."netbox-secret-key.secret" = {
 | 
			
		||||
    keyCommand = [ "env" "GNUPGHOME=/home/yuri/.passinfra_gnupg" "PASSWORD_STORE_DIR=/home/yuri/pass/infra" "pass" "netbox/secret-key" ];
 | 
			
		||||
    destDir = "/secrets";
 | 
			
		||||
    user = "netbox";
 | 
			
		||||
    group = "netbox";
 | 
			
		||||
    permissions = "0640";
 | 
			
		||||
    uploadAt = "pre-activation";
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue