From 99f52a2a765e1097fab4d6fa73e93fcb283287c2 Mon Sep 17 00:00:00 2001 From: triethyl Date: Sat, 6 Sep 2025 14:48:44 -0400 Subject: homelab: added caddy and more --- nixos/modules/homelab/core/caddy.nix | 16 ++++++++++++++++ nixos/modules/homelab/core/default.nix | 1 + nixos/modules/homelab/default.nix | 1 + nixos/modules/homelab/dev/default.nix | 5 +++++ nixos/modules/homelab/dev/git.nix | 18 ++++++++++++++++++ 5 files changed, 41 insertions(+) create mode 100644 nixos/modules/homelab/core/caddy.nix create mode 100644 nixos/modules/homelab/dev/default.nix create mode 100644 nixos/modules/homelab/dev/git.nix (limited to 'nixos/modules') diff --git a/nixos/modules/homelab/core/caddy.nix b/nixos/modules/homelab/core/caddy.nix new file mode 100644 index 0000000..2041846 --- /dev/null +++ b/nixos/modules/homelab/core/caddy.nix @@ -0,0 +1,16 @@ +{config, lib, pkgs, ...}: let + cfg = config.homelab.core.caddy; +in { + options.homelab.core.caddy = { + enable = lib.mkEnableOption "caddy"; + }; + config = lib.mkIf cfg.enable { + services.caddy = { + enable = true; + email = "culsans@vivaldi.net"; + virtualHosts."culsans.site".extraConfig = '' + respond "Hello" + ''; + }; + }; +} diff --git a/nixos/modules/homelab/core/default.nix b/nixos/modules/homelab/core/default.nix index f2202aa..7adc169 100644 --- a/nixos/modules/homelab/core/default.nix +++ b/nixos/modules/homelab/core/default.nix @@ -1,5 +1,6 @@ {...}: { imports = [ ./ssh.nix + ./caddy.nix ]; } diff --git a/nixos/modules/homelab/default.nix b/nixos/modules/homelab/default.nix index 5a9a97e..ab7fa87 100644 --- a/nixos/modules/homelab/default.nix +++ b/nixos/modules/homelab/default.nix @@ -4,6 +4,7 @@ in { imports = [ ./core ./cloud + ./dev ]; options.homelab = { enable = lib.mkEnableOption "homelab"; diff --git a/nixos/modules/homelab/dev/default.nix b/nixos/modules/homelab/dev/default.nix new file mode 100644 index 0000000..6add50f --- /dev/null +++ b/nixos/modules/homelab/dev/default.nix @@ -0,0 +1,5 @@ +{...}: { + imports = [ + ./git.nix + ]; +} diff --git a/nixos/modules/homelab/dev/git.nix b/nixos/modules/homelab/dev/git.nix new file mode 100644 index 0000000..759a4c1 --- /dev/null +++ b/nixos/modules/homelab/dev/git.nix @@ -0,0 +1,18 @@ +{config, lib, pkgs, ...}: let + cfg = config.homelab.dev.git; +in { + options.homelab.dev.git = { + enable = lib.mkEnableOption "git"; + }; + config = lib.mkIf cfg.enable { + users.users."git" = { + isSystemUser = true; + }; + services.gitolite = { + enable = true; + user = "git"; + adminPubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMcc7hXixElOgv87LlY1LgCQ9oOT6Lj66wjCh1uRqpQt culsans@nzxt-desktop"; + dataDir = "/srv/git"; + }; + }; +} -- cgit v1.2.3