nixos: prelim plausible

This commit is contained in:
Vivian 2021-12-12 15:51:56 +01:00
parent 0344733b69
commit dba7e0d1e9
11 changed files with 115 additions and 15 deletions

View file

@ -36,6 +36,7 @@ in {
# Additional packages
environment.systemPackages = with pkgs; [
binutils
fix-vscode
fluxcd
k9s

View file

@ -8,10 +8,8 @@ let
proxyWebsockets = true;
};
};
k8s_proxy = proxy "http://10.42.42.150:8000/";
k8s_proxy = proxy "http://10.42.42.10:8000/";
in {
imports = [ ];
networking.hostName = "nginx";
# This value determines the NixOS release from which the default
@ -34,7 +32,8 @@ in {
# Reverse Proxies
virtualHosts."ha.0x76.dev" = proxy "http://10.42.42.8:8123/";
virtualHosts."zookeeper-dev.0x76.dev" = proxy "http://10.42.43.28:8085/";
virtualHosts."zookeeper-dev.0x76.dev" = proxy "http://eevee.olympus:8085/";
virtualHosts."analytics.0x76.dev" = proxy "http://plausible.olympus:8000/";
# Kubernetes endpoints
virtualHosts."0x76.dev" = k8s_proxy;
@ -45,5 +44,5 @@ in {
security.acme.email = "victorheld12@gmail.com";
security.acme.acceptTerms = true;
security.acme.preliminarySelfsigned = false;
security.acme.preliminarySelfsigned = true;
}

View file

@ -0,0 +1,42 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
let
vs = config.vault-secrets.secrets;
cfg = config.services.plausible;
in {
imports = [ ];
networking.hostName = "plausible";
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "21.11"; # Did you read the comment?
# Additional packages
environment.systemPackages = with pkgs; [ ];
networking.firewall.allowedTCPPorts = [ cfg.server.port ];
networking.firewall.allowedUDPPorts = [ ];
vault-secrets.secrets.plausible = { };
services.plausible = {
enable = false;
server = {
baseUrl = "https://analytics.0x76.dev";
secretKeybaseFile = "${vs.plausible}/secretkeybase";
};
adminUser = {
activate = true;
email = "plausible@xirion.net";
passwordFile = "${vs.plausible}/password";
};
};
}