1
0
Fork 0
mirror of https://git.oat.zone/dark-firepit/dotfiles synced 2024-05-08 21:36:10 +02:00
git.oat.zone--dark-firepit-.../modules/services/gitea.nix
Jill "oatmealine" Monoids 7331092d87 partially update flake
nixpkgs has been left untouched because of this error:
error: Package ‘nix-linter-0.2.0.4’ in /nix/store/lzgxbh8c61phbh074y2707l2yw6vvaa1-source/pkgs/development/tools/analysis/nix-linter/default.nix:23 is marked as broken, refusing to evaluate.

additionally, nixpkgs-master has been removed - there was no real use for it
2023-01-19 00:21:18 +01:00

60 lines
1.5 KiB
Nix

{ config, lib, pkgs, options, ... }:
with lib;
let
cfg = config.modules.services.gitea;
in {
options.modules.services.gitea = {
enable = mkOption {
type = types.bool;
default = false;
};
domain = mkOption {
type = types.str;
default = "git.oat.zone";
};
port = mkOption {
type = types.int;
default = 3000;
};
};
config = mkIf cfg.enable {
services = {
gitea = {
enable = true;
package = pkgs.unstable.gitea;
disableRegistration = true;
domain = cfg.domain;
httpPort = cfg.port;
rootUrl = "https://${cfg.domain}/";
stateDir = "/var/lib/${cfg.domain}";
cookieSecure = true;
appName = "Gitea: dark-firepit hosted Git";
database = {
type = "postgres";
name = "gitea";
};
settings = mkMerge [ (builtins.fromTOML (builtins.readFile "/etc/dotfiles/config/gitea/app.toml")) {
"ui.meta" = {
AUTHOR = "aether & oat";
DESCRIPTION = "dark-firepit's shared git instance";
};
}];
};
nginx.virtualHosts."${cfg.domain}" = {
forceSSL = true;
enableACME = true;
# using manual extraconfig because else nginx spits out a runtime error????
# thanks nginx
#locations."/".proxyPass = "http://127.0.0.1:${toString cfg.port};";
locations."/".extraConfig = ''
client_max_body_size 600M;
proxy_pass http://127.0.0.1:${toString cfg.port};
'';
};
};
};
}