Skip to content

Instantly share code, notes, and snippets.

@LinArcX
Created May 16, 2019 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LinArcX/262440a509f991ad3b98347da0574646 to your computer and use it in GitHub Desktop.
Save LinArcX/262440a509f991ad3b98347da0574646 to your computer and use it in GitHub Desktop.
{ config, pkgs, lib, ... }:
let
cfg = config.services.v2ray;
inherit (lib) mkEnableOption mkIf;
in
{
# interface
options = {
services.v2ray = {
enable = mkEnableOption "v2ray";
};
};
# implementation
config = mkIf cfg.enable {
systemd.services.v2ray = {
description = "V2Ray Service";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
ExecStart = "${pkgs.v2ray}/bin/v2ray";
};
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment