Skip to content

Commit

Permalink
chore: separate machines
Browse files Browse the repository at this point in the history
  • Loading branch information
yqrashawn committed Jun 15, 2023
1 parent 15a67c0 commit f6c8d80
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 8 deletions.
20 changes: 19 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,26 @@
system = "aarch64-darwin";
extraModules = [
./profiles/yqrashawn.nix
./modules/yqrashawn/darwin/daemons/tailscale.nix
./modules/yqrashawn/darwin/apps.nix
./modules/yqrashawn/mini.nix
{ homebrew.brewPrefix = "/opt/homebrew/bin"; }
];
};
studio = mkDarwinConfig {
system = "aarch64-darwin";
extraModules = [
./profiles/yqrashawn.nix
./modules/yqrashawn/darwin/apps.nix
./modules/yqrashawn/studio.nix
{ homebrew.brewPrefix = "/opt/homebrew/bin"; }
];
};
mbp = mkDarwinConfig {
system = "aarch64-darwin";
extraModules = [
./profiles/yqrashawn.nix
./modules/yqrashawn/darwin/apps.nix
./modules/yqrashawn/mbp.nix
{ homebrew.brewPrefix = "/opt/homebrew/bin"; }
];
};
Expand Down
26 changes: 26 additions & 0 deletions modules/yqrashawn/darwin/daemons/adguard-home-with-proxy.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{ config, lib, pkgs, ... }:

{
launchd.daemons.adguardhome = {
serviceConfig = {
Label = "com.adguard.adguardhome";
EnvironmentVariables = {
http_proxy = "http://127.0.0.1:6152";
https_proxy = "http://127.0.0.1:6152";
all_proxy = "socks5://127.0.0.1:6153";
HTTP_PROXY = "http://127.0.0.1:6152";
HTTPS_PROXY = "http://127.0.0.1:6152";
ALL_PROXY = "socks5://127.0.0.1:6153";
};
ProgramArguments = [
"/bin/sh"
"-c"
"/bin/wait4path ${pkgs.adguardhome} && ${pkgs.adguardhome}/bin/adguardhome --config /Users/${config.user.name}/.nixpkgs/modules/yqrashawn/home-manager/dotfiles/AdguardHome.yaml"
];
RunAtLoad = true;
KeepAlive = true;
StandardErrorPath = "/tmp/adguardhome-stderr.log";
StandardOutPath = "/tmp/adguardhome-stdout.log";
};
};
}
7 changes: 1 addition & 6 deletions modules/yqrashawn/darwin/daemons/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
{ config, lib, pkgs, ... }: {
imports = [
./set-path.nix
./limit-max.nix
# ./tailscale.nix
./adguard-home.nix
];
imports = [ ./set-path.nix ./limit-max.nix ./adguard-home.nix ];
}
18 changes: 18 additions & 0 deletions modules/yqrashawn/darwin/daemons/tailscale-utun.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{ config, lib, pkgs, ... }:

{
launchd.daemons.tailscaled = {
serviceConfig = {
Label = "com.tailscale.tailscaled";
ProgramArguments = [
"/bin/sh"
"-c"
"/bin/wait4path ${pkgs.tailscale} && ${pkgs.tailscale}/bin/tailscaled -tun utun -statedir /Users/${config.user.name}/tailscale"
];
RunAtLoad = true;
KeepAlive = true;
StandardErrorPath = "/tmp/tailscaled-stderr.log";
StandardOutPath = "/tmp/tailscaled-stdout.log";
};
};
}
1 change: 0 additions & 1 deletion modules/yqrashawn/darwin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
./brew.nix
./preferences.nix
./display-manager.nix
# ./tailscale.nix
];
}
Binary file modified modules/yqrashawn/home-manager/dotfiles/ssh.gpg
Binary file not shown.
6 changes: 6 additions & 0 deletions modules/yqrashawn/mbp.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{ config, lib, pkgs, ... }: {
imports = [
./darwin/daemons/tailscale.nix
./darwin/daemons/adguard-home-with-proxy.nix
];
}
6 changes: 6 additions & 0 deletions modules/yqrashawn/mini.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{ config, lib, pkgs, ... }: {
imports = [
./darwin/daemons/tailscale.nix
./darwin/daemons/adguard-home-with-proxy.nix
];
}
3 changes: 3 additions & 0 deletions modules/yqrashawn/studio.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{ config, lib, pkgs, ... }: {
imports = [ ./darwin/daemons/tailscale-utun.nix ];
}

0 comments on commit f6c8d80

Please sign in to comment.