Conversation
booxter
commented
Feb 23, 2026
- Remove inputs-update target
- Define default make target to print available targets
- Untangle update script from make
- flake: add fleet-upgrade app for machine updates
- flake: expose pi-image package and drop make target
- formatter: keep trailing newline in Makefile
- make: remove switch convenience targets
- make: drop unused local build convenience targets
- make: remove bats convenience target
- docs: clarify local test commands
- make: clarify REMOTE support for darwin build target
- ci: build qemu attrs directly and drop make wrapper
- make: drop nixos-run-vm target
- ci: drop nixos-build-vm make target
- ci: use platform-specific home-manager build targets
- apps: make fleet-apply a dispatcher for deploy and home
- apps: add disko mode to fleet-apply and remove make target
- apps: add vm app and drop make local-vm target
- make: rename build targets and improve nixos host resolution
- apps: rename fleet app to fleet-deploy and simplify docs
- apps: add pinned get-local-builders app for make
There was a problem hiding this comment.
Pull request overview
This PR significantly refactors the repository's build and deployment infrastructure by removing most Makefile targets and replacing them with Nix flake apps. The Makefile is simplified to serve as a convenience wrapper for basic build commands, while more complex operations (fleet deployments, VM management, disk provisioning) are now implemented as proper flake apps. The update-machines.sh script is untangled from make dependencies and calls nix/nixos-rebuild commands directly.
Changes:
- Simplified Makefile to 4 core targets (nixos, darwin, linux-home, darwin-home) with automatic VM host resolution
- Added lib/fleet.nix with flake apps for fleet-deploy, vm, and get-local-builders
- Auto-generated homeConfigurations for all Darwin hosts from darwinHosts attribute set
- Updated CI workflow commands (but with critical bugs in target names)
- Configured mbake formatter to ensure trailing newlines in Makefile
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/update-machines.sh | Removed make target dependency, now directly calls nix-darwin/nixos-rebuild |
| lib/fleet.nix | New file implementing fleet-deploy (with --home and --disko modes), vm, and get-local-builders apps |
| flake.nix | Integrated fleet apps/packages, auto-generates homeConfigurations for Darwin hosts, updated formatter config |
| README.md | Updated documentation to reflect new flake app commands and simplified Makefile usage |
| Makefile | Streamlined to 4 build targets with smart host resolution; removed 20+ convenience targets |
| .github/workflows/build-targets.yml | Updated build commands to use new target names (but contains critical bugs) |
| .bake.toml | New configuration file for mbake formatter to ensure final newlines |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.github/workflows/build-targets.yml
Outdated
| { name: "beast (x86_64-linux)", cmd: "make nixos WHAT=beast", os: "ubuntu-latest" }, | ||
| { name: "srvarr (x86_64-linux)", cmd: "make nixos WHAT=prox-srvarrvm", os: "ubuntu-latest" }, | ||
| { name: "nixos vm builder1 (x86_64-linux)", cmd: "nix build .#nixosConfigurations.prox-builder1vm.config.system.build.vm -L --show-trace", os: "ubuntu-latest" }, | ||
| { name: "home-manager nv (x86_64-linux)", cmd: "make linux-home-build-target TARGET=nv USERNAME=ihrachyshka", os: "ubuntu-latest" }, |
There was a problem hiding this comment.
The make target linux-home-build-target does not exist in the new Makefile. Based on the Makefile changes, this should be linux-home (not linux-home-build-target).
| { name: "home-manager nv (x86_64-linux)", cmd: "make linux-home-build-target TARGET=nv USERNAME=ihrachyshka", os: "ubuntu-latest" }, | |
| { name: "home-manager nv (x86_64-linux)", cmd: "make linux-home TARGET=nv USERNAME=ihrachyshka", os: "ubuntu-latest" }, |
.github/workflows/build-targets.yml
Outdated
| { name: "srvarr (x86_64-linux)", cmd: "make nixos WHAT=prox-srvarrvm", os: "ubuntu-latest" }, | ||
| { name: "nixos vm builder1 (x86_64-linux)", cmd: "nix build .#nixosConfigurations.prox-builder1vm.config.system.build.vm -L --show-trace", os: "ubuntu-latest" }, | ||
| { name: "home-manager nv (x86_64-linux)", cmd: "make linux-home-build-target TARGET=nv USERNAME=ihrachyshka", os: "ubuntu-latest" }, | ||
| { name: "home-manager mair (aarch64-darwin)", cmd: "make darwin-home-build-target TARGET=mair USERNAME=ihrachyshka", os: "macos-26" }, |
There was a problem hiding this comment.
The make target darwin-home-build-target does not exist in the new Makefile. Based on the Makefile changes, this should be darwin-home (not darwin-home-build-target).
| { name: "home-manager mair (aarch64-darwin)", cmd: "make darwin-home-build-target TARGET=mair USERNAME=ihrachyshka", os: "macos-26" }, | |
| { name: "home-manager mair (aarch64-darwin)", cmd: "make darwin-home TARGET=mair USERNAME=ihrachyshka", os: "macos-26" }, |
.github/workflows/build-targets.yml
Outdated
| { name: "mair-ci (aarch64-darwin)", cmd: "make darwin-build-target WHAT=mair-ci", os: "macos-26" }, | ||
| { name: "mmini-ci (aarch64-darwin)", cmd: "make darwin-build-target WHAT=mmini-ci", os: "macos-26" }, | ||
| { name: "JGWXHWDL4X-ci (aarch64-darwin)", cmd: "make darwin-build-target WHAT=JGWXHWDL4X-ci", os: "macos-26" }, |
There was a problem hiding this comment.
The make target darwin-build-target does not exist in the new Makefile. Based on the Makefile changes, this should be darwin (not darwin-build-target).
| { name: "mair-ci (aarch64-darwin)", cmd: "make darwin-build-target WHAT=mair-ci", os: "macos-26" }, | |
| { name: "mmini-ci (aarch64-darwin)", cmd: "make darwin-build-target WHAT=mmini-ci", os: "macos-26" }, | |
| { name: "JGWXHWDL4X-ci (aarch64-darwin)", cmd: "make darwin-build-target WHAT=JGWXHWDL4X-ci", os: "macos-26" }, | |
| { name: "mair-ci (aarch64-darwin)", cmd: "make darwin WHAT=mair-ci", os: "macos-26" }, | |
| { name: "mmini-ci (aarch64-darwin)", cmd: "make darwin WHAT=mmini-ci", os: "macos-26" }, | |
| { name: "JGWXHWDL4X-ci (aarch64-darwin)", cmd: "make darwin WHAT=JGWXHWDL4X-ci", os: "macos-26" }, |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| os="$(uname -s)" | ||
| host_name="$(hostname)" | ||
| case "$os" in | ||
| Darwin) | ||
| sudo -H nix run nix-darwin -- switch --flake ".#${host_name}" -L --show-trace | ||
| ;; | ||
| Linux) | ||
| sudo nixos-rebuild switch --flake ".#${host_name}" -L --show-trace | ||
| ;; |
There was a problem hiding this comment.
host_name is derived from hostname (no -s/-f fallback), but flake configuration names commonly use the short hostname. If hostname returns an FQDN (or a value that doesn’t match the flake attr name), the --flake ".#${host_name}" lookup will fail. Consider matching the existing is_local_host logic (e.g., prefer hostname -s with a fallback) so the attribute name resolution is consistent and robust.
| basePackages = import ./pkgs inputs.nixpkgs.legacyPackages.${system}; | ||
| fleetPackages = { | ||
| pi-image = self.nixosConfigurations.pi5.config.system.build.sdImage; | ||
| }; | ||
| proxmox = import ./lib/proxmox-apps.nix { | ||
| inherit inputs system; | ||
| }; | ||
| in | ||
| basePackages | ||
| // proxmox.packages | ||
| // fleetPackages |
There was a problem hiding this comment.
pi-image is added to packages for every system, but the referenced derivation comes from self.nixosConfigurations.pi5 (likely aarch64-linux). This makes packages.<non-aarch64-linux>.pi-image point to a derivation for a different system, which is surprising for flake consumers and can break builds/evaluation in environments without appropriate remote builders. Prefer exposing pi-image only under the matching system (e.g., optionalAttrs (system == "aarch64-linux")) or otherwise structure it so packages.${system}.pi-image is buildable for that system.
|
|
||
| darwin-build-target: | ||
| $(call nix-config-action,.#darwinConfigurations.$(WHAT).system) | ||
| nix build $(call builder-opts) .#homeConfigurations.$(USERNAME)@$(TARGET).activationPackage $(ARGS) |
There was a problem hiding this comment.
This flake attribute path includes @ in the attribute name segment ($(USERNAME)@$(TARGET)), which is not a standard unquoted Nix identifier and is commonly represented as a quoted attribute (e.g., "user@profile" in nix flake show). To avoid selector parsing failures, quote/escape the $(USERNAME)@$(TARGET) segment when building homeConfigurations activation packages.
| nix build $(call builder-opts) .#homeConfigurations.$(USERNAME)@$(TARGET).activationPackage $(ARGS) | |
| nix build $(call builder-opts) ".#homeConfigurations.\"$(USERNAME)@$(TARGET)\".activationPackage" $(ARGS) |