Skip to content

Commit

Permalink
nixos/modules/services/networking/v2ray.nix: remove with lib;
Browse files Browse the repository at this point in the history
  • Loading branch information
Stunkymonkey committed Sep 11, 2024
1 parent 648157e commit 89aa355
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions nixos/modules/services/networking/v2ray.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
{ config, lib, pkgs, ... }:

with lib;

{
options = {

services.v2ray = {
enable = mkOption {
type = types.bool;
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Whether to run v2ray server.
Expand All @@ -16,10 +13,10 @@ with lib;
'';
};

package = mkPackageOption pkgs "v2ray" { };
package = lib.mkPackageOption pkgs "v2ray" { };

configFile = mkOption {
type = types.nullOr types.str;
configFile = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
example = "/etc/v2ray/config.json";
description = ''
Expand All @@ -31,8 +28,8 @@ with lib;
'';
};

config = mkOption {
type = types.nullOr (types.attrsOf types.unspecified);
config = lib.mkOption {
type = lib.types.nullOr (lib.types.attrsOf lib.types.unspecified);
default = null;
example = {
inbounds = [{
Expand Down Expand Up @@ -68,7 +65,7 @@ with lib;
'';
};

in mkIf cfg.enable {
in lib.mkIf cfg.enable {
assertions = [
{
assertion = (cfg.configFile == null) != (cfg.config == null);
Expand Down

0 comments on commit 89aa355

Please sign in to comment.