window for tray icon, new toggles, formatting
This commit is contained in:
15 files changed
+644
-321
No files matched your search
@@ -1,8 +1,13 @@
|
||||
# Factory function — receives the zapret flake, returns a NixOS module.
|
||||
# Factory function – receives the zapret flake, returns a NixOS module.
|
||||
# This lets consumers add a single flake input and get everything transitively.
|
||||
{ zapret }:
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.services.proxy-suite;
|
||||
@@ -15,32 +20,63 @@ in
|
||||
zapret.nixosModules.default
|
||||
];
|
||||
|
||||
config = lib.mkIf cfg.enable (lib.mkMerge [
|
||||
(lib.mkIf cfg.singBox.enable (
|
||||
let
|
||||
rules = import ./rules.nix { inherit lib pkgs cfg zapret; };
|
||||
configs = import ./config.nix { inherit lib pkgs cfg rules; };
|
||||
nftr = import ./nftables.nix { inherit lib pkgs cfg; };
|
||||
in
|
||||
import ./service.nix {
|
||||
inherit config lib pkgs cfg;
|
||||
inherit (configs) tproxyFile tunFile;
|
||||
inherit (nftr) nftablesRulesFile ip nft;
|
||||
}
|
||||
))
|
||||
config = lib.mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
(lib.mkIf cfg.singBox.enable (
|
||||
let
|
||||
rules = import ./rules.nix {
|
||||
inherit
|
||||
lib
|
||||
pkgs
|
||||
cfg
|
||||
zapret
|
||||
;
|
||||
};
|
||||
configs = import ./config.nix {
|
||||
inherit
|
||||
lib
|
||||
pkgs
|
||||
cfg
|
||||
rules
|
||||
;
|
||||
};
|
||||
nftr = import ./nftables.nix { inherit lib pkgs cfg; };
|
||||
in
|
||||
import ./service.nix {
|
||||
inherit
|
||||
config
|
||||
lib
|
||||
pkgs
|
||||
cfg
|
||||
;
|
||||
inherit (configs) tproxyFile tunFile;
|
||||
inherit (nftr) nftablesRulesFile ip nft;
|
||||
}
|
||||
))
|
||||
|
||||
(lib.mkIf cfg.zapret.enable (
|
||||
import ./zapret.nix {
|
||||
inherit lib pkgs cfg zapret;
|
||||
}
|
||||
))
|
||||
(lib.mkIf cfg.zapret.enable (
|
||||
import ./zapret.nix {
|
||||
inherit
|
||||
lib
|
||||
pkgs
|
||||
cfg
|
||||
zapret
|
||||
;
|
||||
}
|
||||
))
|
||||
|
||||
(lib.mkIf cfg.tgWsProxy.enable (
|
||||
import ./tg-ws-proxy.nix { inherit lib pkgs cfg; }
|
||||
))
|
||||
(lib.mkIf cfg.tgWsProxy.enable (import ./tg-ws-proxy.nix { inherit lib pkgs cfg; }))
|
||||
|
||||
(lib.mkIf cfg.tray.enable (
|
||||
import ./tray.nix { inherit config lib pkgs cfg; }
|
||||
))
|
||||
]);
|
||||
(lib.mkIf cfg.tray.enable (
|
||||
import ./tray.nix {
|
||||
inherit
|
||||
config
|
||||
lib
|
||||
pkgs
|
||||
cfg
|
||||
;
|
||||
}
|
||||
))
|
||||
]
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user