mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-24 17:58:30 +02:00
feat(darwin): new host - frieren
This commit is contained in:
9
Justfile
9
Justfile
@@ -151,6 +151,15 @@ fe mode="default":
|
|||||||
darwin-build "fern" {{mode}};
|
darwin-build "fern" {{mode}};
|
||||||
darwin-switch "fern" {{mode}}
|
darwin-switch "fern" {{mode}}
|
||||||
|
|
||||||
|
# Depoly to frieren(macOS host)
|
||||||
|
[macos]
|
||||||
|
[group('desktop')]
|
||||||
|
fr mode="default":
|
||||||
|
#!/usr/bin/env nu
|
||||||
|
use {{utils_nu}} *;
|
||||||
|
darwin-build "frieren" {{mode}};
|
||||||
|
darwin-switch "frieren" {{mode}}
|
||||||
|
|
||||||
# Reset launchpad to force it to reindex Applications
|
# Reset launchpad to force it to reindex Applications
|
||||||
[macos]
|
[macos]
|
||||||
[group('desktop')]
|
[group('desktop')]
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
_:
|
_:
|
||||||
#############################################################
|
#############################################################
|
||||||
#
|
#
|
||||||
# Fern - MacBook Pro 2022 13-inch M2 16G, mainly for business.
|
# Fern - MacBook Pro 2022 13-inch M2 16G.
|
||||||
#
|
#
|
||||||
#############################################################
|
#############################################################
|
||||||
let
|
let
|
||||||
|
|||||||
13
hosts/darwin-frieren/default.nix
Normal file
13
hosts/darwin-frieren/default.nix
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
_:
|
||||||
|
#############################################################
|
||||||
|
#
|
||||||
|
# Fern - MacBook Pro 2024 14-inch M4 Pro 48G, mainly for business.
|
||||||
|
#
|
||||||
|
#############################################################
|
||||||
|
let
|
||||||
|
hostname = "frieren";
|
||||||
|
in {
|
||||||
|
networking.hostName = hostname;
|
||||||
|
networking.computerName = hostname;
|
||||||
|
system.defaults.smb.NetBIOSName = hostname;
|
||||||
|
}
|
||||||
14
hosts/darwin-frieren/home.nix
Normal file
14
hosts/darwin-frieren/home.nix
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
programs.ssh = {
|
||||||
|
enable = true;
|
||||||
|
extraConfig = ''
|
||||||
|
Host github.com
|
||||||
|
Hostname github.com
|
||||||
|
# github is controlled by frieren~
|
||||||
|
IdentityFile ~/.ssh/frieren
|
||||||
|
# Specifies that ssh should only use the identity file explicitly configured above
|
||||||
|
# required to prevent sending default identity files first.
|
||||||
|
IdentitiesOnly yes
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -109,10 +109,6 @@ in {
|
|||||||
masApps = {
|
masApps = {
|
||||||
# Xcode = 497799835;
|
# Xcode = 497799835;
|
||||||
Wechat = 836500024;
|
Wechat = 836500024;
|
||||||
QQ = 451108668;
|
|
||||||
# WeCom = 1189898970; # Wechat for Work
|
|
||||||
TecentMeeting = 1484048379;
|
|
||||||
QQMusic = 595615424;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
taps = [
|
taps = [
|
||||||
@@ -157,8 +153,8 @@ in {
|
|||||||
"firefox"
|
"firefox"
|
||||||
"google-chrome"
|
"google-chrome"
|
||||||
"visual-studio-code"
|
"visual-studio-code"
|
||||||
"zed" # zed editor
|
# "zed" # zed editor
|
||||||
"cursor" # an AI code editor
|
# "cursor" # an AI code editor
|
||||||
"aerospace" # an i3-like tiling window manager for macOS
|
"aerospace" # an i3-like tiling window manager for macOS
|
||||||
"ghostty" # terminal emulator
|
"ghostty" # terminal emulator
|
||||||
|
|
||||||
@@ -167,20 +163,23 @@ in {
|
|||||||
|
|
||||||
# IM & audio & remote desktop & meeting
|
# IM & audio & remote desktop & meeting
|
||||||
"telegram"
|
"telegram"
|
||||||
|
"qq"
|
||||||
|
"qqmusic"
|
||||||
# "discord" # update too frequently, use the web version instead
|
# "discord" # update too frequently, use the web version instead
|
||||||
"microsoft-remote-desktop"
|
"microsoft-remote-desktop"
|
||||||
"moonlight" # remote desktop client
|
# "moonlight" # remote desktop client
|
||||||
"rustdesk" # meeting
|
# "rustdesk" # meeting
|
||||||
|
# "tencent-meeting"
|
||||||
"zoom" # meeting
|
"zoom" # meeting
|
||||||
|
|
||||||
# Misc
|
# Misc
|
||||||
# "shadowsocksx-ng" # proxy tool
|
# "shadowsocksx-ng" # proxy tool
|
||||||
"iina" # video player
|
"iina" # video player
|
||||||
"raycast" # (HotKey: alt/option + space)search, calculate and run scripts(with many plugins)
|
# "raycast" # (HotKey: alt/option + space)search, calculate and run scripts(with many plugins)
|
||||||
"stats" # beautiful system status monitor in menu bar
|
"stats" # beautiful system status monitor in menu bar
|
||||||
# "reaper" # audio editor
|
# "reaper" # audio editor
|
||||||
"sonic-pi" # music programming
|
# "sonic-pi" # music programming
|
||||||
"tencent-lemon" # macOS cleaner
|
# "tencent-lemon" # macOS cleaner
|
||||||
"neteasemusic" # music
|
"neteasemusic" # music
|
||||||
"blender@lts" # 3D creation suite
|
"blender@lts" # 3D creation suite
|
||||||
"mihomo-party" # transparent proxy tool
|
"mihomo-party" # transparent proxy tool
|
||||||
|
|||||||
@@ -12,6 +12,10 @@
|
|||||||
#
|
#
|
||||||
###################################################################################
|
###################################################################################
|
||||||
|
|
||||||
|
# Determinate uses its own daemon to manage the Nix installation that
|
||||||
|
# conflicts with nix-darwin's native Nix management. so we should disable this option.
|
||||||
|
nix.enable = false;
|
||||||
|
|
||||||
# Disable auto-optimise-store because of this issue:
|
# Disable auto-optimise-store because of this issue:
|
||||||
# https://github.com/NixOS/nix/issues/7273
|
# https://github.com/NixOS/nix/issues/7273
|
||||||
# "error: cannot link '/nix/store/.tmp-link-xxxxx-xxxxx' to '/nix/store/.links/xxxx': File exists"
|
# "error: cannot link '/nix/store/.tmp-link-xxxxx-xxxxx' to '/nix/store/.links/xxxx': File exists"
|
||||||
|
|||||||
35
outputs/aarch64-darwin/src/frieren.nix
Normal file
35
outputs/aarch64-darwin/src/frieren.nix
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
# NOTE: the args not used in this file CAN NOT be removed!
|
||||||
|
# because haumea pass argument lazily,
|
||||||
|
# and these arguments are used in the functions like `mylib.nixosSystem`, `mylib.colmenaSystem`, etc.
|
||||||
|
inputs,
|
||||||
|
lib,
|
||||||
|
mylib,
|
||||||
|
myvars,
|
||||||
|
system,
|
||||||
|
genSpecialArgs,
|
||||||
|
...
|
||||||
|
} @ args: let
|
||||||
|
name = "frieren";
|
||||||
|
|
||||||
|
modules = {
|
||||||
|
darwin-modules =
|
||||||
|
(map mylib.relativeToRoot [
|
||||||
|
# common
|
||||||
|
"secrets/darwin.nix"
|
||||||
|
"modules/darwin"
|
||||||
|
# host specific
|
||||||
|
"hosts/darwin-${name}"
|
||||||
|
])
|
||||||
|
++ [];
|
||||||
|
home-modules = map mylib.relativeToRoot [
|
||||||
|
"hosts/darwin-${name}/home.nix"
|
||||||
|
"home/darwin"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
systemArgs = modules // args;
|
||||||
|
in {
|
||||||
|
# macOS's configuration
|
||||||
|
darwinConfigurations.${name} = mylib.macosSystem systemArgs;
|
||||||
|
}
|
||||||
@@ -56,7 +56,6 @@ let
|
|||||||
# If you do not have this file, you can generate all the host keys by command:
|
# If you do not have this file, you can generate all the host keys by command:
|
||||||
# sudo ssh-keygen -A
|
# sudo ssh-keygen -A
|
||||||
idol_ai = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINHZtzeaQyXwuRMLzoOAuTu8P9bu5yc5MBwo5LI3iWBV root@ai";
|
idol_ai = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINHZtzeaQyXwuRMLzoOAuTu8P9bu5yc5MBwo5LI3iWBV root@ai";
|
||||||
harmonica = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINT7Pgy/Yl+t6UkHp5+8zfeyJqeJ8EndyR1Vjf/XBe5f root@harmonica";
|
|
||||||
fern = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMokXUYcUy7tysH4tRR6pevFjyOP4cXMjpBSgBZggm9X root@fern";
|
fern = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMokXUYcUy7tysH4tRR6pevFjyOP4cXMjpBSgBZggm9X root@fern";
|
||||||
|
|
||||||
# A key for recovery purpose, generated by `ssh-keygen -t ed25519 -a 256 -C "ryan@agenix-recovery"` with a strong passphrase
|
# A key for recovery purpose, generated by `ssh-keygen -t ed25519 -a 256 -C "ryan@agenix-recovery"` with a strong passphrase
|
||||||
@@ -64,7 +63,6 @@ let
|
|||||||
recovery_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHnIGH+653Oe+GQaA8zjjj7HWMWp7bWXed4q5KqY4nqG ryan@agenix-recovery";
|
recovery_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHnIGH+653Oe+GQaA8zjjj7HWMWp7bWXed4q5KqY4nqG ryan@agenix-recovery";
|
||||||
systems = [
|
systems = [
|
||||||
idol_ai
|
idol_ai
|
||||||
harmonica
|
|
||||||
fern
|
fern
|
||||||
|
|
||||||
recovery_key
|
recovery_key
|
||||||
|
|||||||
@@ -20,6 +20,6 @@
|
|||||||
sshAuthorizedKeys = [
|
sshAuthorizedKeys = [
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIKlN+Q/GxvwxDX/OAjJHaNFEznEN4Tw4E4TwqQu/eD6 ryan@idols-ai"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIKlN+Q/GxvwxDX/OAjJHaNFEznEN4Tw4E4TwqQu/eD6 ryan@idols-ai"
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFIznBmtZlMcVUL+uPFltLTNa8Y1J0aT1E36AXQV07su ryan@fern"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFIznBmtZlMcVUL+uPFltLTNa8Y1J0aT1E36AXQV07su ryan@fern"
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPwZ9MdotnyhxIJrI4gmVshExHiZOx+FGFhcW7BaYkfR ryan@harmonica"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDc1PNTXzzvd93E+e9LXvnEzqgUI5gMTEF/IitvzgmL+ ryan@frieren"
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user