# Rebuild NixOS Offline

**URL:** https://discourse.nixos.org/t/rebuild-nixos-offline/3679
**Category:** Uncategorized
**Created:** [August 10, 2019, 9:45pm UTC](https://discourse.nixos.org/t/rebuild-nixos-offline/3679 "2019-08-10T21:45:14Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![qyliss](https://discourse.nixos.org/user_avatar/discourse.nixos.org/qyliss/32/34285_2.png) [@qyliss](https://discourse.nixos.org/u/qyliss)
#### Post date: [September 16, 2019, 11:16pm UTC](https://discourse.nixos.org/t/rebuild-nixos-offline/3679/4 "2019-09-16T23:16:21Z")

</div>

> I use `/etc/nixos/configuration.nix` to mange my networks. The problem  
> I have run into is that to connect to a new network after I add it to  
> `/etc/nixos/configuration.nix`, I have to run `nixos-rebuild switch`,  
> but this requires a network connection to run properly. Is there a way  
> to rebuild nixos offine?

If I understand correctly, then I think you want

```
nixos-rebuild switch --option substitute false

```

This will stop it trying to look up what paths are available on a  
substituter, which should allow it to rebuild without an internet  
connection as long as you have all of the dependencies and stuff.

---

_[View the full topic](https://discourse.nixos.org/t/rebuild-nixos-offline/3679)._
