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
60
nixos/modules/services/monitoring/vnstat.nix
Normal file
60
nixos/modules/services/monitoring/vnstat.nix
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.vnstat;
|
||||
in {
|
||||
options.services.vnstat = {
|
||||
enable = mkEnableOption "update of network usage statistics via vnstatd";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
environment.systemPackages = [ pkgs.vnstat ];
|
||||
|
||||
users = {
|
||||
groups.vnstatd = {};
|
||||
|
||||
users.vnstatd = {
|
||||
isSystemUser = true;
|
||||
group = "vnstatd";
|
||||
description = "vnstat daemon user";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.vnstat = {
|
||||
description = "vnStat network traffic monitor";
|
||||
path = [ pkgs.coreutils ];
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
documentation = [
|
||||
"man:vnstatd(1)"
|
||||
"man:vnstat(1)"
|
||||
"man:vnstat.conf(5)"
|
||||
];
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.vnstat}/bin/vnstatd -n";
|
||||
ExecReload = "${pkgs.procps}/bin/kill -HUP $MAINPID";
|
||||
|
||||
# Hardening (from upstream example service)
|
||||
ProtectSystem = "strict";
|
||||
StateDirectory = "vnstat";
|
||||
PrivateDevices = true;
|
||||
ProtectKernelTunables = true;
|
||||
ProtectControlGroups = true;
|
||||
ProtectHome = true;
|
||||
ProtectKernelModules = true;
|
||||
PrivateTmp = true;
|
||||
MemoryDenyWriteExecute = true;
|
||||
RestrictRealtime = true;
|
||||
RestrictNamespaces = true;
|
||||
|
||||
User = "vnstatd";
|
||||
Group = "vnstatd";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
meta.maintainers = [ maintainers.evils ];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue