Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { 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";
- };
- };
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement