A collection of example NixOS files that be included into configuration.nix on NixOS.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.5KB

  1. # Gitea configuration for the VMs running Gitea
  2. #
  3. # This file is intended to be imported into a file that defines the host, such
  4. # as gitea_vm.nix in this directory. It is for playing with / testing Gitea and
  5. # should not be used as an example of a production deployment.
  6. #
  7. # This is very basic Gitea setup, you can create an account, poke around even
  8. # push git repos to it as per the README.
  9. { config, pkgs, lib, ... }:
  10. {
  11. services.gitea = {
  12. enable = true; # Enable Gitea
  13. database = {
  14. type = "postgres"; # Database type
  15. password = "gitea"; # Set the password
  16. };
  17. domain = "gitea-vm"; # Domain name
  18. rootUrl = "http://localhost/"; # Root web URL
  19. httpPort = 3001; # Provided unique port
  20. };
  21. services.postgresql = {
  22. enable = true; # Ensure postgresql is enabled
  23. identMap = # Map the gitea user to postgresql
  24. ''
  25. gitea-users gitea gitea
  26. '';
  27. };
  28. services.nginx = {
  29. enable = true; # Enable Nginx
  30. recommendedGzipSettings = true;
  31. recommendedOptimisation = true;
  32. recommendedProxySettings = true;
  33. recommendedTlsSettings = true;
  34. virtualHosts."localhost" = { # Gitea hostname
  35. locations."/".proxyPass = "http://localhost:3001/"; # Proxy Gitea
  36. };
  37. };
  38. }