{"slug": "nixos-rebuild", "name": "nixos-rebuild", "category": "infra", "category_name": "Infrastructure and DevOps", "description": "", "recommenders": 3, "commenters": 3, "warners": 0, "score": 2.711, "rising": 0.35, "first": "2026-01-31", "latest": "2026-08-03", "why": "nixos-rebuild with `--target-host` is also working well for us however", "why_is_quote": true, "has_verdict": false, "sentiment": {"recommend": 3, "neutral": 0, "compare": 0, "warn": 0}, "spark": [0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0], "listed": true, "loved": [], "caveat": "", "short_quote": "nixos-rebuild with `--target-host` is also working well for us however", "icon": false, "domain": null, "github_repo": null, "official_url": "", "pricing": "", "aliases": ["nixos-rebuild"], "verdict": null, "praise": [{"label": "", "summary": "", "quotes": [{"id": 786509184, "item_id": 49156824, "url": "https://news.ycombinator.com/item?id=49156824", "by": "diarrhea", "date": "2026-08-03", "stance": "recommend", "quote": "nix run nixpkgs#nixos-rebuild -- switch", "excerpt": "The Make target I use to deploy in this manner (MacBook to x86-64, single machine) is simply: server: @echo \"Deploying machine (with ssh-agent forwarding): '$(MACHINE)'\" NIX_SSHOPTS=\"-A\" \\ nix run nixpkgs#nixos-rebuild -- switch \\ --flake .#$(MACHINE) \\ --target-host $(MACHINE).$(DOMAIN) \\ --build-host $(MACHINE).$(DOMAIN) \\ --no-reexec \\ --verbose \\ --sudo Which has been working well. I admit I do not understand wha", "context": "deploys from a MacBook to an x86-64 server", "use_case": "deploying NixOS from MacBook to x86-64", "switched_from": "", "story": "Show HN: NixOS-DGX-Spark \u2013 Nix and NixOS on the DGX Spark"}, {"id": 779578866, "item_id": 48723679, "url": "https://news.ycombinator.com/item?id=48723679", "by": "rhco", "date": "2026-06-29", "stance": "recommend", "quote": "the regular nixos-rebuild command supports deploying over SSH. It's nice", "excerpt": "You could take this one step further using Syncthing to sync important data between the workstation and laptop. That's how my devices are configured, and it's amazing - if I need to travel for work, I just pick up my laptop and go. NixOS makes sure the system itself is identical (apps, most of the code configs, etc), then any app-spcific config is handled by Syncthing. It was really magical the first few times I used", "context": "", "use_case": "remote builds and deployments", "switched_from": "", "story": "NixOS 26.05 Released"}, {"id": 749465029, "item_id": 46841564, "url": "https://news.ycombinator.com/item?id=46841564", "by": "c0balt", "date": "2026-01-31", "stance": "recommend", "quote": "nixos-rebuild with `--target-host` is also working well for us however", "excerpt": "I would strongly recommend sops-nix[0]. Pair this with ssh-to-age/ssh-to-gpg for the keys for each server. We are using this at $work for multiple servers, one notable advantages is that it works in teams (for multiple people) and git (and also gitops). For remote installations nixos-anywhere is great. deploy-rs or colemna is fine, nixos-rebuild with `--target-host` is also working well for us however. [0]: https://g", "context": "", "use_case": "NixOS remote deployment", "switched_from": "", "story": "Guix System First Impressions as a Nix User"}]}], "caveats": [], "who": [{"by": "diarrhea", "context": "deploys from a MacBook to an x86-64 server", "url": "https://news.ycombinator.com/item?id=49156824", "date": "2026-08-03"}], "tags": [], "use_cases": ["deploying nixos from macbook to x86-64", "remote builds and deployments", "nixos remote deployment"], "compared": [], "makers": [], "threads": [{"url": "https://news.ycombinator.com/item?id=49146267", "title": "Show HN: NixOS-DGX-Spark \u2013 Nix and NixOS on the DGX Spark", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=48718753", "title": "NixOS 26.05 Released", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=46835612", "title": "Guix System First Impressions as a Nix User", "mentions": 1}], "sentiment_by_month": {"2025-11": {}, "2025-12": {}, "2026-01": {"recommend": 1}, "2026-02": {}, "2026-03": {}, "2026-04": {}, "2026-05": {}, "2026-06": {"recommend": 1}, "2026-07": {}, "2026-08": {"recommend": 1}, "2026-09": {}, "2026-10": {}}, "quotes": [{"id": 786509184, "item_id": 49156824, "url": "https://news.ycombinator.com/item?id=49156824", "by": "diarrhea", "date": "2026-08-03", "stance": "recommend", "quote": "nix run nixpkgs#nixos-rebuild -- switch", "excerpt": "The Make target I use to deploy in this manner (MacBook to x86-64, single machine) is simply: server: @echo \"Deploying machine (with ssh-agent forwarding): '$(MACHINE)'\" NIX_SSHOPTS=\"-A\" \\ nix run nixpkgs#nixos-rebuild -- switch \\ --flake .#$(MACHINE) \\ --target-host $(MACHINE).$(DOMAIN) \\ --build-host $(MACHINE).$(DOMAIN) \\ --no-reexec \\ --verbose \\ --sudo Which has been working well. I admit I do not understand wha", "context": "deploys from a MacBook to an x86-64 server", "use_case": "deploying NixOS from MacBook to x86-64", "switched_from": "", "story": "Show HN: NixOS-DGX-Spark \u2013 Nix and NixOS on the DGX Spark"}, {"id": 779578866, "item_id": 48723679, "url": "https://news.ycombinator.com/item?id=48723679", "by": "rhco", "date": "2026-06-29", "stance": "recommend", "quote": "the regular nixos-rebuild command supports deploying over SSH. It's nice", "excerpt": "You could take this one step further using Syncthing to sync important data between the workstation and laptop. That's how my devices are configured, and it's amazing - if I need to travel for work, I just pick up my laptop and go. NixOS makes sure the system itself is identical (apps, most of the code configs, etc), then any app-spcific config is handled by Syncthing. It was really magical the first few times I used", "context": "", "use_case": "remote builds and deployments", "switched_from": "", "story": "NixOS 26.05 Released"}, {"id": 749465029, "item_id": 46841564, "url": "https://news.ycombinator.com/item?id=46841564", "by": "c0balt", "date": "2026-01-31", "stance": "recommend", "quote": "nixos-rebuild with `--target-host` is also working well for us however", "excerpt": "I would strongly recommend sops-nix[0]. Pair this with ssh-to-age/ssh-to-gpg for the keys for each server. We are using this at $work for multiple servers, one notable advantages is that it works in teams (for multiple people) and git (and also gitops). For remote installations nixos-anywhere is great. deploy-rs or colemna is fine, nixos-rebuild with `--target-host` is also working well for us however. [0]: https://g", "context": "", "use_case": "NixOS remote deployment", "switched_from": "", "story": "Guix System First Impressions as a Nix User"}]}