Remove dead goaccess configuration code

This commit is contained in:
Danila Fedorin 2022-12-31 00:25:03 +00:00
parent 3561027ca5
commit 4b716ae5ed
2 changed files with 0 additions and 58 deletions

View File

@ -2,7 +2,6 @@
imports = [
./hardware-configuration.nix
./networking.nix # generated at runtime by nixos-infect
./goaccess.nix
];
nix = {
@ -31,14 +30,6 @@
users.groups.www = {};
services.nginx.group = "www";
services.goaccess = {
enable = false;
user = "goaccess";
group = "www";
dir = "/var/www/goaccess";
host = "dash.danilafe.com";
};
services.danilafe-blog = {
enable = true;
challengePath = "/var/www/challenges";

View File

@ -1,49 +0,0 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.services.goaccess;
in {
options.services.goaccess = {
enable = mkEnableOption "GoAccess dashboard";
group = mkOption {
type = types.str;
};
user = mkOption {
type = types.str;
};
dir = mkOption {
type = types.str;
};
host = mkOption {
type = types.str;
};
};
config = mkIf cfg.enable {
systemd.services.goaccess = {
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
description = "GoAccess live dashboard";
serviceConfig = {
Type = "forking";
User = cfg.user;
ExecStart = "${pkgs.goaccess}/bin/goaccess --ignore-crawlers -f /var/log/nginx/access.log --enable-panel=REFERRERS --enable-panel=KEYPHRASES --log-format COMBINED -o ${cfg.dir}/report.html --real-time-html";
Restart = "on-failure";
};
};
users.users."${cfg.user}" = {
isSystemUser = true;
description = "GoAccess runner";
group = cfg.group;
};
systemd.tmpfiles.rules = [
"d ${cfg.dir} 0755 ${cfg.user} ${cfg.group}"
];
services.nginx.virtualHosts."${cfg.host}" = {
addSSL = true;
enableACME = true;
root = cfg.dir;
};
};
}