configurations of hq services
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.

configuration.nix 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # Edit this configuration file to define what should be installed on
  2. # your system. Help is available in the configuration.nix(5) man page
  3. # and in the NixOS manual (accessible by running ‘nixos-help’).
  4. { config, pkgs, lib, ... }:
  5. {
  6. imports =
  7. [ ../../../lib/lxc-container.nix
  8. ../../../lib/shared.nix
  9. ../../../lib/admins.nix
  10. ];
  11. networking = {
  12. hostName = "registry";
  13. # usePredictableInterfacenames = false;
  14. interfaces.eth0.ipv4.addresses = [{
  15. address = "172.22.99.34";
  16. prefixLength = 24;
  17. }];
  18. interfaces.eth0.ipv6.addresses = [{
  19. address= "2a02:8106:208:5201::34";
  20. prefixLength = 64;
  21. }];
  22. dhcpcd.denyInterfaces = [ "eth0" ];
  23. defaultGateway = {
  24. address = "172.22.99.1";
  25. interface = "eth0";
  26. metric = 10;
  27. };
  28. #defaultGateway6 = {
  29. # address = "fe80::a800:42ff:fe7a:3246";
  30. # interface = "ens18";
  31. #};
  32. };
  33. # Open ports in the firewall.
  34. networking.firewall.allowedTCPPorts = [
  35. 22
  36. 80
  37. 443
  38. 5000
  39. ];
  40. # List packages installed in system profile. To search, run:
  41. # $ nix search wget
  42. environment.systemPackages = with pkgs; [
  43. wget
  44. vim
  45. ];
  46. services.dockerRegistry = {
  47. enable = true;
  48. storagePath = "/srv/docker-registry";
  49. enableGarbageCollect = true;
  50. enableDelete = true;
  51. };
  52. services.nginx.enable = true;
  53. services.nginx.virtualHosts."registry.hq.c3d2.de" = {
  54. # serverAliases = [ "registry.serv.zentralwerk.org" ];
  55. enableACME = true;
  56. enableSSL = true;
  57. # forceSSL = true;
  58. locations.".well-known/acme-challenge/" = {
  59. root = "/var/lib/acme/acme-challenge/.well-known/acme-challenge/";
  60. };
  61. locations."/" = {
  62. proxyPass = "http://localhost:5000";
  63. };
  64. extraConfig = ''
  65. client_max_body_size 4096M;
  66. gzip off;
  67. '';
  68. };
  69. # This value determines the NixOS release with which your system is to be
  70. # compatible, in order to avoid breaking some software such as database
  71. # servers. You should change this only after NixOS release notes say you
  72. # should.
  73. system.stateVersion = "19.03"; # Did you read the comment?
  74. }