From d63146859b2a33af24ac81eb39ef52ad87f6e330 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Wed, 28 Aug 2024 21:19:01 +0200 Subject: [PATCH] nixos/services.amule: remove `with lib;` --- nixos/modules/services/networking/amuled.nix | 23 +++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/nixos/modules/services/networking/amuled.nix b/nixos/modules/services/networking/amuled.nix index aa72a047526b..b41d4d629ec5 100644 --- a/nixos/modules/services/networking/amuled.nix +++ b/nixos/modules/services/networking/amuled.nix @@ -1,7 +1,4 @@ { config, lib, options, pkgs, ... }: - -with lib; - let cfg = config.services.amule; opt = options.services.amule; @@ -16,18 +13,18 @@ in services.amule = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to run the AMule daemon. You need to manually run "amuled --ec-config" to configure the service for the first time. ''; }; - dataDir = mkOption { - type = types.str; + dataDir = lib.mkOption { + type = lib.types.str; default = "/home/${user}/"; - defaultText = literalExpression '' + defaultText = lib.literalExpression '' "/home/''${config.${opt.user}}/" ''; description = '' @@ -35,8 +32,8 @@ in ''; }; - user = mkOption { - type = types.nullOr types.str; + user = lib.mkOption { + type = lib.types.nullOr lib.types.str; default = null; description = '' The user the AMule daemon should run as. @@ -50,16 +47,16 @@ in ###### implementation - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { - users.users = mkIf (cfg.user == null) [ + users.users = lib.mkIf (cfg.user == null) [ { name = "amule"; description = "AMule daemon"; group = "amule"; uid = config.ids.uids.amule; } ]; - users.groups = mkIf (cfg.user == null) [ + users.groups = lib.mkIf (cfg.user == null) [ { name = "amule"; gid = config.ids.gids.amule; } ];