macs: create individual darwin configurations for each machine#925
Merged
macs: create individual darwin configurations for each machine#925
Conversation
mweinelt
commented
Dec 22, 2025
| local HOST=${1} | ||
| local PROFILE=${2} | ||
| (ssh "$HOST" -- sudo darwin-rebuild switch --flake "github:nixos/infra#$PROFILE" 2>&1| sed -e "s/^/${HOST} | /") & | ||
| (ssh "$HOST" -- sudo darwin-rebuild switch --flake "github:nixos/infra" 2>&1| sed -e "s/^/${HOST} | /") & |
Member
Author
There was a problem hiding this comment.
The assumption here is that, same as on NixOS, they'll fall back to a darwin configuration based on their hostname. Is that correct?
Member
Author
There was a problem hiding this comment.
hetzner@intense-heron:~/ > sudo darwin-rebuild switch --flake github:nixos/infra
building the system configuration...
[...]
error: flake 'github:nixos/infra' does not provide attribute 'packages.aarch64-darwin.darwinConfigurations.hetzners-Mac-mini.system', 'legacyPackages.aarch64-darwin.darwinConfigurations.hetzners-Mac-mini.system' or 'darwinConfigurations.hetzners-Mac-mini.system'
So maybe after we redeploy them with this PR, because we now set a hostname.
Member
Author
There was a problem hiding this comment.
hetzner@intense-heron:~/ > scutil --get HostName
HostName: not set
hetzner@intense-heron:~/ > scutil --get LocalHostName
hetzners-Mac-mini
hetzner@intense-heron:~/ > scutil --get ComputerName
hetzner’s Mac mini
Member
There was a problem hiding this comment.
From darwin-rebuild:
if [[ -n "$flake" ]]; then
if [[ $flake =~ ^(.*)\#([^\#\"]*)$ ]]; then
flake="${BASH_REMATCH[1]}"
flakeAttr="${BASH_REMATCH[2]}"
fi
if [[ -z "$flakeAttr" ]]; then
flakeAttr=$(scutil --get LocalHostName)
fi
flakeAttr=darwinConfigurations.${flakeAttr}
fi
Member
Author
There was a problem hiding this comment.
hetzner@intense-heron:~/ > scutil --get HostName
HostName: not set
hetzner@intense-heron:~/ > scutil --get LocalHostName
intense-heron
hetzner@intense-heron:~/ > scutil --get ComputerName
hetzner’s Mac mini
Member
Author
There was a problem hiding this comment.
Yep, we're good. Updated all machines, so this is good to go.
45f50c1 to
2d969ed
Compare
Now with secrets being tied to each machine we need a dedicated profile for each machine.
2d969ed to
953ad2f
Compare
Member
Author
|
CI is from master, so it is expected to be stuck. I also updated the branch protection rules to the new job names. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Now with secrets being tied to each machine we need a dedicated profile for each machine.
Pulled out of #920