nixos/clash-verge: add cfg.package

This commit is contained in:
Guanran Wang 2024-03-10 20:03:25 +01:00 committed by Weijia Wang
parent d40e866b1f
commit 0a5801395a

View file

@ -3,6 +3,7 @@
{
options.programs.clash-verge = {
enable = lib.mkEnableOption (lib.mdDoc "Clash Verge");
package = lib.mkPackageOption pkgs "clash-verge" {};
autoStart = lib.mkEnableOption (lib.mdDoc "Clash Verge auto launch");
tunMode = lib.mkEnableOption (lib.mdDoc "Clash Verge TUN mode");
};
@ -14,10 +15,10 @@
lib.mkIf cfg.enable {
environment.systemPackages = [
pkgs.clash-verge
cfg.package
(lib.mkIf cfg.autoStart (pkgs.makeAutostartItem {
name = "clash-verge";
package = pkgs.clash-verge;
package = cfg.package;
}))
];
@ -25,7 +26,7 @@
owner = "root";
group = "root";
capabilities = "cap_net_bind_service,cap_net_admin=+ep";
source = "${lib.getExe pkgs.clash-verge}";
source = "${lib.getExe cfg.package}";
};
};