Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
- uses: actions/checkout@v6
- uses: DeterminateSystems/nix-installer-action@main
- name: Build nix-darwin configuration
run: make macos-build
run: make build
2 changes: 1 addition & 1 deletion .github/workflows/nixos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
- uses: actions/checkout@v6
- uses: DeterminateSystems/nix-installer-action@main
- name: Build NixOS configuration
run: make nixos-build
run: make build
63 changes: 29 additions & 34 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,48 +1,43 @@
.PHONY: macos-build macos-switch macos-brew-install macos-brew macos-brew-gui macos-brew-optional macos-brew-himkt macos-update macos-clean macos-gc nixos-build nixos-switch nixos-update nixos-clean nixos-gc
UNAME := $(shell uname -s)

# macOS targets
macos-build:
nix build .#darwinConfigurations.macos.system
ifeq ($(UNAME),Darwin)
NIX_BUILD_CMD := nix build .\#darwinConfigurations.macos.system
NIX_SWITCH_CMD := sudo darwin-rebuild switch --flake .\#macos
else
NIX_BUILD_CMD := nix build .\#nixosConfigurations.nixos.config.system.build.toplevel
NIX_SWITCH_CMD := sudo nixos-rebuild switch --flake .\#nixos
Comment on lines +4 to +8
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hash character in the flake references is escaped with a backslash (e.g., .\#darwinConfigurations.macos.system), but the original working Makefile used unescaped hashes (.#darwinConfigurations.macos.system). In Makefile recipe lines (commands after tabs), the hash character is typically passed literally to the shell and does not start a comment, so the backslash escaping may be unnecessary and could potentially cause the command to fail. Verify that these commands work correctly with the escaped syntax, or revert to the unescaped syntax that was previously working.

Copilot uses AI. Check for mistakes.
endif

macos-switch:
sudo darwin-rebuild switch --flake .#macos
.PHONY: build switch update clean gc brew-install brew brew-gui brew-optional brew-himkt

macos-brew-install:
$(PWD)/brew/bin/setup.sh
# Nix targets (platform-aware)
build:
$(NIX_BUILD_CMD)
Comment on lines +14 to +15
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new unified build target breaks existing CI workflows. The GitHub Actions workflows at .github/workflows/macos.yml (line 14) and .github/workflows/nixos.yml (line 14) still reference the old target names macos-build and nixos-build respectively. These files need to be updated to use the new build target, otherwise the CI will fail after this change is merged.

Copilot uses AI. Check for mistakes.
Comment on lines +14 to +15
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README.md documentation is now outdated. It still documents the old target names (macos-build, macos-switch, macos-brew, macos-brew-gui, nixos-build, nixos-switch, etc.) in the Setup section (lines 33-47) and Makefile Targets table (lines 51-67). These need to be updated to reflect the new platform-aware target names (build, switch, brew, brew-gui, etc.) to avoid user confusion.

Copilot uses AI. Check for mistakes.

macos-brew:
brew bundle --verbose --file=$(PWD)/brew/config.d/base/Brewfile
switch:
$(NIX_SWITCH_CMD)

macos-brew-gui:
brew bundle --verbose --file=$(PWD)/brew/config.d/gui/Brewfile

macos-brew-optional:
brew bundle --verbose --file=$(PWD)/brew/config.d/optional/Brewfile

macos-brew-himkt:
brew bundle --verbose --file=$(PWD)/brew/config.d/himkt/Brewfile

macos-update:
update:
nix flake update

macos-clean:
sudo nix-env --delete-generations +7 --profile /nix/var/nix/profiles/system-profiles/darwin
clean:
sudo nix-env --delete-generations +7 --profile /nix/var/nix/profiles/system
Comment on lines +23 to +24
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The clean target now uses a unified profile path that is incorrect for macOS. On macOS (Darwin), the profile path should be /nix/var/nix/profiles/system-profiles/darwin as in the original macos-clean target, not /nix/var/nix/profiles/system. This will cause the clean operation to fail or target the wrong profile on macOS systems. Consider adding platform-specific logic similar to the build and switch commands.

Copilot uses AI. Check for mistakes.

macos-gc:
gc:
sudo nix-collect-garbage -d

# NixOS targets
nixos-build:
nix build .#nixosConfigurations.nixos.config.system.build.toplevel
# Homebrew targets (macOS only)
brew-install:
$(PWD)/brew/bin/setup.sh

nixos-switch:
sudo nixos-rebuild switch --flake .#nixos
brew:
brew bundle --verbose --file=$(PWD)/brew/config.d/base/Brewfile

nixos-update:
nix flake update
brew-gui:
brew bundle --verbose --file=$(PWD)/brew/config.d/gui/Brewfile

nixos-clean:
sudo nix-env --delete-generations +7 --profile /nix/var/nix/profiles/system
brew-optional:
brew bundle --verbose --file=$(PWD)/brew/config.d/optional/Brewfile

nixos-gc:
sudo nix-collect-garbage -d
brew-himkt:
brew bundle --verbose --file=$(PWD)/brew/config.d/himkt/Brewfile
Comment on lines +30 to +43
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The brew targets are labeled as "macOS only" but lack platform guards. When these targets are run on non-macOS systems, they will fail because the brew command and Brewfiles are not available. Consider adding conditional checks or making these targets conditional based on the detected platform, similar to how NIX_BUILD_CMD and NIX_SWITCH_CMD are set conditionally.

Copilot uses AI. Check for mistakes.