17 ms·
I agree with ngruhn that the integration of Nix with my entire development environment is much more seamless then docker images. I think what chriswarbo is gett
by megaloblasto 3y ago
I agree with ngruhn that the integration of Nix with my entire development environment is much more seamless then docker images. I think what chriswarbo is getting at is that docker and Nix often have very different use cases.
In my case, I have a few different computers, and I declare all of their environments with NixOS in the same directory. Then I use syncthing so that all the builds are automatically updated and in sync. This means that I can develop something on my desktop, and open up my laptop and run it without configuring anything. If it works on my desktop, it works on my laptop and vise-versa.
- pxc 3y agoHow do you use syncthing for Nix builds? Do you sync your Nix code and have something watch the Nix code and rebuild in the background?
- megaloblasto 3y agoI do not, although that would be cool. If I make changes to my nixos config I just type "rebuild" in the terminal on which ever computer was affected. I have "rebuild" aliased to "sudo nixos-rebuild switch --flake /home/user/nixos/#machine_name" on each machine. For example, I make a development environment on my desktop using a flake.nix file and a .envrc file in directory. I type direnv allow in that directory (actually all this is done with a script I wrote so I can just type "dev-env" in the terminal in the corresponding directory". Then open my laptop, syncthing makes it so the entire environment and all the files are already on my laptop. I type "direnv allow" in the directory in my laptop, and then "rebuild" if the NixOS configuration was changed. Then I can run the software that I wrote on the desktop.