git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #46330 from geistesk/wavemon-module

nixos/wavemon: create module

commite5ce19f6ab6ccb773769aae76ef9343215d1e918 authorJoachim F <joachifm@users.noreply.github.com> dateSun 28 Oct 2018, 10:16 (8 years ago) parent6b3bff47469e68
2 files changed+29
nixos/modules/module-list.nix+1 nixos/modules/programs/wavemon.nix+28
nixos/modules/module-list.nix+1
@@ -126,6 +126,7 @@
126126 ./programs/udevil.nix
127127 ./programs/venus.nix
128128 ./programs/vim.nix
129+ ./programs/wavemon.nix
129130 ./programs/way-cooler.nix
130131 ./programs/wireshark.nix
131132 ./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+}