Skip to content

Commit

Permalink
nixos/clash-verge: enable serviceModule by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Bot-wxt1221 committed Nov 25, 2024
1 parent 7022646 commit 1e6ae99
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions nixos/modules/programs/clash-verge.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
clash-verge-rev and clash-nyanpasu, both are forks of
the original clash-verge project.
'';
example = "pkgs.clash-verge-rev";
default = pkgs.clash-verge-rev;
defaultText = lib.literalExpression "pkgs.clash-verge-rev";
};
autoStart = lib.mkEnableOption "Clash Verge auto launch";
tunMode = lib.mkEnableOption "Clash Verge TUN mode";
};

config =
Expand All @@ -37,13 +37,19 @@
))
];

security.wrappers.clash-verge = lib.mkIf cfg.tunMode {
owner = "root";
group = "root";
capabilities = "cap_net_bind_service,cap_net_admin=+ep";
source = "${lib.getExe cfg.package}";
systemd.services.clash-verge = {
enable = true;
description = "Clash Verge Service Mode";
serviceConfig = {
ExecStart = "${cfg.package}/bin/clash-verge-service";
};
Restart = "on-failure";
wantedBy = [ "multi-user.target" ];
};
};

meta.maintainers = with lib.maintainers; [ zendo ];
meta.maintainers = with lib.maintainers; [
bot-wxt1221
Guanran928
];
}

0 comments on commit 1e6ae99

Please sign in to comment.