Once booted into the new system, run the .js file with Node, which will use NiJS to create an expression of further packages and configs, and which will finally call nix-rebuild with the expression. Or have it use nix-env to augment anything that is already in configuration.nix? Or maybe the configuration.nix can itself specify how to run the .js file so that it all happens in one go? Or, maybe the system from which I'm running nixos-install would run the JS?
Over at https://github.com/svanderburg/nijs/issues/1#issuecomment-50475846, you wrote
How would one go about bootstrapping a system (say a laptop) and using NiJS code as much as possible?
I'm new to NixOS in general, but it seems like it would be these steps basically (please correct them if needed):
curl https://nixos.org/nix/install | sh
to get the nix toolsudo
which nixos-generate-config--root /mnt
to add NixOS basic config onto the target diskNow this part, I'm not completely sure about:
/mnt/etc/nixos/configuration.nix
so that it will install Node.js and npm..js
file on the system. (f.e./mnt/etc/nixos/configuration.js
).sudo PATH="$PATH" NIX_PATH="$NIX_PATH"
which nixos-install--root /mnt
.js
file with Node, which will use NiJS to create an expression of further packages and configs, and which will finally callnix-rebuild
with the expression. Or have it usenix-env
to augment anything that is already inconfiguration.nix
? Or maybe theconfiguration.nix
can itself specify how to run the.js
file so that it all happens in one go? Or, maybe the system from which I'm running nixos-install would run the JS?