nixos/services.blocky: remove with lib;

This commit is contained in:
Felix Buehler
2024-09-15 10:43:52 +02:00
committed by Jörg Thalheim
parent 939ba8a2c3
commit 8e6795a029
+5 -8
View File
@@ -1,7 +1,4 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.blocky;
@@ -10,11 +7,11 @@ let
in
{
options.services.blocky = {
enable = mkEnableOption "blocky, a fast and lightweight DNS proxy as ad-blocker for local network with many features";
enable = lib.mkEnableOption "blocky, a fast and lightweight DNS proxy as ad-blocker for local network with many features";
package = mkPackageOption pkgs "blocky" { };
package = lib.mkPackageOption pkgs "blocky" { };
settings = mkOption {
settings = lib.mkOption {
type = format.type;
default = { };
description = ''
@@ -25,14 +22,14 @@ in
};
};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
systemd.services.blocky = {
description = "A DNS proxy and ad-blocker for the local network";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
DynamicUser = true;
ExecStart = "${getExe cfg.package} --config ${configFile}";
ExecStart = "${lib.getExe cfg.package} --config ${configFile}";
Restart = "on-failure";
AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ];