-
-
Notifications
You must be signed in to change notification settings - Fork 129
macs: create individual darwin configurations for each machine #925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| 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} | /") & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assumption here is that, same as on NixOS, they'll fall back to a darwin configuration based on their hostname. Is that correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
CI is from master, so it is expected to be stuck. I also updated the branch protection rules to the new job names. |
Now with secrets being tied to each machine we need a dedicated profile for each machine.
Pulled out of #920