Skip to content

Conversation

@mweinelt
Copy link
Member

@mweinelt mweinelt commented Dec 22, 2025

Now with secrets being tied to each machine we need a dedicated profile for each machine.

Pulled out of #920

@mweinelt mweinelt requested a review from a team as a code owner December 22, 2025 21:27
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} | /") &
Copy link
Member Author

@mweinelt mweinelt Dec 22, 2025

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?

Copy link
Member Author

@mweinelt mweinelt Dec 22, 2025

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.

Copy link
Member Author

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

Copy link
Member

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

Copy link
Member Author

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

Copy link
Member Author

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.

Now with secrets being tied to each machine we need a dedicated profile
for each machine.
@mweinelt
Copy link
Member Author

mweinelt commented Dec 22, 2025

CI is from master, so it is expected to be stuck. I also updated the branch protection rules to the new job names.

@mweinelt mweinelt merged commit 7d111b9 into main Dec 22, 2025
16 checks passed
@mweinelt mweinelt deleted the darwin-per-machine branch December 22, 2025 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants