feat(darwin): new host - frieren

This commit is contained in:
Ryan Yin
2025-05-13 12:50:26 +08:00
parent 65e1ea4fc5
commit e13079f7a8
9 changed files with 87 additions and 15 deletions

View File

@@ -151,6 +151,15 @@ fe mode="default":
darwin-build "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
[macos]
[group('desktop')]

View File

@@ -1,7 +1,7 @@
_:
#############################################################
#
# Fern - MacBook Pro 2022 13-inch M2 16G, mainly for business.
# Fern - MacBook Pro 2022 13-inch M2 16G.
#
#############################################################
let

View 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;
}

View 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
'';
};
}

View File

@@ -109,10 +109,6 @@ in {
masApps = {
# Xcode = 497799835;
Wechat = 836500024;
QQ = 451108668;
# WeCom = 1189898970; # Wechat for Work
TecentMeeting = 1484048379;
QQMusic = 595615424;
};
taps = [
@@ -157,8 +153,8 @@ in {
"firefox"
"google-chrome"
"visual-studio-code"
"zed" # zed editor
"cursor" # an AI code editor
# "zed" # zed editor
# "cursor" # an AI code editor
"aerospace" # an i3-like tiling window manager for macOS
"ghostty" # terminal emulator
@@ -167,20 +163,23 @@ in {
# IM & audio & remote desktop & meeting
"telegram"
"qq"
"qqmusic"
# "discord" # update too frequently, use the web version instead
"microsoft-remote-desktop"
"moonlight" # remote desktop client
"rustdesk" # meeting
# "moonlight" # remote desktop client
# "rustdesk" # meeting
# "tencent-meeting"
"zoom" # meeting
# Misc
# "shadowsocksx-ng" # proxy tool
"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
# "reaper" # audio editor
"sonic-pi" # music programming
"tencent-lemon" # macOS cleaner
# "sonic-pi" # music programming
# "tencent-lemon" # macOS cleaner
"neteasemusic" # music
"blender@lts" # 3D creation suite
"mihomo-party" # transparent proxy tool

View File

@@ -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:
# https://github.com/NixOS/nix/issues/7273
# "error: cannot link '/nix/store/.tmp-link-xxxxx-xxxxx' to '/nix/store/.links/xxxx': File exists"

View 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;
}

View File

@@ -56,7 +56,6 @@ let
# If you do not have this file, you can generate all the host keys by command:
# sudo ssh-keygen -A
idol_ai = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINHZtzeaQyXwuRMLzoOAuTu8P9bu5yc5MBwo5LI3iWBV root@ai";
harmonica = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINT7Pgy/Yl+t6UkHp5+8zfeyJqeJ8EndyR1Vjf/XBe5f root@harmonica";
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
@@ -64,7 +63,6 @@ let
recovery_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHnIGH+653Oe+GQaA8zjjj7HWMWp7bWXed4q5KqY4nqG ryan@agenix-recovery";
systems = [
idol_ai
harmonica
fern
recovery_key

View File

@@ -20,6 +20,6 @@
sshAuthorizedKeys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIKlN+Q/GxvwxDX/OAjJHaNFEznEN4Tw4E4TwqQu/eD6 ryan@idols-ai"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFIznBmtZlMcVUL+uPFltLTNa8Y1J0aT1E36AXQV07su ryan@fern"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPwZ9MdotnyhxIJrI4gmVshExHiZOx+FGFhcW7BaYkfR ryan@harmonica"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDc1PNTXzzvd93E+e9LXvnEzqgUI5gMTEF/IitvzgmL+ ryan@frieren"
];
}