Open chewblacka opened 3 months ago
Thanks very much for this, its quite educational for me.
I wont merge this however as I do have concerns this is too much of a divergence from the main purpose of this repo. I will try to explain...
The main points of this repo are:
If introducing NIX, we effectively alter the all of the above and switch the focus away from explaining the OWRT image builder workflow in plain text to only a NIX based outcome. The extra NIX complexity may perhaps gain the avoidance of the use of sudo for the make image
command - which I've now addressed with just a few line changes in bash.
This is an elegant solution for sure, but a likely more complex solution than is needed in this context. I thank you for this again and I will keep your PR here for others to find and also learn from.
Hi just creating a pull request. Have refactored the code to install dependencies using
nix
package manager. These are the new files:install.sh
- installs the dependencies ( and thenix
package manager if not already on the system).uninstall.sh
- uninstalls nixpackages.txt
- contains list of packages any built image will containtarget.txt
- contains the target to build (x86 by default)installer_files
- directory containing installation files, including:x86-imagebuilder.sh
- a slightly modified version of your scriptflake.nix
- this is the nix expression which is used to install the required dependencies (line 9), and copy the x86-imagebuilder.sh to the nix-store (i.e./nix/store/...
) where theinstall.sh
symlinks it tobuildimage
.Features:
install.sh
requires sudo permissions. After that everything runs withoutsudo
(OpenWRT recommend that the image builder doesn't run under sudo).packages.txt
filetarget.txt
.gitignore
file to ignore all files and track only the files in the current repo. This way you can clone the repo, build stuff in it, and still push back to git.Hope it's ok. Let me know if any issues! Many thanks