From f317de51e909f332e536f0068d132d364787ad93 Mon Sep 17 00:00:00 2001 From: Asmir A Date: Sun, 21 Jan 2024 13:47:06 +0100 Subject: [PATCH 1/2] goatcounter: add flake input goatcounter: change repo --- flake.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 4b50f74..af8b40d 100644 --- a/flake.nix +++ b/flake.nix @@ -34,6 +34,11 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + goatcounter = { + url = "github:asmir-abdulahovic/goatcounter-flake"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; @@ -51,16 +56,17 @@ }; outputs = inputs @ { + goatcounter, home-manager, nixpkgs, nix-xilinx, nvim, peerix, + project-cloud, simple-nixos-mailserver, sops-nix, swaysw, zremap, - project-cloud, ... }: let pkgs = nixpkgs.legacyPackages.x86_64-linux.pkgs; @@ -154,8 +160,9 @@ {nix.registry.nixpkgs.flake = nixpkgs;} ./magpie/configuration.nix ./magpie/hardware-configuration.nix - sops-nix.nixosModules.sops + goatcounter.nixosModule.goatcounter simple-nixos-mailserver.nixosModule + sops-nix.nixosModules.sops (builtins.toPath "${nixpkgs}/nixos/modules/profiles/qemu-guest.nix") ]; }; From cf269a5d1912e35aaadae44546cf51a3ce38a632 Mon Sep 17 00:00:00 2001 From: Asmir A Date: Sun, 21 Jan 2024 14:05:17 +0100 Subject: [PATCH 2/2] magpie: add goatcounter --- magpie/configuration.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/magpie/configuration.nix b/magpie/configuration.nix index 27fb36c..b31f0fc 100644 --- a/magpie/configuration.nix +++ b/magpie/configuration.nix @@ -3,6 +3,7 @@ pkgs, lib, project-cloud, + goatcounter, ... }: { imports = []; @@ -44,6 +45,7 @@ usbutils wget zip + goatcounter.packages.aarch64-linux.goatcounter ]; programs.mosh.enable = true; @@ -99,6 +101,18 @@ virtualHost.listenPort = 4001; }; + services.goatcounter = { + enable = true; + environmentFile = "/var/lib/goatcounter.env"; + extraArgs = ["-listen='*:8002'" "-tls=proxy" ]; + database = { + backend = "sqlite"; + name = "goatcounter"; + user = "goatcounter"; + automigrate = true; + }; + }; + services.nextcloud = { enable = true; package = pkgs.nextcloud27; @@ -177,6 +191,15 @@ proxyPass = "http://localhost:${toString config.services.restya-board.virtualHost.listenPort}"; }; }; + + virtualHosts."stats.project-cloud.net" = { + quic = true; + forceSSL = true; + enableACME = true; + locations."/" = { + proxyPass = "http://localhost:8002/"; + }; + }; }; services.gitea = {