From cb7635612e5fe9b98eba671f85d4124d6d6feb16 Mon Sep 17 00:00:00 2001 From: Daniel Nagy Date: Fri, 20 Sep 2024 17:15:00 +0200 Subject: [PATCH] nixos/yggdrasil: remove `with lib;` --- nixos/modules/services/networking/yggdrasil.nix | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/nixos/modules/services/networking/yggdrasil.nix b/nixos/modules/services/networking/yggdrasil.nix index c1c952adac39..3953c81ef214 100644 --- a/nixos/modules/services/networking/yggdrasil.nix +++ b/nixos/modules/services/networking/yggdrasil.nix @@ -1,6 +1,8 @@ { config, lib, pkgs, ... }: -with lib; + let + inherit (lib) mkIf mkOption; + inherit (lib.types) nullOr path bool listOf str; keysPath = "/var/lib/yggdrasil/keys.json"; cfg = config.services.yggdrasil; @@ -11,14 +13,14 @@ let in { imports = [ - (mkRenamedOptionModule + (lib.mkRenamedOptionModule [ "services" "yggdrasil" "config" ] [ "services" "yggdrasil" "settings" ]) ]; - options = with types; { + options = { services.yggdrasil = { - enable = mkEnableOption "the yggdrasil system service"; + enable = lib.mkEnableOption "the yggdrasil system service"; settings = mkOption { type = format.type; @@ -73,7 +75,7 @@ in }; group = mkOption { - type = types.nullOr types.str; + type = nullOr str; default = null; example = "wheel"; description = "Group to grant access to the Yggdrasil control socket. If `null`, only root can access the socket."; @@ -108,9 +110,9 @@ in ''; }; - package = mkPackageOption pkgs "yggdrasil" { }; + package = lib.mkPackageOption pkgs "yggdrasil" { }; - persistentKeys = mkEnableOption '' + persistentKeys = lib.mkEnableOption '' persistent keys. If enabled then keys will be generated once and Yggdrasil will retain the same IPv6 address when the service is restarted. Keys are stored at ${keysPath}