Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to bootstrap a system with as much of it being written via NiJS? #3

Open
trusktr opened this issue Jan 10, 2020 · 0 comments
Open

Comments

@trusktr
Copy link

trusktr commented Jan 10, 2020

Over at #1 (comment), you wrote

This resulting expression could be used by nixos-rebuild to construct a system configuration.

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):

  • make partitions and needed filesystems on the target disk of the laptop
  • Run curl https://nixos.org/nix/install | sh to get the nix tool
  • Run sudo which nixos-generate-config --root /mnt to add NixOS basic config onto the target disk

Now this part, I'm not completely sure about:

  • Update /mnt/etc/nixos/configuration.nix so that it will install Node.js and npm.
  • Place the .js file on the system. (f.e. /mnt/etc/nixos/configuration.js).
  • sudo PATH="$PATH" NIX_PATH="$NIX_PATH" which nixos-install --root /mnt
  • 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?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant