setup opengist
This commit is contained in:
		
							parent
							
								
									f2d9cfc350
								
							
						
					
					
						commit
						961bfc2afb
					
				
					 5 changed files with 68 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -9,6 +9,7 @@
 | 
			
		|||
    ./minecraft
 | 
			
		||||
    ./mpd
 | 
			
		||||
    ./murmur
 | 
			
		||||
    ./opengist
 | 
			
		||||
    ./traefik
 | 
			
		||||
  ];
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										
											BIN
										
									
								
								nixos/viridian/services/opengist/assets/pikachu.png
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								nixos/viridian/services/opengist/assets/pikachu.png
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 52 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								nixos/viridian/services/opengist/assets/pokeball.png
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								nixos/viridian/services/opengist/assets/pokeball.png
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 48 KiB  | 
							
								
								
									
										62
									
								
								nixos/viridian/services/opengist/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								nixos/viridian/services/opengist/default.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,62 @@
 | 
			
		|||
{...}: let
 | 
			
		||||
  port = "6157";
 | 
			
		||||
in {
 | 
			
		||||
  # OpenGist service configuration
 | 
			
		||||
  virtualisation.oci-containers.containers = {
 | 
			
		||||
    opengist = {
 | 
			
		||||
      image = "ghcr.io/thomiceli/opengist:1.10";
 | 
			
		||||
      ports = [
 | 
			
		||||
        "${port}:${port}"
 | 
			
		||||
      ];
 | 
			
		||||
      volumes = [
 | 
			
		||||
        "/var/lib/opengist:/opengist"
 | 
			
		||||
      ];
 | 
			
		||||
      # Environment variables for OpenGist
 | 
			
		||||
      environment = {
 | 
			
		||||
        PUID = "1000";
 | 
			
		||||
        PGID = "100";
 | 
			
		||||
        # Custom OpenGist configuration
 | 
			
		||||
        OG_CUSTOM_LOGO = "pikachu.png";
 | 
			
		||||
        OG_CUSTOM_FAVICON = "pokeball.png";
 | 
			
		||||
        OG_CUSTOM_NAME = "PokeGist";
 | 
			
		||||
        # Disable SSH Git support
 | 
			
		||||
        OG_SSH_GIT_ENABLED = "false";
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  # Traefik configuration
 | 
			
		||||
  services.traefik.dynamicConfigOptions.http = {
 | 
			
		||||
    # OpenGist Router
 | 
			
		||||
    routers.opengist = {
 | 
			
		||||
      rule = "Host(`ps7e.xyz`)";
 | 
			
		||||
      entryPoints = [
 | 
			
		||||
        "websecure"
 | 
			
		||||
      ];
 | 
			
		||||
      service = "opengist";
 | 
			
		||||
    };
 | 
			
		||||
    # OpenGist Service
 | 
			
		||||
    services.opengist = {
 | 
			
		||||
      loadBalancer.servers = [
 | 
			
		||||
        {url = "http://127.0.0.1:${port}";}
 | 
			
		||||
      ];
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  # Persist data for OpenGist
 | 
			
		||||
  environment.persistence."/persist" = {
 | 
			
		||||
    directories = [
 | 
			
		||||
      {
 | 
			
		||||
        directory = "/var/lib/opengist";
 | 
			
		||||
        user = "sajenim";
 | 
			
		||||
        group = "users";
 | 
			
		||||
      }
 | 
			
		||||
    ];
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  # Activation script to create symlinks for custom assets
 | 
			
		||||
  system.activationScripts.opengist-symlink = ''
 | 
			
		||||
    cp ${toString ./assets/pikachu.png} /var/lib/opengist/custom/pikachu.png
 | 
			
		||||
    cp ${toString ./assets/pokeball.png} /var/lib/opengist/custom/pokeball.png
 | 
			
		||||
  '';
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -118,6 +118,11 @@
 | 
			
		|||
                main = "sajkbd.io";
 | 
			
		||||
                sans = ["*.sajkbd.io"];
 | 
			
		||||
              }
 | 
			
		||||
              {
 | 
			
		||||
                # Pastes
 | 
			
		||||
                main = "ps7e.xyz";
 | 
			
		||||
                sans = ["*.ps7e.xyz"];
 | 
			
		||||
              }
 | 
			
		||||
            ];
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue