2022-04-29 22:24:44 +02:00
|
|
|
|
# Edit this configuration file to define what should be installed on
|
|
|
|
|
# your system. Help is available in the configuration.nix(5) man page
|
|
|
|
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
|
|
|
|
|
|
|
|
|
{ lib, config, pkgs, ... }:
|
|
|
|
|
{
|
|
|
|
|
imports = [ ];
|
|
|
|
|
|
|
|
|
|
# This value determines the NixOS release from which the default
|
|
|
|
|
# settings for stateful data, like file locations and database versions
|
|
|
|
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
|
|
|
|
# this value at the release version of the first install of this system.
|
|
|
|
|
# Before changing this value read the documentation for this option
|
|
|
|
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
|
|
|
system.stateVersion = "21.11"; # Did you read the comment?
|
|
|
|
|
|
|
|
|
|
# Additional packages
|
|
|
|
|
environment.systemPackages = with pkgs; [ ];
|
|
|
|
|
|
|
|
|
|
environment.noXlibs = lib.mkForce false;
|
|
|
|
|
|
|
|
|
|
networking.firewall.allowedTCPPorts = [ config.services.gitea.httpPort ];
|
|
|
|
|
|
2022-06-12 12:25:46 +02:00
|
|
|
|
services.openssh.startWhenNeeded = false;
|
|
|
|
|
|
2022-06-14 13:07:06 +02:00
|
|
|
|
services.fail2ban = {
|
|
|
|
|
enable = true;
|
|
|
|
|
maxretry = 3;
|
|
|
|
|
};
|
|
|
|
|
|
2022-07-31 16:12:03 +02:00
|
|
|
|
system.activationScripts.gitea-theme =
|
|
|
|
|
let
|
|
|
|
|
target_dir = "${config.services.gitea.stateDir}/custom/public/css/";
|
|
|
|
|
in
|
|
|
|
|
lib.stringAfter [ "var" ] ''
|
|
|
|
|
mkdir -p ${target_dir}
|
2022-08-20 10:32:59 +02:00
|
|
|
|
ln -sf ${pkgs.v.gitea-agatheme} "${target_dir}/theme-agatheme.css"
|
2022-07-31 16:12:03 +02:00
|
|
|
|
'';
|
|
|
|
|
|
2022-04-29 22:24:44 +02:00
|
|
|
|
services.gitea = {
|
|
|
|
|
enable = true;
|
|
|
|
|
domain = "git.0x76.dev";
|
|
|
|
|
rootUrl = "https://git.0x76.dev";
|
|
|
|
|
lfs.enable = true;
|
|
|
|
|
dump.type = "tar.gz";
|
|
|
|
|
database.type = "postgres";
|
|
|
|
|
ssh.clonePort = 42;
|
2022-07-31 16:12:03 +02:00
|
|
|
|
|
2022-04-29 22:24:44 +02:00
|
|
|
|
settings = {
|
2022-07-31 16:12:03 +02:00
|
|
|
|
repository = {
|
|
|
|
|
"ENABLE_PUSH_CREATE_USER" = true;
|
|
|
|
|
"DEFAULT_PUSH_CREATE_PRIVATE" = false;
|
|
|
|
|
};
|
|
|
|
|
service = {
|
|
|
|
|
"DEFAULT_KEEP_EMAIL_PRIVATE" = true;
|
2022-08-20 10:32:59 +02:00
|
|
|
|
"DISABLE_REGISTRATION" = true;
|
2022-07-31 16:12:03 +02:00
|
|
|
|
};
|
|
|
|
|
indexer = {
|
|
|
|
|
"REPO_INDEXER_ENABLED" = true;
|
|
|
|
|
"REPO_INDEXER_PATH" = "indexers/repos.bleve";
|
|
|
|
|
"UPDATE_BUFFER_LEN" = 20;
|
|
|
|
|
"MAX_FILE_SIZE" = 1048576;
|
|
|
|
|
"REPO_INDEXER_EXCLUDE" = "node_modules/**";
|
|
|
|
|
};
|
2022-04-29 22:24:44 +02:00
|
|
|
|
ui = {
|
2022-07-31 16:12:03 +02:00
|
|
|
|
"THEMES" = "gitea,arc-green,agatheme";
|
|
|
|
|
"DEFAULT_THEME" = "agatheme";
|
|
|
|
|
"USE_SERVICE_WORKER" = true;
|
|
|
|
|
};
|
|
|
|
|
server = {
|
|
|
|
|
"LANDING_PAGE" = "explore";
|
|
|
|
|
};
|
|
|
|
|
session = {
|
|
|
|
|
"PROVIDER" = "db";
|
2022-08-20 10:32:59 +02:00
|
|
|
|
"COOKIE_SECURE" = true;
|
2022-04-29 22:24:44 +02:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|