{ pkgs, ... }@all: with all;
let p = pkgs; in
{
  environment.systemPackages = with p; [
    hugo
  ];

  users = {
    groups = {
      "hugo".name = "hugo";
    };
    users = {
      "${hyper.user}".extraGroups = [ "hugo" ];
      "nginx".extraGroups = [ "hugo" ];
      "hugo" = {
        isSystemUser = true;
        group = "hugo";
      };
    };
  }; 

  systemd.services."hugo" = {
    script = with p; /* shell */ ''
      ${hugo}/bin/hugo serve --port 8000 --bind 10.0.1.1 --baseURL http://10.0.1.1:8000 -s /var/lib/hugo/nx2site/
    '';
    serviceConfig = {
      Type = "simple";
      User = "hugo";
    };
  };
}
