236: init pkgs-lib and add tests and shell r=nrdxp a=Pacman99
Towards the goal of removing top level folders and putting more things in lib. This shifts shell and tests to lib under the `pkgs-lib` namespace. This namespace is separated by architecture, because those lib functions rely on nixpkgs architecture specific derivations. I think this is the cleanest way to do it, you don't have to instantiate pkgs-lib for each arch, and it exposes some of these functions for others to use.
This PR also fixes multi-arch checks.
Co-authored-by: Pacman99 <pachum99@gmail.com>
227: Fix documentation mistake after project rename r=nrdxp a=lycheese
After the project rename the cachix documentation in `cachix/README.md` contains instructions that do not work (`cachix use divnix`).
Tested that `cachix use nrdxp` works and should have the intended effect.
Co-authored-by: lycheese <4779944-lycheese@users.noreply.gitlab.com>
233: core: add usbutils r=nrdxp a=blaggacao
Looks like core does not include `lsusb` by default, now it does.
Co-authored-by: David Arnold <dar@xoe.solutions>
231: Move flake implementation logic to lib r=nrdxp a=Pacman99
This is a simpler version of #218 that moves flake logic to lib and adds a module to evaluate devos. This DOES NOT support out of tree usage, so if you were following any of the previous PR's, the doc sections/examples to use devos as a library will not work. There is work to make a cleaner api and only then will out of tree support work. Until then, this is still useful to simplify devos and clean up a lot of the implementation logic.
Co-authored-by: Pacman99 <pachum99@gmail.com>
229: make core an unecessary profile and add to suites r=nrdxp a=Pacman99
Prevents mkHosts subverting standard devos api to import core and add
all necessary core features to mkHosts, so core can be safely deleted in
suites
Co-authored-by: Pacman99 <pachum99@gmail.com>
225: lib: only readDir if path exists with safeReadDir r=nrdxp a=Pacman99
After doing this for the second time, I realized it might be good to make a lib function for it and do it across lib.
Create a function called `safeReadDir` that only uses `builtins.readDir` if the path exists. With `optionalAttrs` any function that relies on the output won't fail since they still get an empty attrset.
Then replace all uses of `readDir` with the safe version.
Co-authored-by: Pacman99 <pachum99@gmail.com>
224: Allow for directories in module-list r=nrdxp a=Pacman99
fixes#221
building on #222 this PR improves the lib functions pathsToImportedAttrs and pathsIn. First to add support for directories. This does not support actually passing a file in a directory, so `./matrix/default.nix` won't work but `./matrix` will - I should probably document this somewhere.
Also I moved the filtering for nix files to `pathsIn`, since its only necessary for auto-import. We can assume that users would pass proper files in `module-list.nix`.
Co-authored-by: Pacman99 <pachum99@gmail.com>
216: Move host and suite implementation logic to lib r=nrdxp a=Pacman99
This is just the `mkSuites` and `mkHosts` part of the `mkDevos` PR. I would like to avoid changing mkSuites and mkHosts api, to make it easier to rebase changes into the mkDevos branch. But if necessary we can change them. And to that end, there is some more logic added to the flake.nix now which would ideally not be there if devos was meant to be a template. But since the goal is to move towards a lib function with template, this is just a step in that direction.
Co-authored-by: Pacman99 <pachum99@gmail.com>