Situation_1:
computer connected to the internet.
Used for configuring and updating the device with the latest flake config.
networking.useDHCP = false;
networking.defaultGateway = "192.168.1.1";
networking.nameservers = [ "192.168.1.1" ];
networking.interfaces."enp2s0f0".ipv4.addresses = [
{
address = "192.168.1.121";
prefixLength = 24;
}
];
Situation_2:
computer, poe switch, ipcameras, no internet access
Used in “production”
networking.useDHCP = false;
networking.interfaces."enp2s0f0".ipv4.addresses = [
{
# Our ipcamera subnet: 172.17.246.0/24
address = "172.17.246.10";
prefixLength = 24;
}
];
If I had 2 physical interfaces they both work at the same time. But the rpi4(which will eventually run this config) has only 1.
I could:
- Test/run “Offline-configuration”
- Rollback to the “Internet configuration”
sudo nixos-rebuild switch --rollback
- Remove all but current-internet-config
sudo nix-collect-garbage -d
- Deploy the new configuration
sudo nixos-rebuild switch --flake ".#"
Is there a way to nixos-rebuild switch
without internet access? It’s only to change the network settings. Nothing new gets installed.