1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-23 09:51:00 +03:00

nixos/fireqos: modernize

This commit is contained in:
Franz Pletz 2024-12-03 11:11:45 +01:00
parent 7ed1bb9467
commit c91e47f589
No known key found for this signature in database
GPG key ID: 846FDED7792617B4

View file

@ -1,21 +1,19 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
let let
cfg = config.services.fireqos; cfg = config.services.fireqos;
fireqosConfig = pkgs.writeText "fireqos.conf" "${cfg.config}"; fireqosConfig = pkgs.writeText "fireqos.conf" cfg.config;
in { in
{
options.services.fireqos = { options.services.fireqos = {
enable = lib.mkOption { enable = lib.mkEnableOption "FireQOS";
type = lib.types.bool;
default = false;
description = ''
If enabled, FireQOS will be launched with the specified
configuration given in `config`.
'';
};
config = lib.mkOption { config = lib.mkOption {
type = lib.types.str; type = lib.types.lines;
default = "";
example = '' example = ''
interface wlp3s0 world-in input rate 10mbit ethernet interface wlp3s0 world-in input rate 10mbit ethernet
class web commit 50kbit class web commit 50kbit
@ -26,7 +24,7 @@ in {
match tcp ports 80,443 match tcp ports 80,443
''; '';
description = '' description = ''
The FireQOS configuration goes here. The FireQOS configuration.
''; '';
}; };
}; };