1 { config, lib, pkgs, ... }:
6 cfg = config.services.fireqos;
7 fireqosConfig = pkgs.writeText "fireqos.conf" "${cfg.config}";
9 options.services.fireqos = {
13 description = lib.mdDoc ''
14 If enabled, FireQOS will be launched with the specified
15 configuration given in `config`.
23 interface wlp3s0 world-in input rate 10mbit ethernet
24 class web commit 50kbit
25 match tcp ports 80,443
27 interface wlp3s0 world-out input rate 10mbit ethernet
28 class web commit 50kbit
29 match tcp ports 80,443
31 description = lib.mdDoc ''
32 The FireQOS configuration goes here.
37 config = mkIf cfg.enable {
38 systemd.services.fireqos = {
39 description = "FireQOS";
40 after = [ "network.target" ];
43 RemainAfterExit = true;
44 ExecStart = "${pkgs.firehol}/bin/fireqos start ${fireqosConfig}";
46 "${pkgs.firehol}/bin/fireqos stop"
47 "${pkgs.firehol}/bin/fireqos clear_all_qos"