From 0cd207bd2296a3d31915e8c0499e11b98e7f0283 Mon Sep 17 00:00:00 2001 From: freek Date: Thu, 8 Oct 2026 20:09:33 +0200 Subject: [PATCH] add forgejo --- configuration.nix | 5 ++++- flake.lock | 48 +++++++++++++++++++++++++++++++++++++++++++++++ forgejo.nix | 26 +++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 flake.lock create mode 100644 forgejo.nix diff --git a/configuration.nix b/configuration.nix index f9145ec..cba67f9 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,5 +1,8 @@ { modulesPath, ... }: { - imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ./forgejo.nix +]; boot.loader.grub = { efiSupport = true; diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..ca59814 --- /dev/null +++ b/flake.lock @@ -0,0 +1,48 @@ +{ + "nodes": { + "disko": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1789770686, + "narHash": "sha256-uZkBR7yHdIKUFB5SZdfgh1qkGfI3XmYmI/lTiquxbck=", + "owner": "nix-community", + "repo": "disko", + "rev": "725ea35e410ad83be4931d1bff7e090eacaf3563", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "disko", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1782847189, + "narHash": "sha256-twXPFqFsrrY5r28Zh7Homgcp2gUMBgQ6WDS98Q/3xFI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b6018f87da91d19d0ab4cf979885689b469cdd41", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "disko": "disko", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/forgejo.nix b/forgejo.nix new file mode 100644 index 0000000..253c364 --- /dev/null +++ b/forgejo.nix @@ -0,0 +1,26 @@ +{ pkgs, ... }: { + services.mysql = { + enable = true; + package = pkgs.mysql84; + }; + + services.forgejo = { + enable = true; + database = { + type = "mysql"; + socket = "/run/mysqld/mysqld.sock"; + createDatabase = true; + }; + settings.service.DISABLE_REGISTRATION = true; + settings.server = { + DOMAIN = "46.225.70.113"; + ROOT_URL = "http://46.225.70.113:3000/"; + HTTP_PORT = 3000; + SSH_PORT = 2222; + SSH_LISTEN_PORT = 2222; + START_SSH_SERVER = true; + }; + }; + + networking.firewall.allowedTCPPorts = [ 3000 2222 ]; +}