Restructure folders, add mail host
				
					
				
			The entire file structure has been reorganised into stable and unstable to separate deployments running on either channel. A `mail` host running Simple Nix Mailserver has also been added for testing to see if it's a good alternative to soverin as well as SMTP for other services.
This commit is contained in:
		
							parent
							
								
									51ba0ae296
								
							
						
					
					
						commit
						90eb0c3708
					
				
					 78 changed files with 535 additions and 1 deletions
				
			
		
							
								
								
									
										9
									
								
								stable/config/hosts/mail/services/acme.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								stable/config/hosts/mail/services/acme.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,9 @@
 | 
			
		|||
{ config, ... }:
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  security.acme = {
 | 
			
		||||
    acceptTerms = true;
 | 
			
		||||
    email = "admin+certs@graven.dev";
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										25
									
								
								stable/config/hosts/mail/services/mail.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								stable/config/hosts/mail/services/mail.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,25 @@
 | 
			
		|||
{ config, ... }:
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  imports = [
 | 
			
		||||
    (builtins.fetchTarball {
 | 
			
		||||
      # Pick a commit from the branch you are interested in
 | 
			
		||||
      url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/5675b122a947b40e551438df6a623efad19fd2e7/nixos-mailserver-5675b122a947b40e551438df6a623efad19fd2e7.tar.gz";
 | 
			
		||||
      # And set its hash
 | 
			
		||||
      sha256 = "1fwhb7a5v9c98nzhf3dyqf3a5ianqh7k50zizj8v5nmj3blxw4pi";
 | 
			
		||||
    })
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  mailserver = {
 | 
			
		||||
    enable = true;
 | 
			
		||||
    fqdn = "mail.graven.dev";
 | 
			
		||||
    domains = [ "anarkafem.dev" ];
 | 
			
		||||
 | 
			
		||||
    loginAccounts = {
 | 
			
		||||
      "noreply@anarkafem.dev" = {
 | 
			
		||||
        hashedPasswordFile = config.secrets.files.mail_noreply_anarkafem_dev.file;
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
    certificateScheme = 3;
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										47
									
								
								stable/config/hosts/mail/services/restic.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								stable/config/hosts/mail/services/restic.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,47 @@
 | 
			
		|||
{ config, ... }:
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
  services.restic.backups = {
 | 
			
		||||
    "gitea" = {
 | 
			
		||||
      paths = [ "/var/lib/gitea" ];
 | 
			
		||||
      repository = "sftp:restic@despondos.nao.sh:/etheria/backup/wind/gitea";
 | 
			
		||||
      initialize = true;
 | 
			
		||||
      pruneOpts = [ "--keep-daily 7" "--keep-weekly 5" "--keep-monthly 12" "--keep-yearly 75" ];
 | 
			
		||||
      timerConfig = { "OnCalendar" = "02:15"; };
 | 
			
		||||
      extraOptions = [ "sftp.command='ssh restic@despondos.nao.sh -i ${config.secrets.files.ssh_key.file} -s sftp'" ];
 | 
			
		||||
      passwordFile = builtins.toString config.secrets.files.restic_pass.file;
 | 
			
		||||
      user = "gitea";
 | 
			
		||||
    };
 | 
			
		||||
    "postgres" = {
 | 
			
		||||
      paths = [ "/var/lib/postgresql/backup" ];
 | 
			
		||||
      repository = "sftp:restic@despondos.nao.sh:/etheria/backup/wind/postgres";
 | 
			
		||||
      initialize = true;
 | 
			
		||||
      pruneOpts = [ "--keep-daily 7" "--keep-weekly 5" "--keep-monthly 12" "--keep-yearly 75" ];
 | 
			
		||||
      timerConfig = { "OnCalendar" = "03:00"; };
 | 
			
		||||
      extraOptions = [ "sftp.command='ssh restic@despondos.nao.sh -i ${config.secrets.files.ssh_key.file} -s sftp'" ];
 | 
			
		||||
      passwordFile = builtins.toString config.secrets.files.restic_pass.file;
 | 
			
		||||
      user = "postgres";
 | 
			
		||||
    };
 | 
			
		||||
    "synapse" = {
 | 
			
		||||
      paths = [ "/var/lib/matrix-synapse" ];
 | 
			
		||||
      repository = "sftp:restic@despondos.nao.sh:/etheria/backup/wind/synapse";
 | 
			
		||||
      initialize = true;
 | 
			
		||||
      pruneOpts = [ "--keep-daily 7" "--keep-weekly 5" "--keep-monthly 12" "--keep-yearly 75" ];
 | 
			
		||||
      timerConfig = { "OnCalendar" = "03:30"; };
 | 
			
		||||
      extraOptions = [ "sftp.command='ssh restic@despondos.nao.sh -i ${config.secrets.files.ssh_key.file} -s sftp'" ];
 | 
			
		||||
      passwordFile = builtins.toString config.secrets.files.restic_pass.file;
 | 
			
		||||
      user = "matrix-synapse";
 | 
			
		||||
    };
 | 
			
		||||
    "vaultwarden" = {
 | 
			
		||||
      paths = [ "/var/lib/bitwarden_rs" ];
 | 
			
		||||
      repository = "sftp:restic@despondos.nao.sh:/etheria/backup/wind/vaultwarden";
 | 
			
		||||
      initialize = true;
 | 
			
		||||
      pruneOpts = [ "--keep-daily 7" "--keep-weekly 5" "--keep-monthly 12" "--keep-yearly 75" ];
 | 
			
		||||
      timerConfig = { "OnCalendar" = "23:45"; };
 | 
			
		||||
      extraOptions = [ "sftp.command='ssh restic@despondos.nao.sh -i ${config.secrets.files.ssh_key.file} -s sftp'" ];
 | 
			
		||||
      passwordFile = builtins.toString config.secrets.files.restic_pass.file;
 | 
			
		||||
      user = "vaultwarden";
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue