darwin: unbreak

This commit is contained in:
Guanran Wang 2024-07-08 18:10:35 +08:00
parent 432719121e
commit 24bedbe75e
7 changed files with 13 additions and 34 deletions

View file

@ -1,6 +1,6 @@
{...}: {
imports = [
./networking/proxy.nix
./services/clash.nix
./services/mihomo.nix
];
}

View file

@ -4,13 +4,12 @@
pkgs,
...
}: let
cfg = config.services.clash;
cfg = config.services.mihomo;
in {
options.services.clash = {
enable = lib.mkEnableOption "Whether to enable Clash, A rule-based proxy in Go.";
package = lib.mkPackageOption pkgs "clash" {};
options.services.mihomo = {
enable = lib.mkEnableOption "Whether to enable Mihomo, A rule-based proxy in Go.";
package = lib.mkPackageOption pkgs "mihomo" {};
configFile = lib.mkOption {
default = null;
type = lib.types.nullOr lib.types.path;
description = "Configuration file to use.";
};
@ -20,7 +19,6 @@ in {
description = ''
Local web interface to use.
You can also use the following website, just in case:
- metacubexd:
- http://d.metacubex.one
- https://metacubex.github.io/metacubexd
@ -41,11 +39,11 @@ in {
config = lib.mkIf cfg.enable {
### launchd service
# TODO: not run as root user
launchd.daemons."clash" = {
launchd.daemons."mihomo" = {
command = builtins.concatStringsSep " " [
(lib.getExe cfg.package)
"-d /etc/clash"
(lib.optionalString (cfg.configFile != null) "-f ${cfg.configFile}")
"-d /etc/mihomo"
cfg.configFile
(lib.optionalString (cfg.webui != null) "-ext-ui ${cfg.webui}")
(lib.optionalString (cfg.extraOpts != null) cfg.extraOpts)
];

View file

@ -1,8 +0,0 @@
{
### home-manager
home-manager.users.guanranwang = import ./home;
homebrew.casks = [
"steam"
];
}

View file

@ -1,5 +0,0 @@
{...}: {
imports = [
../../../../../home/applications/prismlauncher
];
}

View file

@ -1,12 +1,7 @@
{
pkgs,
config,
...
}: {
services.clash = {
{pkgs, ...}: {
services.mihomo = {
enable = true;
package = pkgs.clash-meta;
webui = config.nur.repos.guanran928.metacubexd;
webui = pkgs.metacubexd;
};
### System proxy settings

View file

@ -6,7 +6,7 @@
}: {
imports = map (n: ../../../../home/applications/${n}) [
"go"
"mpv"
# "mpv"
"nix"
];

View file

@ -1,6 +1,5 @@
{pkgs, ...}: {
fonts.fontDir.enable = true;
fonts.fonts = with pkgs; [
fonts.packages = with pkgs; [
(nerdfonts.override {fonts = ["JetBrainsMono"];})
];
}