nixos/services.ferm: remove with lib;

This commit is contained in:
Felix Buehler 2024-08-28 21:19:06 +02:00 committed by Jörg Thalheim
parent abc0a6e035
commit 17f8650ace

View File

@ -1,7 +1,4 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.ferm;
@ -17,9 +14,9 @@ let
in {
options = {
services.ferm = {
enable = mkOption {
enable = lib.mkOption {
default = false;
type = types.bool;
type = lib.types.bool;
description = ''
Whether to enable Ferm Firewall.
*Warning*: Enabling this service WILL disable the existing NixOS
@ -27,17 +24,17 @@ in {
considered at the moment.
'';
};
config = mkOption {
config = lib.mkOption {
description = "Verbatim ferm.conf configuration.";
default = "";
defaultText = literalMD "empty firewall, allows any traffic";
type = types.lines;
defaultText = lib.literalMD "empty firewall, allows any traffic";
type = lib.types.lines;
};
package = mkPackageOption pkgs "ferm" { };
package = lib.mkPackageOption pkgs "ferm" { };
};
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
systemd.services.firewall.enable = false;
systemd.services.ferm = {
description = "Ferm Firewall";