Setup gitea on ao

This commit is contained in:
Henrik Lissner 2019-11-18 21:41:35 -05:00
parent 16b8072c25
commit a62c49661e
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 51 additions and 22 deletions

View file

@ -10,6 +10,8 @@
./modules/services/nginx.nix ./modules/services/nginx.nix
./modules/services/gitea.nix ./modules/services/gitea.nix
./modules/services/syncthing.nix ./modules/services/syncthing.nix
./modules/shell/git.nix
./modules/shell/zsh.nix ./modules/shell/zsh.nix
]; ];
@ -21,33 +23,36 @@
networking.firewall.allowedTCPPorts = [ 8384 ]; networking.firewall.allowedTCPPorts = [ 8384 ];
# nginx hosts # nginx hosts
services.nginx.virtualHosts = { services.nginx = {
user = "hlissner";
virtualHosts = {
"v0.io" = { "v0.io" = {
default = true; default = true;
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
root = "/home/hlissner/www/v0.io"; root = "/var/www/v0.io";
}; };
"dl.v0.io" = { "dl.v0.io" = {
enableACME = true; enableACME = true;
addSSL = true; addSSL = true;
root = "/home/hlissner/www/dl.v0.io"; root = "/var/www/dl.v0.io";
locations."~* \.(?:ico|css|js|gif|jpe?g|png|mp4)$".extraConfig = '' locations."~* \.(?:ico|css|js|gif|jpe?g|png|mp4)$".extraConfig = ''
expires 30d; expires 30d;
add_header Pragma public; add_header Pragma public;
add_header Cache-Control public; add_header Cache-Control public;
''; '';
}; };
# "git.v0.io" = { "git.v0.io" = {
# enableACME = true; enableACME = true;
# forceSSL = true; forceSSL = true;
# locations."/".proxyPass = http://gitea; locations."/".proxyPass = http://127.0.0.1:3000;
# }; };
};
}; };
security.acme.certs = { security.acme.certs = {
"v0.io".email = "henrik@lissner.net"; "v0.io".email = "henrik@lissner.net";
"dl.v0.io".email = "henrik@lissner.net"; "dl.v0.io".email = "henrik@lissner.net";
# "git.v0.io".email = "henrik@lissner.net"; "git.v0.io".email = "henrik@lissner.net";
}; };
} }

View file

@ -1,5 +1,29 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
users.users.git = {
useDefaultShell = true;
home = "/var/lib/gitea";
group = "gitea";
};
services.gitea = {
enable = true;
log.level = "Info";
appName = "V-NOUGHT";
database = {
user = "git";
type = "postgres";
};
domain = "v0.io";
rootUrl = "https://git.v0.io/";
cookieSecure = true;
useWizard = false;
disableRegistration = true;
extraConfig = ''
[server]
SSH_DOMAIN = v0.io
'';
};
} }