darwin: unbreak
This commit is contained in:
parent
d86e047588
commit
a31c38d2e5
9 changed files with 13 additions and 65 deletions
|
@ -1,6 +1,6 @@
|
||||||
{...}: {
|
{...}: {
|
||||||
imports = [
|
imports = [
|
||||||
./networking/proxy.nix
|
./networking/proxy.nix
|
||||||
./services/clash.nix
|
./services/mihomo.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,30 +4,24 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
cfg = config.services.clash;
|
cfg = config.services.mihomo;
|
||||||
in {
|
in {
|
||||||
options.services.clash = {
|
options.services.mihomo = {
|
||||||
enable = lib.mkEnableOption "Whether to enable Clash, A rule-based proxy in Go.";
|
enable = lib.mkEnableOption "Whether to enable Mihomo, A rule-based proxy in Go.";
|
||||||
package = lib.mkPackageOption pkgs "clash" {};
|
package = lib.mkPackageOption pkgs "mihomo" {};
|
||||||
configFile = lib.mkOption {
|
|
||||||
default = null;
|
|
||||||
type = lib.types.nullOr lib.types.path;
|
|
||||||
description = "Configuration file to use.";
|
|
||||||
};
|
|
||||||
webui = lib.mkOption {
|
webui = lib.mkOption {
|
||||||
default = null;
|
default = null;
|
||||||
type = lib.types.nullOr lib.types.path;
|
type = lib.types.nullOr lib.types.path;
|
||||||
description = ''
|
description = ''
|
||||||
Local web interface to use.
|
Local web interface to use.
|
||||||
|
|
||||||
You can also use the following website, just in case:
|
|
||||||
- metacubexd:
|
- metacubexd:
|
||||||
- http://d.metacubex.one
|
- http://d.metacubex.one
|
||||||
- https://metacubex.github.io/metacubexd
|
- https://metacubex.github.io/metacubexd
|
||||||
- https://metacubexd.pages.dev
|
- https://metacubexd.pages.dev
|
||||||
- yacd:
|
- yacd:
|
||||||
- https://yacd.haishan.me
|
- https://yacd.haishan.me
|
||||||
- clash-dashboard (buggy):
|
- clash-dashboard:
|
||||||
- https://clash.razord.top
|
- https://clash.razord.top
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
@ -41,11 +35,10 @@ in {
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
### launchd service
|
### launchd service
|
||||||
# TODO: not run as root user
|
# TODO: not run as root user
|
||||||
launchd.daemons."clash" = {
|
launchd.daemons."mihomo" = {
|
||||||
command = builtins.concatStringsSep " " [
|
command = builtins.concatStringsSep " " [
|
||||||
(lib.getExe cfg.package)
|
(lib.getExe cfg.package)
|
||||||
"-d /etc/clash"
|
"-d /etc/mihomo"
|
||||||
(lib.optionalString (cfg.configFile != null) "-f ${cfg.configFile}")
|
|
||||||
(lib.optionalString (cfg.webui != null) "-ext-ui ${cfg.webui}")
|
(lib.optionalString (cfg.webui != null) "-ext-ui ${cfg.webui}")
|
||||||
(lib.optionalString (cfg.extraOpts != null) cfg.extraOpts)
|
(lib.optionalString (cfg.extraOpts != null) cfg.extraOpts)
|
||||||
];
|
];
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
### home-manager
|
|
||||||
home-manager.users.guanranwang = import ./home;
|
|
||||||
|
|
||||||
homebrew.casks = [
|
|
||||||
"steam"
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
{...}: {
|
|
||||||
imports = [
|
|
||||||
../../../../../home/applications/prismlauncher
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,12 +1,7 @@
|
||||||
{
|
{pkgs, ...}: {
|
||||||
pkgs,
|
services.mihomo = {
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
services.clash = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.clash-meta;
|
webui = pkgs.metacubexd;
|
||||||
webui = config.nur.repos.guanran928.metacubexd;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
### System proxy settings
|
### System proxy settings
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
}: {
|
}: {
|
||||||
imports = map (n: ../../../../home/applications/${n}) [
|
imports = map (n: ../../../../home/applications/${n}) [
|
||||||
"go"
|
"go"
|
||||||
"mpv"
|
# "mpv"
|
||||||
"nix"
|
"nix"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{pkgs, ...}: {
|
{pkgs, ...}: {
|
||||||
fonts.fontDir.enable = true;
|
fonts.packages = with pkgs; [
|
||||||
fonts.fonts = with pkgs; [
|
|
||||||
(nerdfonts.override {fonts = ["JetBrainsMono"];})
|
(nerdfonts.override {fonts = ["JetBrainsMono"];})
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
21
flake.lock
21
flake.lock
|
@ -322,26 +322,6 @@
|
||||||
"type": "github"
|
"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": {
|
"nixos-hardware": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1719895800,
|
"lastModified": 1719895800,
|
||||||
|
@ -503,7 +483,6 @@
|
||||||
"nix-darwin": "nix-darwin",
|
"nix-darwin": "nix-darwin",
|
||||||
"nix-formatter-pack": "nix-formatter-pack",
|
"nix-formatter-pack": "nix-formatter-pack",
|
||||||
"nix-on-droid": "nix-on-droid",
|
"nix-on-droid": "nix-on-droid",
|
||||||
"nixcasks": "nixcasks",
|
|
||||||
"nixos-hardware": "nixos-hardware",
|
"nixos-hardware": "nixos-hardware",
|
||||||
"nixos-sensible": "nixos-sensible",
|
"nixos-sensible": "nixos-sensible",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
|
|
|
@ -66,11 +66,6 @@
|
||||||
inputs.nix-formatter-pack.follows = "nix-formatter-pack";
|
inputs.nix-formatter-pack.follows = "nix-formatter-pack";
|
||||||
inputs.nmd.follows = "nmd";
|
inputs.nmd.follows = "nmd";
|
||||||
};
|
};
|
||||||
nixcasks = {
|
|
||||||
# contains unfree
|
|
||||||
url = "github:jacekszymanski/nixcasks";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs-stable";
|
|
||||||
};
|
|
||||||
nur = {
|
nur = {
|
||||||
url = "github:nix-community/NUR";
|
url = "github:nix-community/NUR";
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue