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

add nix flake #25

Merged
merged 19 commits into from
Mar 29, 2023
Merged

add nix flake #25

merged 19 commits into from
Mar 29, 2023

Conversation

getchoo
Copy link
Contributor

@getchoo getchoo commented Mar 26, 2023

so this does a few swag things

devshell

this lets you use nix while not breaking your workflow, and also giving people an easier way to start contributing. you can install nix-direnv, cd into the repository, and make and nim (or whatever else we use in the future) will be there ready for you to use

packaging everything in nix

this isn't really about people using nix to install kpkg and other tools, but moreso using it as a development tool. by having our builds controlled by nix, we can get a lot of flexibility and easy, cool features to mess with

ez cross compliation

speaking of cool features we can mess with, cross compiling all tools in this repository is now really easy! currently, only x64 -> aarch64 is supported -- but with a lot of the infrastructure nix already has, this can easily be scaled up to other architectures like ppc64le, i386, risc-v, maybe even mips and android. all it takes is one command: nix build .#<architecture>.<package>

static builds

yes...these are a work in progress and a part of the reason this is a draft. static builds can be compiled for all architectures and when cross compiling, but they don't work due to an issue with libcrypt.so. if it's possible to fix, this would be a great way to provide users with the opportunity to easily test in-development builds of the tools, or even just as a recovery option in case their installation gets messed up

compatibility with legacy nix tools

tools like nix-build and nix-shell will still work with this flake, for those who aren't interested in flakes and aren't enabled. everything is automated and "just works" so we don't really have to worry about upkeep, it just makes things easier for others

workflow changes

build.yml is the first workflow to start using nix, where building, distributing, and testing can all take place with only the nix command (reproducibly ofc). this doesn't really make any changes, to the way it works, it only gives us the ability to work in the same environment as the ci (so no more "why is it working on my machine but not in ci???" issues :trollface:)

it'd be cool imo to expand this nix integration to other workflows and maybe even the builder container image...but i want feedback before i go further down the deep end



oh and almost forgot: if you merge, this badge can go in the readme so it's instantly cool

built with nix

@getchoo
Copy link
Contributor Author

getchoo commented Mar 26, 2023

ignore the ci just look at my cool artifacts

@kreatoo
Copy link
Member

kreatoo commented Mar 26, 2023

lgtm

@getchoo getchoo force-pushed the add-flake branch 5 times, most recently from c9db516 to 3e049dd Compare March 29, 2023 03:07
@getchoo getchoo marked this pull request as ready for review March 29, 2023 08:30
@getchoo
Copy link
Contributor Author

getchoo commented Mar 29, 2023

might do a bit of clean up, but this is pretty much ready now

@getchoo
Copy link
Contributor Author

getchoo commented Mar 29, 2023

alright good to go. i can add more stuff later on like generating rootfs' through the flake -- but with this being merged, CI won't be 2 hours ago long and it'll be easier for me to test stuff :trollface:

@kreatoo kreatoo merged commit efe42a0 into kreatolinux:master Mar 29, 2023
@getchoo getchoo deleted the add-flake branch April 10, 2023 22:11
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

Successfully merging this pull request may close these issues.

2 participants