mail2-nixos-config/checkmk-agent.nix

19 lines
531 B
Nix
Raw Permalink Normal View History

2024-08-21 01:16:00 +02:00
{ lib, pkgs, ... }:
let
agentcmd = "${ (pkgs.callPackage ./checkmk-agent/default.nix { }) }/bin/check_mk_agent.sshwrapper";
2024-08-21 01:16:00 +02:00
in
{
users.users.mon = {
isNormalUser = true;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
''restrict,command="${ agentcmd }" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGHkivi9Ye/Uj4ZQxrEfarSaz0iLF/XXhY/crNsLoDMu checkmk''
2024-08-21 01:16:00 +02:00
];
};
security.sudo.extraConfig = ''
## Allow the monitor user to run commands as root
mon ALL=(ALL) NOPASSWD: ALL
'';
2024-08-21 01:16:00 +02:00
}