diff --git a/capytal/TRADEMARK b/capytal/TRADEMARK new file mode 100644 index 0000000..c3c6eac --- /dev/null +++ b/capytal/TRADEMARK @@ -0,0 +1,2 @@ +"Capytal", "Capytal Company", "Capytal Code", "Capytal Creators", the Capytal Logo, +the Capytal Code Logo, are trademarks of Gustavo L. de Mello. diff --git a/capytal/default.nix b/capytal/default.nix new file mode 100644 index 0000000..a86d834 --- /dev/null +++ b/capytal/default.nix @@ -0,0 +1,5 @@ +{...}: { + imports = [ + ./forgejo + ]; +} diff --git a/capytal/forgejo/assets/icon.png b/capytal/forgejo/assets/icon.png new file mode 100644 index 0000000..491a401 Binary files /dev/null and b/capytal/forgejo/assets/icon.png differ diff --git a/capytal/forgejo/assets/icon.svg b/capytal/forgejo/assets/icon.svg new file mode 100644 index 0000000..7f479ff --- /dev/null +++ b/capytal/forgejo/assets/icon.svg @@ -0,0 +1,288 @@ + + + + diff --git a/capytal/forgejo/assets/logo.png b/capytal/forgejo/assets/logo.png new file mode 100644 index 0000000..6b10717 Binary files /dev/null and b/capytal/forgejo/assets/logo.png differ diff --git a/capytal/forgejo/assets/logo.svg b/capytal/forgejo/assets/logo.svg new file mode 100644 index 0000000..5e19548 --- /dev/null +++ b/capytal/forgejo/assets/logo.svg @@ -0,0 +1,288 @@ + + + + diff --git a/capytal/forgejo/default.nix b/capytal/forgejo/default.nix new file mode 100644 index 0000000..27aa9ad --- /dev/null +++ b/capytal/forgejo/default.nix @@ -0,0 +1,103 @@ +{ + config, + inputs, + pkgs, + pkgs-unstable, + ... +}: +with builtins; let + secrets = config.spacestation-secrets.lesser; + + frappurccino-theme = + readFile + "${inputs.frappurccino-forgejo.packages.${pkgs.system}.default}/css/theme-frappurccino-mocha-sky.css"; + + cal-sans = pkgs.fetchzip { + url = "https://github.com/calcom/font/releases/download/v1.0.0/CalSans_Semibold_v1.0.0.zip"; + stripRoot = false; + hash = "sha256-JqU64JUgWimJgrKX3XYcml8xsvy//K7O5clNKJRGaTM="; + }; + fonts-css = pkgs.writeText "custom.css" '' + @font-face { + family: 'Cal Sans'; + src: + url('assets/fonts/CalSans-SemiBold.woff2') format('woff2'), + url('assets/fonts/CalSans-SemiBold.woff') format('woff'), + url('assets/fonts/CalSans-SemiBold.ttf') format('truetype'); + }; + ''; +in { + imports = [ + ../../modules/forgejo + ]; + services.forgejo = { + enable = true; + package = pkgs-unstable.forgejo; + actions = { + enable = true; + token = secrets.services.forgejo.actions-token; + url = "https://forgejo.capytal.company"; + labels = secrets.services.forgejo.actions-labels; + }; + customization = { + assets = { + "fonts" = { + source = "${cal-sans}/fonts/webfonts"; + recursive = true; + }; + "fonts.css" = { + source = fonts-css; + }; + "img/home-logo.png" = { + source = ./assets/logo.png; + }; + "img/home-logo.svg" = { + source = ./assets/logo.svg; + }; + }; + templates = { + header = '' + + ${readFile ./templates/custom/header.tmpl} + ''; + home = ./templates/home.tmpl; + }; + theme = { + "frappurccino" = frappurccino-theme; + }; + favicon.png = ./assets/icon.png; + favicon.svg = ./assets/icon.svg; + logo.png = ./assets/icon.png; + logo.svg = ./assets/icon.svg; + }; + # users = { + # user1 = { + # name = /. + config.sops.secrets."forgejo/user1/name".path; + # password = /. + config.sops.secrets."forgejo/user1/password".path; + # email = /. + config.sops.secrets."forgejo/user1/email".path; + # admin = true; + # }; + # }; + settings = { + DEFAULT = { + APP_NAME = "Capytal Code"; + }; + server = rec { + HTTP_PORT = secrets.services.forgejo.port; + DOMAIN = "forgejo.capytal.company"; + ROOT_URL = "https://${DOMAIN}"; + }; + admin = { + DISABLE_REGULAR_ORG_CREATION = true; + USER_DISABLED_FEATURES = "deletion manage_ssh_keys manage_gpg_keys"; + EXTERNAL_USER_DISABLED_FEATURES = "deletion manage_ssh_keys manage_gpg_keys"; + }; + service = { + DISABLE_REGISTRATION = true; + }; + ui = { + DEFAULT_THEME = "frappurccino"; + }; + }; + }; +} diff --git a/capytal/forgejo/templates/custom/header.tmpl b/capytal/forgejo/templates/custom/header.tmpl new file mode 100644 index 0000000..645a4e0 --- /dev/null +++ b/capytal/forgejo/templates/custom/header.tmpl @@ -0,0 +1,55 @@ + + + + + + diff --git a/capytal/forgejo/templates/explore/repo_list.tmpl b/capytal/forgejo/templates/explore/repo_list.tmpl new file mode 100644 index 0000000..63cd955 --- /dev/null +++ b/capytal/forgejo/templates/explore/repo_list.tmpl @@ -0,0 +1,73 @@ +
diff --git a/capytal/forgejo/templates/explore/user_list.tmpl b/capytal/forgejo/templates/explore/user_list.tmpl new file mode 100644 index 0000000..a9f53b3 --- /dev/null +++ b/capytal/forgejo/templates/explore/user_list.tmpl @@ -0,0 +1,33 @@ + diff --git a/capytal/forgejo/templates/home.tmpl b/capytal/forgejo/templates/home.tmpl new file mode 100644 index 0000000..25510f9 --- /dev/null +++ b/capytal/forgejo/templates/home.tmpl @@ -0,0 +1,51 @@ +{{template "base/head" .}} +