From 22419fddf7f6c4db378dde8e597a405436a292e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl=20Thom=C3=A9?= Date: Mon, 29 May 2023 12:10:46 +0200 Subject: [PATCH 1/3] Use LocalHostName --- pkgs/nix-tools/darwin-rebuild.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/nix-tools/darwin-rebuild.sh b/pkgs/nix-tools/darwin-rebuild.sh index d8c66bdd..2d288bdf 100644 --- a/pkgs/nix-tools/darwin-rebuild.sh +++ b/pkgs/nix-tools/darwin-rebuild.sh @@ -132,7 +132,7 @@ if [ -n "$flake" ]; then flakeAttr=${fragment} fi if [ -z "$flakeAttr" ]; then - flakeAttr=$(hostname -s) + flakeAttr=$(scutil --get LocalHostName) fi flakeAttr=darwinConfigurations.${flakeAttr} fi From 6cd2f4cea255623076722f9acbc3e0db2d0ee43d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl=20Thom=C3=A9?= Date: Tue, 19 Sep 2023 01:03:22 +0200 Subject: [PATCH 2/3] Replace hostname with LocalHostName --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b3b00280..b29d8a71 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ cd ~/.config/nix-darwin nix flake init -t nix-darwin ``` -Make sure to replace all occurrences of `simple` with your short hostname which you can find by running `hostname -s`. +Make sure to replace all occurrences of `simple` with your hostname which you can find by running `scutil --get LocalHostName`. > NOTE: Make sure to change `nixpkgs.hostPlatform` to `aarch64-darwin` if you are using Apple Silicon. @@ -118,7 +118,7 @@ Add the following to `flake.nix` in the same folder as `configuration.nix`: } ``` -Make sure to replace `Johns-MacBook` with your short hostname which you can find by running `hostname -s`. +Make sure to replace `Johns-MacBook` with your hostname which you can find by running `scutil --get LocalHostName`. > NOTE: Make sure to set `nixpkgs.hostPlatform` in your `configuration.nix` to either `x86_64-darwin` (Intel) or `aarch64-darwin` (Apple Silicon). From b658dbd85a1c70a15759b470d7b88c0c95f497be Mon Sep 17 00:00:00 2001 From: Michael Hoang Date: Fri, 22 Sep 2023 16:17:42 +0100 Subject: [PATCH 3/3] Update README --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b29d8a71..fb3cf6fd 100644 --- a/README.md +++ b/README.md @@ -86,11 +86,10 @@ If you don't have an existing `configuration.nix`, you can run the following com mkdir -p ~/.config/nix-darwin cd ~/.config/nix-darwin nix flake init -t nix-darwin +sed -i '' "s/simple/$(scutil --get LocalHostName)/" flake.nix ``` -Make sure to replace all occurrences of `simple` with your hostname which you can find by running `scutil --get LocalHostName`. - -> NOTE: Make sure to change `nixpkgs.hostPlatform` to `aarch64-darwin` if you are using Apple Silicon. +Make sure to change `nixpkgs.hostPlatform` to `aarch64-darwin` if you are using Apple Silicon. @@ -120,7 +119,7 @@ Add the following to `flake.nix` in the same folder as `configuration.nix`: Make sure to replace `Johns-MacBook` with your hostname which you can find by running `scutil --get LocalHostName`. -> NOTE: Make sure to set `nixpkgs.hostPlatform` in your `configuration.nix` to either `x86_64-darwin` (Intel) or `aarch64-darwin` (Apple Silicon). +Make sure to set `nixpkgs.hostPlatform` in your `configuration.nix` to either `x86_64-darwin` (Intel) or `aarch64-darwin` (Apple Silicon).