for clarity's sake, expose which function uses final and prev, so that
people can have a clearer understanding how they relate to each other
in terms of dependencies.
also a simple `{ lib = final; }` probably does not warrant a complete
callLibs obscurization.
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>
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>
217: lib/mkPkgs: don't import external files and get inputs as argument r=nrdxp a=Pacman99
Changes mkPkgs to take extern, overrides, and pkgs as an argument. This improves their ability to be used as lib functions.
Co-authored-by: Pacman99 <pachum99@gmail.com>
220: Drop flattenTreeSystem and use custom function for filtering packages r=nrdxp a=Pacman99
I don't think we should flatten the system because if a user doesn't make a package a derivation in pkgs/default.nix we should trust that there is a reason for doing so. So instead this drops the flattenTreeSystem reference(and switches to flake-utils master branch) and replaces its usage with a custom function `filterPackages`. This function filter all packages that match three conditions;
- is a derivation
- not broken
- system is supported
In that order as to not cause errors when trying to reference non-derivation meta attributes.
And then also just dump *all* packages into legacy packages, so everything else is still accessible. I was considering removing the packages that are already in the packages output in legacyPackages, but I don't think its necessary since nix looks to the packages output first.
Co-authored-by: Pacman99 <pachum99@gmail.com>
215: lib/pathsToImportedAttrs: discard string context in the names to prevent flake check error r=nrdxp a=Pacman99
So I learned about this myself while working on it. Nix has a thing called string context, where strings refer to various store paths that they used to contain. This is normally a good thing to guarantee purity, but flake outputs cannot contain store paths. So when `pathsToImportedAttrs` is passed a list of store paths, and is then used for a flake output, we get a very confusing error that the string refers to a store path - even though it doesn't look like it does!
I think its good to review this as a separate Pr, since it requires calling an unsafe nix builtin.
Co-authored-by: Pacman99 <pachum99@gmail.com>
211: home-manager fixes r=nrdxp a=nrdxp
- [x] integrate nix-community/home-manager#1880 (to avoid duplicate commits, we'll wait a bit to see if this gets merged)
- [x] don't use all of `systemPackages` for `flk home`
- [x] test home-manager `activationPackage` and `flk home` as part of CI
Co-authored-by: Timothy DeHerrera <tim.deh@pm.me>
219: lib/mkPkgs: reorder overlays to get access to devos lib(dev) r=nrdxp a=Pacman99
nixpkgs applies overlays in the order given. This PR moves the lib extension overlay to be first so all subsequent overlays can access `dev` which is the devos lib.
Co-authored-by: Pacman99 <pachum99@gmail.com>
202: iso: avoid systemd service startup r=nrdxp a=blaggacao
fixes#194
alternative to #197
# Manual Tests
<details>
<summary>was unrelated</summary>
- [ ] `flk install NixOS --impure` correctly onto `/mnt` ❎ (looks like no profile is present)
Issue: https://github.com/divnix/devos/issues/204
Upstream Issue: https://github.com/NixOS/nixpkgs/issues/116938
</details>
- [x] acceptable build time / closure size ca 850MB (for a simple base OS) ✔️
- [x] local profile with `cage` service is disabled, that is: boots into terminal ✔️
- [x] success: air gapped / offline devshell enter ✔️
- [ ] failure: aire gapped target install: ← non blocking bonus item ❎
```console
$ flk install POS
warning: you don't have internet access; disabling some network-dependent features
building the flake in path:/iso/devos?narHash=sha265-...
warning: you don't have internet access; disabling some network-dependent features
error: unable to download 'https://api.github.com/repos/NixOS/nixpkgs/df8e3...': Couldn't resolve host name (6)
```
→ detailed rationale in the commit messages
❤️ @Pacman99 for the excellent and detailed discussions in #197 and the may ideas, suggestions and code.
Co-authored-by: David Arnold <dar@xoe.solutions>