Merge pull request #223730 from zendo/clash-verge-module
nixos/clash-verge: init module
This commit is contained in:
commit
7a2fcddf52
3 changed files with 44 additions and 0 deletions
|
@ -40,6 +40,8 @@ In addition to numerous new and upgraded packages, this release has the followin
|
|||
|
||||
- [cups-pdf-to-pdf](https://github.com/alexivkin/CUPS-PDF-to-PDF), a pdf-generating cups backend based on [cups-pdf](https://www.cups-pdf.de/). Available as [services.printing.cups-pdf](#opt-services.printing.cups-pdf.enable).
|
||||
|
||||
- [clash-verge](https://github.com/zzzgydi/clash-verge), A Clash GUI based on tauri. Available as [programs.clash-verge](#opt-programs.clash-verge.enable).
|
||||
|
||||
- [Cloudlog](https://www.magicbug.co.uk/cloudlog/), a web-based Amateur Radio logging application. Available as [services.cloudlog](#opt-services.cloudlog.enable).
|
||||
|
||||
- [fzf](https://github.com/junegunn/fzf), a command line fuzzyfinder. Available as [programs.fzf](#opt-programs.fzf.fuzzyCompletion).
|
||||
|
|
|
@ -149,6 +149,7 @@
|
|||
./programs/cdemu.nix
|
||||
./programs/cfs-zen-tweaks.nix
|
||||
./programs/chromium.nix
|
||||
./programs/clash-verge.nix
|
||||
./programs/cnping.nix
|
||||
./programs/command-not-found/command-not-found.nix
|
||||
./programs/criu.nix
|
||||
|
|
41
nixos/modules/programs/clash-verge.nix
Normal file
41
nixos/modules/programs/clash-verge.nix
Normal file
|
@ -0,0 +1,41 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
options.programs.clash-verge = {
|
||||
enable = lib.mkEnableOption (lib.mdDoc ''
|
||||
Clash Verge.
|
||||
'');
|
||||
|
||||
autoStart = lib.mkEnableOption (lib.mdDoc ''
|
||||
Clash Verge Auto Launch.
|
||||
'');
|
||||
|
||||
tunMode = lib.mkEnableOption (lib.mdDoc ''
|
||||
Clash Verge Tun Mode.
|
||||
'');
|
||||
};
|
||||
|
||||
config =
|
||||
let
|
||||
cfg = config.programs.clash-verge;
|
||||
in
|
||||
lib.mkIf cfg.enable {
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.clash-verge
|
||||
(lib.mkIf cfg.autoStart (pkgs.makeAutostartItem {
|
||||
name = "clash-verge";
|
||||
package = pkgs.clash-verge;
|
||||
}))
|
||||
];
|
||||
|
||||
security.wrappers.clash-verge = lib.mkIf cfg.tunMode {
|
||||
owner = "root";
|
||||
group = "root";
|
||||
capabilities = "cap_net_bind_service,cap_net_admin=+ep";
|
||||
source = "${lib.getExe pkgs.clash-verge}";
|
||||
};
|
||||
};
|
||||
|
||||
meta.maintainers = with lib.maintainers; [ zendo ];
|
||||
}
|
Loading…
Reference in a new issue