diff --git a/Justfile b/Justfile index a88d6a32..0219d873 100644 --- a/Justfile +++ b/Justfile @@ -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')] diff --git a/hosts/darwin-fern/default.nix b/hosts/darwin-fern/default.nix index 5f5b423b..fd6293b9 100644 --- a/hosts/darwin-fern/default.nix +++ b/hosts/darwin-fern/default.nix @@ -1,7 +1,7 @@ _: ############################################################# # -# Fern - MacBook Pro 2022 13-inch M2 16G, mainly for business. +# Fern - MacBook Pro 2022 13-inch M2 16G. # ############################################################# let diff --git a/hosts/darwin-frieren/default.nix b/hosts/darwin-frieren/default.nix new file mode 100644 index 00000000..5569e240 --- /dev/null +++ b/hosts/darwin-frieren/default.nix @@ -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; +} diff --git a/hosts/darwin-frieren/home.nix b/hosts/darwin-frieren/home.nix new file mode 100644 index 00000000..fd84ef99 --- /dev/null +++ b/hosts/darwin-frieren/home.nix @@ -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 + ''; + }; +} diff --git a/modules/darwin/apps.nix b/modules/darwin/apps.nix index 88c9ec5d..4f6bfe59 100644 --- a/modules/darwin/apps.nix +++ b/modules/darwin/apps.nix @@ -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 diff --git a/modules/darwin/nix-core.nix b/modules/darwin/nix-core.nix index 0ff35ac5..0b12ea73 100644 --- a/modules/darwin/nix-core.nix +++ b/modules/darwin/nix-core.nix @@ -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" diff --git a/outputs/aarch64-darwin/src/frieren.nix b/outputs/aarch64-darwin/src/frieren.nix new file mode 100644 index 00000000..e3d844a4 --- /dev/null +++ b/outputs/aarch64-darwin/src/frieren.nix @@ -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; +} diff --git a/secrets/README.md b/secrets/README.md index 909cde75..bc28f589 100644 --- a/secrets/README.md +++ b/secrets/README.md @@ -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 diff --git a/vars/default.nix b/vars/default.nix index af1f85dc..272676ca 100644 --- a/vars/default.nix +++ b/vars/default.nix @@ -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" ]; }