diff --git a/hosts/darwin/home-default.nix b/hosts/darwin/home-default.nix index 8894d6d..76e2f0f 100644 --- a/hosts/darwin/home-default.nix +++ b/hosts/darwin/home-default.nix @@ -7,8 +7,8 @@ ../../modules/tmux.nix ../../modules/zsh.nix ../../modules/ssh.nix - ../../modules/git.nix - ../../modules/lazygit.nix + ../../modules/git/home.nix + ../../modules/git/lazygit.nix ../../modules/btop.nix ../../modules/firefox/home.nix ../../modules/ghostty.nix diff --git a/hosts/nixos/home-default.nix b/hosts/nixos/home-default.nix index 1012a57..09afe7e 100644 --- a/hosts/nixos/home-default.nix +++ b/hosts/nixos/home-default.nix @@ -7,8 +7,8 @@ ../../modules/tmux.nix ../../modules/zsh.nix ../../modules/ssh.nix - ../../modules/git.nix - ../../modules/lazygit.nix + ../../modules/git/home.nix + ../../modules/git/lazygit.nix ../../modules/btop.nix ../../modules/font/home.nix ]; diff --git a/modules/git.nix b/modules/git/home.nix similarity index 100% rename from modules/git.nix rename to modules/git/home.nix diff --git a/modules/lazygit.nix b/modules/git/lazygit.nix similarity index 100% rename from modules/lazygit.nix rename to modules/git/lazygit.nix diff --git a/modules/git/server.nix b/modules/git/server.nix new file mode 100644 index 0000000..365e2ac --- /dev/null +++ b/modules/git/server.nix @@ -0,0 +1,43 @@ +{ config, lib, ... }: + +let + cfg = config.services.git-server-custom; +in +{ + options.services.git-server-custom = { + enable = lib.mkEnableOption "Forgejo git server"; + + domain = lib.mkOption { + type = lib.types.str; + default = "localhost"; + }; + + httpPort = lib.mkOption { + type = lib.types.port; + default = 3000; + }; + + sshPort = lib.mkOption { + type = lib.types.port; + default = 22; + }; + }; + + config = lib.mkIf cfg.enable { + services.forgejo = { + enable = true; + lfs.enable = true; + database.type = "sqlite3"; + settings = { + server = { + DOMAIN = cfg.domain; + ROOT_URL = "https://${cfg.domain}/"; + HTTP_ADDR = "127.0.0.1"; + HTTP_PORT = cfg.httpPort; + SSH_PORT = cfg.sshPort; + }; + service.DISABLE_REGISTRATION = true; + }; + }; + }; +}