diff --git a/darwin/modules/default.nix b/darwin/modules/default.nix index f2041a9..a2818a3 100644 --- a/darwin/modules/default.nix +++ b/darwin/modules/default.nix @@ -1,6 +1,6 @@ {...}: { imports = [ ./networking/proxy.nix - ./services/clash.nix + ./services/mihomo.nix ]; } diff --git a/darwin/modules/services/clash.nix b/darwin/modules/services/mihomo.nix similarity index 64% rename from darwin/modules/services/clash.nix rename to darwin/modules/services/mihomo.nix index f32f3c7..6a5ed74 100644 --- a/darwin/modules/services/clash.nix +++ b/darwin/modules/services/mihomo.nix @@ -4,30 +4,24 @@ 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" {}; - configFile = lib.mkOption { - default = null; - type = lib.types.nullOr lib.types.path; - description = "Configuration file to use."; - }; + options.services.mihomo = { + enable = lib.mkEnableOption "Whether to enable Mihomo, A rule-based proxy in Go."; + package = lib.mkPackageOption pkgs "mihomo" {}; webui = lib.mkOption { default = null; type = lib.types.nullOr lib.types.path; 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 - https://metacubexd.pages.dev - yacd: - https://yacd.haishan.me - - clash-dashboard (buggy): + - clash-dashboard: - https://clash.razord.top ''; }; @@ -41,11 +35,10 @@ 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" (lib.optionalString (cfg.webui != null) "-ext-ui ${cfg.webui}") (lib.optionalString (cfg.extraOpts != null) cfg.extraOpts) ]; diff --git a/darwin/profiles/common/opt-in/gaming/default.nix b/darwin/profiles/common/opt-in/gaming/default.nix deleted file mode 100644 index fbfae40..0000000 --- a/darwin/profiles/common/opt-in/gaming/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - ### home-manager - home-manager.users.guanranwang = import ./home; - - homebrew.casks = [ - "steam" - ]; -} diff --git a/darwin/profiles/common/opt-in/gaming/home/default.nix b/darwin/profiles/common/opt-in/gaming/home/default.nix deleted file mode 100644 index f27edd8..0000000 --- a/darwin/profiles/common/opt-in/gaming/home/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{...}: { - imports = [ - ../../../../../home/applications/prismlauncher - ]; -} diff --git a/darwin/profiles/common/opt-in/mihomo.nix b/darwin/profiles/common/opt-in/mihomo.nix index e2ed636..49b1086 100644 --- a/darwin/profiles/common/opt-in/mihomo.nix +++ b/darwin/profiles/common/opt-in/mihomo.nix @@ -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 diff --git a/darwin/profiles/desktop/home/default.nix b/darwin/profiles/desktop/home/default.nix index 22a6c13..612d654 100644 --- a/darwin/profiles/desktop/home/default.nix +++ b/darwin/profiles/desktop/home/default.nix @@ -6,7 +6,7 @@ }: { imports = map (n: ../../../../home/applications/${n}) [ "go" - "mpv" + # "mpv" "nix" ]; diff --git a/darwin/profiles/desktop/packages/fonts.nix b/darwin/profiles/desktop/packages/fonts.nix index b2cde8f..6bedb43 100644 --- a/darwin/profiles/desktop/packages/fonts.nix +++ b/darwin/profiles/desktop/packages/fonts.nix @@ -1,6 +1,5 @@ {pkgs, ...}: { - fonts.fontDir.enable = true; - fonts.fonts = with pkgs; [ + fonts.packages = with pkgs; [ (nerdfonts.override {fonts = ["JetBrainsMono"];}) ]; } diff --git a/flake.lock b/flake.lock index 7a7cbe0..11e73fc 100644 --- a/flake.lock +++ b/flake.lock @@ -322,26 +322,6 @@ "type": "github" } }, - "nixcasks": { - "inputs": { - "nixpkgs": [ - "nixpkgs-stable" - ] - }, - "locked": { - "lastModified": 1720301939, - "narHash": "sha256-yP2+IPhcUscJbwbuAaHQRAIKrrnF1ePQBwwzGFlfqmE=", - "owner": "jacekszymanski", - "repo": "nixcasks", - "rev": "b3ebbbc306d051edb9bc2fa9dc791dabfd3d106b", - "type": "github" - }, - "original": { - "owner": "jacekszymanski", - "repo": "nixcasks", - "type": "github" - } - }, "nixos-hardware": { "locked": { "lastModified": 1719895800, @@ -503,7 +483,6 @@ "nix-darwin": "nix-darwin", "nix-formatter-pack": "nix-formatter-pack", "nix-on-droid": "nix-on-droid", - "nixcasks": "nixcasks", "nixos-hardware": "nixos-hardware", "nixos-sensible": "nixos-sensible", "nixpkgs": "nixpkgs", diff --git a/flake.nix b/flake.nix index ce43a85..4fea870 100644 --- a/flake.nix +++ b/flake.nix @@ -66,11 +66,6 @@ inputs.nix-formatter-pack.follows = "nix-formatter-pack"; inputs.nmd.follows = "nmd"; }; - nixcasks = { - # contains unfree - url = "github:jacekszymanski/nixcasks"; - inputs.nixpkgs.follows = "nixpkgs-stable"; - }; nur = { url = "github:nix-community/NUR"; };