diff --git a/hosts/rpi4/gitea.nix b/hosts/rpi4/gitea.nix new file mode 100644 index 0000000..35229f7 --- /dev/null +++ b/hosts/rpi4/gitea.nix @@ -0,0 +1,52 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.services.gitea; +in +{ + config = { + services.gitea = { + enable = true; + lfs.enable = true; + settings = { + repository = { + ENABLE_PUSH_CREATE_USER = true; + ENABLE_PUSH_CREATE_ORG = true; + DEFAULT_PUSH_CREATE_PRIVATE = true; + }; + + server = { + ROOT_URL = "https://gitea.protogen.io/"; + LANDING_PAGE = "explore"; + OFFLINE_MODE = false; + }; + + service.DISABLE_REGISTRATION = true; + + session = { + COOKIE_NAME = "session"; + COOKIE_SECURE = false; + PROVIDER = "file"; + }; + # TODO package themes + ui = { + DEFAULT_THEME = "catppuccin-mocha-pink"; + THEMES = let + ctpAttrs = { + flavor = [ "latte" "frappe" "macchiato" "mocha" ]; + accent = [ "rosewater" "flamingo" "pink" "mauve" + "red" "maroon" "peach" "yellow" "green" "teal" + "sky" "sapphire" "blue" ]; + }; + ctpThemes = lib.mapCartesianProduct + ( { flavor, accent }: "catppuccin-${flavor}-${accent}" ) + ctpAttrs; + in lib.concatStringsSep "," ([ + "gitea" + "arc-green" + "auto" + ] ++ ctpThemes); + }; + }; + }; + }; +} diff --git a/hosts/rpi4/services.nix b/hosts/rpi4/services.nix index a9d29d3..3aa6145 100644 --- a/hosts/rpi4/services.nix +++ b/hosts/rpi4/services.nix @@ -1,5 +1,8 @@ { config, lib, pkgs, ... }: { + imports = [ + ./gitea.nix + ]; config = { age.secrets.cloudflaredns = {