uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
|
|
@ -0,0 +1,53 @@
|
|||
{ config, lib, pkgs, options }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.prometheus.exporters.py-air-control;
|
||||
|
||||
workingDir = "/var/lib/${cfg.stateDir}";
|
||||
|
||||
in
|
||||
{
|
||||
port = 9896;
|
||||
extraOpts = {
|
||||
deviceHostname = mkOption {
|
||||
type = types.str;
|
||||
example = "192.168.1.123";
|
||||
description = ''
|
||||
The hostname of the air purification device from which to scrape the metrics.
|
||||
'';
|
||||
};
|
||||
protocol = mkOption {
|
||||
type = types.str;
|
||||
default = "http";
|
||||
description = ''
|
||||
The protocol to use when communicating with the air purification device.
|
||||
Available: [http, coap, plain_coap]
|
||||
'';
|
||||
};
|
||||
stateDir = mkOption {
|
||||
type = types.str;
|
||||
default = "prometheus-py-air-control-exporter";
|
||||
description = ''
|
||||
Directory below <literal>/var/lib</literal> to store runtime data.
|
||||
This directory will be created automatically using systemd's StateDirectory mechanism.
|
||||
'';
|
||||
};
|
||||
};
|
||||
serviceOpts = {
|
||||
serviceConfig = {
|
||||
DynamicUser = false;
|
||||
StateDirectory = cfg.stateDir;
|
||||
WorkingDirectory = workingDir;
|
||||
ExecStart = ''
|
||||
${pkgs.python3Packages.py-air-control-exporter}/bin/py-air-control-exporter \
|
||||
--host ${cfg.deviceHostname} \
|
||||
--protocol ${cfg.protocol} \
|
||||
--listen-port ${toString cfg.port} \
|
||||
--listen-address ${cfg.listenAddress}
|
||||
'';
|
||||
Environment = [ "HOME=${workingDir}" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue