add the checkmk agent and config

This commit is contained in:
Daniel Frank 2024-08-21 01:16:00 +02:00
commit 05459a50e1
Signed by: tokudan
GPG key ID: 063CCCAD04182D32
6 changed files with 2348 additions and 0 deletions

22
checkmk-agent.nix Normal file
View file

@ -0,0 +1,22 @@
{ lib, pkgs, ... }:
let
agentcmd = "${ (pkgs.callPackage ./checkmk-agent/default.nix { }) }/bin/check_mk_agent.sshwrapper";
in
{
users.users.mon = {
isNormalUser = true;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
''restrict,command="${ agentcmd }" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGHkivi9Ye/Uj4ZQxrEfarSaz0iLF/XXhY/crNsLoDMu checkmk''
];
};
security.sudo.extraRules = [ {
users = [ "mon" ];
commands = [ {
command = agentcmd;
options = [ "NOPASSWD" ];
} ];
}
];
}