Created
May 16, 2019 17:25
-
-
Save LinArcX/262440a509f991ad3b98347da0574646 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ 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