1 { config, pkgs, lib, ... }:
3 cfg = config.services.meshcentral;
4 configFormat = pkgs.formats.json {};
5 configFile = configFormat.generate "meshcentral-config.json" cfg.settings;
7 options.services.meshcentral = with types; {
8 enable = mkEnableOption "MeshCentral computer management server";
9 package = mkPackageOption pkgs "meshcentral" { };
12 Settings for MeshCentral. Refer to upstream documentation for details:
14 - [JSON Schema definition](https://github.com/Ylianst/MeshCentral/blob/master/meshcentral-config-schema.json)
15 - [simple sample configuration](https://github.com/Ylianst/MeshCentral/blob/master/sample-config.json)
16 - [complex sample configuration](https://github.com/Ylianst/MeshCentral/blob/master/sample-config-advanced.json)
17 - [Old homepage with documentation link](https://www.meshcommander.com/meshcentral2)
19 type = types.submodule {
20 freeformType = configFormat.type;
25 Cert = "meshcentral.example.com";
26 TlsOffload = "10.0.0.2,fd42::2";
29 domains."".certUrl = "https://meshcentral.example.com/";
33 config = mkIf cfg.enable {
34 services.meshcentral.settings.settings.autoBackup.backupPath = lib.mkDefault "/var/lib/meshcentral/backups";
35 systemd.services.meshcentral = {
36 wantedBy = ["multi-user.target"];
38 ExecStart = "${cfg.package}/bin/meshcentral --datapath /var/lib/meshcentral --configfile ${configFile}";
40 StateDirectory = "meshcentral";
41 CacheDirectory = "meshcentral";
45 meta.maintainers = [ ];