nixos/wavemon: create module
commit7469e68ddaf9efa67467586574996f9e00c138a3
authorgeistesk <github.jyf300hj@0x21.biz>
dateFri 7 Sep 2018, 19:52 (8 years ago)
parent2729373
nixos/modules/module-list.nix+1
@@ -125,6 +125,7 @@
125125 ./programs/udevil.nix
126126 ./programs/venus.nix
127127 ./programs/vim.nix
128+ ./programs/wavemon.nix
128129 ./programs/way-cooler.nix
129130 ./programs/wireshark.nix
130131 ./programs/xfs_quota.nix
nixos/modules/programs/wavemon.nixnew file+28
@@ -0,0 +1,28 @@
1+{ config, lib, pkgs, ... }:
2+
3+with lib;
4+
5+let
6+ cfg = config.programs.wavemon;
7+in {
8+ options = {
9+ programs.wavemon = {
10+ enable = mkOption {
11+ type = types.bool;
12+ default = false;
13+ description = ''
14+ Whether to add wavemon to the global environment and configure a
15+ setcap wrapper for it.
16+ '';
17+ };
18+ };
19+ };
20+
21+ config = mkIf cfg.enable {
22+ environment.systemPackages = with pkgs; [ wavemon ];
23+ security.wrappers.wavemon = {
24+ source = "${pkgs.wavemon}/bin/wavemon";
25+ capabilities = "cap_net_admin+ep";
26+ };
27+ };
28+}