···4747 # Zap might be nice but it's scary, for example firefox@nightly zap stanza
4848 # also deletes stable firefox settings and stuff, so it's probably best
4949 # to zap on a case-by-case basis instead. AppCleaner should help.
5050- cleanup = "uninstall";
5050+ # cleanup = "uninstall";
5151 };
52525353 global.autoUpdate = false;
···11+From 5fbe04d39cd7e397508091ba98a92b692ec2ef0f Mon Sep 17 00:00:00 2001
22+From: Ian Chamberlain <ian.h.chamberlain@gmail.com>
33+Date: Mon, 3 Feb 2025 22:37:34 -0500
44+Subject: [PATCH] Use ComputerName instead of LocalHostName
55+66+See https://github.com/LnL7/nix-darwin/pull/676 for discussion about why
77+to prefer one or the other; ComputerName seems more stable in my
88+experience.
99+---
1010+ README.md | 4 ++--
1111+ pkgs/nix-tools/darwin-rebuild.sh | 2 +-
1212+ 2 files changed, 3 insertions(+), 3 deletions(-)
1313+1414+diff --git a/README.md b/README.md
1515+index b0f095a..32a9c72 100644
1616+--- a/README.md
1717++++ b/README.md
1818+@@ -43,11 +43,11 @@ ### Step 1. Creating `flake.nix`
1919+ # To use Nixpkgs unstable:
2020+ nix flake init -t nix-darwin/master
2121+ # To use Nixpkgs 24.11:
2222+ nix flake init -t nix-darwin/nix-darwin-24.11
2323+2424+-sed -i '' "s/simple/$(scutil --get LocalHostName)/" flake.nix
2525++sed -i '' "s/simple/$(scutil --get ComputerName)/" flake.nix
2626+ ```
2727+2828+ Make sure to change `nixpkgs.hostPlatform` to `aarch64-darwin` if you are using Apple Silicon.
2929+3030+ </details>
3131+@@ -76,11 +76,11 @@ # To use Nixpkgs 24.11:
3232+ };
3333+ };
3434+ }
3535+ ```
3636+3737+-Make sure to replace `Johns-MacBook` with your hostname which you can find by running `scutil --get LocalHostName`.
3838++Make sure to replace `Johns-MacBook` with your hostname which you can find by running `scutil --get ComputerName`.
3939+4040+ Make sure to set `nixpkgs.hostPlatform` in your `configuration.nix` to either `x86_64-darwin` (Intel) or `aarch64-darwin` (Apple Silicon).
4141+4242+ </details>
4343+4444+diff --git a/pkgs/nix-tools/darwin-rebuild.sh b/pkgs/nix-tools/darwin-rebuild.sh
4545+index 8f207a7..8c958bf 100644
4646+--- a/pkgs/nix-tools/darwin-rebuild.sh
4747++++ b/pkgs/nix-tools/darwin-rebuild.sh
4848+@@ -156,11 +156,11 @@ if [[ -n "$flake" ]]; then
4949+ if [[ $flake =~ ^(.*)\#([^\#\"]*)$ ]]; then
5050+ flake="${BASH_REMATCH[1]}"
5151+ flakeAttr="${BASH_REMATCH[2]}"
5252+ fi
5353+ if [[ -z "$flakeAttr" ]]; then
5454+- flakeAttr=$(scutil --get LocalHostName)
5555++ flakeAttr=$(scutil --get ComputerName)
5656+ fi
5757+ flakeAttr=darwinConfigurations.${flakeAttr}
5858+ fi
5959+6060+ if [ "$action" != build ]; then
6161+--
6262+2.44.1
6363+