From fbecc291f4d3a5f93e487526701d43a494b88ece Mon Sep 17 00:00:00 2001 From: Collin Williams <96917990+bluedragon1221@users.noreply.github.com> Date: Wed, 25 Feb 2026 13:47:47 -0600 Subject: changes --- modules/services/nixos/cgit/gitShellCommands.nix | 77 +++++++++++++----------- modules/services/nixos/goaccess.nix | 12 ++-- modules/services/nixos/qbittorrent.nix | 6 +- 3 files changed, 52 insertions(+), 43 deletions(-) (limited to 'modules/services/nixos') diff --git a/modules/services/nixos/cgit/gitShellCommands.nix b/modules/services/nixos/cgit/gitShellCommands.nix index e99f9f2..18c6e19 100644 --- a/modules/services/nixos/cgit/gitShellCommands.nix +++ b/modules/services/nixos/cgit/gitShellCommands.nix @@ -1,43 +1,50 @@ { - hjem.users."git".files = { - "git-shell-commands/set-description" = { - executable = true; - text = '' - #!/usr/bin/env bash - set -euo pipefail - repo="$1" - desc="$2" - base="/var/lib/cgit" - repo_path="$base/$repo" + config, + lib, + ... +}: let + cfg = config.collinux.services.cgit; +in + lib.mkIf cfg.enable { + hjem.users."git".files = { + "git-shell-commands/set-description" = { + executable = true; + text = '' + #!/usr/bin/env bash + set -euo pipefail + repo="$1" + desc="$2" + base="/var/lib/cgit" + repo_path="$base/$repo" - test -d "$repo_path" || { echo "Repository does not exist"; exit 1; } + test -d "$repo_path" || { echo "Repository does not exist"; exit 1; } - # Prevent path traversal - real=$(realpath "$repo_path") - if [[ "$real" != "$base/"* ]]; then - echo "Invalid path" - exit 1 - fi + # Prevent path traversal + real=$(realpath "$repo_path") + if [[ "$real" != "$base/"* ]]; then + echo "Invalid path" + exit 1 + fi - echo "$desc" | head -n 1 > "$repo_path/description" + echo "$desc" | head -n 1 > "$repo_path/description" - echo "Description updated for '$repo'" - ''; - }; - "git-shell-commands/create-repo" = { - executable = true; - text = '' - #!/usr/bin/env bash - set -euo pipefail - repo="$1" - base="/var/lib/cgit" - repo_path="$base/$repo" + echo "Description updated for '$repo'" + ''; + }; + "git-shell-commands/create-repo" = { + executable = true; + text = '' + #!/usr/bin/env bash + set -euo pipefail + repo="$1" + base="/var/lib/cgit" + repo_path="$base/$repo" - test -d "$repo_path" && { echo "Repository already exists."; exit 1; } + test -d "$repo_path" && { echo "Repository already exists."; exit 1; } - git init --bare "$repo_path" - echo "Repository '$repo' created" - ''; + git init --bare "$repo_path" + echo "Repository '$repo' created" + ''; + }; }; - }; -} + } diff --git a/modules/services/nixos/goaccess.nix b/modules/services/nixos/goaccess.nix index 19b003f..a71a9c3 100644 --- a/modules/services/nixos/goaccess.nix +++ b/modules/services/nixos/goaccess.nix @@ -14,7 +14,7 @@ settings = { date-format = "%s"; log-format = "CADDY"; - tz = "America/Chicago"; + tz = config.time.timeZone; ws-url = if cfg.publicUrl != null @@ -27,7 +27,7 @@ real-time-html = "true"; log-file = "/var/log/caddy/access-williamsfam.us.com.log"; - geoip-database = "${geoip}"; + geoip-database = geoip; output = "/var/www/goaccess/index.html"; external-assets = "true"; all-static-files = "false"; @@ -47,6 +47,10 @@ settingsFile = pkgs.writeText "goaccess.conf" (settings |> builtins.mapAttrs (k: v: "${k} ${v}") |> builtins.attrValues |> lib.concatStringsSep "\n"); in { + imports = [ + (import ./mkCaddyCfg.nix cfg) + ]; + config = lib.mkIf cfg.enable { users.groups."goaccess" = {}; users.users."goaccess" = { @@ -122,9 +126,7 @@ in { wantedBy = ["multi-user.target"]; }; - systemd.tmpfiles.rules = [ - "d /var/www/goaccess/ 755 goaccess goaccess" - ]; + systemd.tmpfiles.rules = ["d /var/www/goaccess/ 755 goaccess goaccess"]; collinux.services.goaccess.manualCaddyConfig = '' root * /var/www/goaccess diff --git a/modules/services/nixos/qbittorrent.nix b/modules/services/nixos/qbittorrent.nix index af3cdbc..d0249d0 100644 --- a/modules/services/nixos/qbittorrent.nix +++ b/modules/services/nixos/qbittorrent.nix @@ -12,13 +12,13 @@ in { config = lib.mkIf cfg.enable { users.users."qbittorrent".extraGroups = ["fileserver"]; # torrent files go to /media/library - networking.firewall.allowedTCPPorts = [6882]; - networking.firewall.allowedUDPPorts = [6882]; + networking.firewall.allowedTCPPorts = [49252]; + networking.firewall.allowedUDPPorts = [49252]; services.qbittorrent = { enable = true; webuiPort = cfg.port; - torrentingPort = 6882; + torrentingPort = 49252; }; }; } -- cgit v1.3.1