1 { config, lib, pkgs, ... }:
3 cfg = config.services.fireqos;
4 fireqosConfig = pkgs.writeText "fireqos.conf" "${cfg.config}";
6 options.services.fireqos = {
7 enable = lib.mkOption {
11 If enabled, FireQOS will be launched with the specified
12 configuration given in `config`.
16 config = lib.mkOption {
20 interface wlp3s0 world-in input rate 10mbit ethernet
21 class web commit 50kbit
22 match tcp ports 80,443
24 interface wlp3s0 world-out input rate 10mbit ethernet
25 class web commit 50kbit
26 match tcp ports 80,443
29 The FireQOS configuration goes here.
34 config = lib.mkIf cfg.enable {
35 systemd.services.fireqos = {
36 description = "FireQOS";
37 after = [ "network.target" ];
40 RemainAfterExit = true;
41 ExecStart = "${pkgs.firehol}/bin/fireqos start ${fireqosConfig}";
43 "${pkgs.firehol}/bin/fireqos stop"
44 "${pkgs.firehol}/bin/fireqos clear_all_qos"