From 19faab32f76bdfe4a337c7a2dd1c826960817834 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Wed, 21 May 2025 12:44:33 +0800 Subject: [PATCH] fix(darwin): nix-darwin - activation option & zsh option --- home/darwin/shell.nix | 6 +++--- modules/darwin/system.nix | 9 ++------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/home/darwin/shell.nix b/home/darwin/shell.nix index dc84256b..7c5b65f1 100644 --- a/home/darwin/shell.nix +++ b/home/darwin/shell.nix @@ -3,7 +3,7 @@ export PATH="$PATH:/opt/homebrew/bin:/usr/local/bin" ''; # copied from the content generated by `conda init bash` - initExtra = '' + initContent = '' arch=$(uname -m) if [ "aarch64" = "$arch" ] || [ "arm64" = "$arch" ]; then @@ -28,10 +28,10 @@ in { # in /opt/homebrew for Apple Silicon and /usr/local for Rosetta 2 to coexist and use bottles. programs.bash = { enable = true; - bashrcExtra = lib.mkAfter (envExtra + initExtra); + bashrcExtra = lib.mkAfter (envExtra + initContent); }; programs.zsh = { enable = true; - inherit envExtra initExtra; + inherit envExtra initContent; }; } diff --git a/modules/darwin/system.nix b/modules/darwin/system.nix index cdb9d9a3..56ccf85b 100644 --- a/modules/darwin/system.nix +++ b/modules/darwin/system.nix @@ -1,4 +1,4 @@ -{pkgs, ...}: +{pkgs, myvars, ...}: ################################################################################### # # macOS's System configuration @@ -22,12 +22,7 @@ time.timeZone = "Asia/Shanghai"; system = { - # activationScripts are executed every time you boot the system or run `nixos-rebuild` / `darwin-rebuild`. - activationScripts.postUserActivation.text = '' - # activateSettings -u will reload the settings from the database and apply them to the current session, - # so we do not need to logout and login again to make the changes take effect. - /System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u - ''; + primaryUser = myvars.username; defaults = { menuExtraClock.Show24Hour = true; # show 24 hour clock