1
1
Fork 0
deployed-nixos-server-and-apps/nixos-apps/git.ewanick.com.nix

87 lines
2.1 KiB
Nix

{ pkgs, config, ... }:
let baseUrl = "git.ewanick.com";
in
{
services.gitea = {
enable = true;
appName = "Bill's Gitea server, hosted on Linode using NixOS";
settings = {
server = {
DOMAIN = baseUrl;
ROOT_URL = "https://${baseUrl}/";
HTTP_PORT = 3000;
};
service = {
DISABLE_REGISTRATION = true;
};
actions = {
ENABLED = true;
DEFAULT_ACTIONS_URL = "self";
};
};
};
# Shamelessly stolen from:
# <https://github.com/foo-dogsquared/nixos-config/blob/626a92624d1d2e9376adda879eef6a570b4be1e4/hosts/plover/modules/services/gitea.nix#L203-L215>
# Customizing Gitea which you can see more details at
# https://docs.gitea.io/en-us/customizing-gitea/. We're just using
# systemd-tmpfiles to make this work which is pretty convenient.
systemd.tmpfiles.rules =
let
# To be used similarly to $GITEA_CUSTOM variable.
giteaCustomDir = config.services.gitea.customDir;
in
[
"L+ ${giteaCustomDir}/templates/home.tmpl - - - - ${./${baseUrl}/home.tmpl}"
# "L+ ${giteaCustomDir}/public/img/logo.svg - - - - ${./${baseUrl}/logo.svg}"
# "L+ ${giteaCustomDir}/public/img/logo.png - - - - ${./${baseUrl}/logo.png}"
];
# services.gitea-actions-runner.instances = {
# "first-runner" = {
# enable = true;
# url = baseUrl;
# tokenFile = ./git.ewanick.com/tokenFile;
# hostPackages = with pkgs; [
# bash
# coreutils
# curl
# gawk
# gitMinimal
# gnused
# wget
# ];
# name = "linode-nixos";
# labels = [
# "native:host"
# ];
# };
# };
services.caddy = {
enable = true;
virtualHosts = {
"${baseUrl}" = {
extraConfig = ''
reverse_proxy localhost:3000
'';
};
};
};
}
/*
# README
## View users and use the command line
Do something like this, preferably as the gitea user
```bash
$ sudo su gitea
$ /nix/store/5xwh7m7252m9ljvr3lyilcza1q699r2c-gitea-1.17.4/bin/gitea -c /var/lib/gitea/custom/conf/app.ini admin user list
```
*/