Advertisement
Guest User

Untitled

a guest
May 27th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. { config, pkgs, lib, ... }:
  2.  
  3. let
  4. cfg = config.services.v2ray;
  5.  
  6. inherit (lib) mkEnableOption mkIf;
  7. in
  8. {
  9. # interface
  10. options = {
  11. services.v2ray = {
  12.  
  13. enable = mkEnableOption "v2ray";
  14.  
  15. };
  16. };
  17.  
  18. # implementation
  19. config = mkIf cfg.enable {
  20.  
  21. systemd.services.v2ray = {
  22. description = "V2Ray Service";
  23. wantedBy = [ "multi-user.target" ];
  24. after = [ "network.target" ];
  25.  
  26. serviceConfig = {
  27. ExecStart = "${pkgs.v2ray}/bin/v2ray";
  28. };
  29. };
  30.  
  31. };
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement