1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-21 17:01:10 +03:00
nixpkgs/nixos/modules/services/monitoring/fusion-inventory.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

61 lines
1.3 KiB
Nix
Raw Normal View History

2017-08-10 13:13:35 +02:00
# Fusion Inventory daemon.
{ config, lib, pkgs, ... }:
let
cfg = config.services.fusionInventory;
configFile = pkgs.writeText "fusion_inventory.conf" ''
server = ${lib.concatStringsSep ", " cfg.servers}
2017-08-10 13:13:35 +02:00
logger = stderr
${cfg.extraConfig}
'';
in {
###### interface
options = {
services.fusionInventory = {
enable = lib.mkEnableOption "Fusion Inventory Agent";
2017-08-10 13:13:35 +02:00
servers = lib.mkOption {
type = lib.types.listOf lib.types.str;
2017-08-10 13:13:35 +02:00
description = ''
The urls of the OCS/GLPI servers to connect to.
'';
};
extraConfig = lib.mkOption {
2017-08-10 13:13:35 +02:00
default = "";
type = lib.types.lines;
2017-08-10 13:13:35 +02:00
description = ''
Configuration that is injected verbatim into the configuration file.
'';
};
};
};
###### implementation
config = lib.mkIf cfg.enable {
2017-08-10 13:13:35 +02:00
users.users.fusion-inventory = {
2017-08-10 13:13:35 +02:00
description = "FusionInventory user";
2019-10-12 22:25:28 +02:00
isSystemUser = true;
2017-08-10 13:13:35 +02:00
};
2019-08-13 21:52:01 +00:00
systemd.services.fusion-inventory = {
2017-08-10 13:13:35 +02:00
description = "Fusion Inventory Agent";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${pkgs.fusionInventory}/bin/fusioninventory-agent --conf-file=${configFile} --daemon --no-fork";
};
};
};
}