grahamc / packet-nixos

The images used by Packet.net's deployment process.
MIT License
35 stars 10 forks source link

Allow shell script in addition to nix file via userdata for bootstrapping #14

Closed colemickens closed 4 years ago

colemickens commented 6 years ago

Hello. I am currently needing to checkout a custom branch of nixpkgs and use it when rebuilding/switching the machine configuration.

Currently I'm doing this with a nix script that create a one-shot systemd unit. That unit immediately executes, clones my nixcfg/nixpkgs repos, sets NIX_PATH and then nixos-rebuild boots.

This is fine, but not ideal. Getting the wrapper nix was not as trivial as I'd hoped and it's a bit crufty to keep around when it seems like a shell script would be simpler.

colemickens commented 6 years ago

An easier way to accomplish my goal would be if you ran nixos-install twice effectively.

That way my userdata could just contain my cachix caches and nix.{buildCores,nixPath} and I could point at a custom nixpkgs revision, etc, and the second install or switch would be using the new effective nixPath.