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>
213: readme typo r=Pacman99 a=jackmac92
hopefully I can make a more meaningful contribution in the future, but this is all I got for now
Co-authored-by: Jack McCown <jackmac79@gmail.com>
212: lib/pathsIn: don't error if path doesn't exist r=Pacman99 a=Pacman99
Really simple, just don't error if path passed to pathsIn doesn't exist. This doesn't affect much, since the majority of folders in devos end up getting referenced in some way or another outside of a pathsIn call. But it will help for users of mkDevos, so they can safely delete folders they don't want to use.
Can test with current overlays folder in deovs, that only gets imported through a pathsIn call.
Co-authored-by: Pacman99 <pachum99@gmail.com>
To remove the opportunity for junk to enter into the changelog, and to
reduce the commit history, the changlog generation will only happen
on release, and only based on merged PRs.
Fixes#205
210: hosts: add cachix r=nrdxp a=Pacman99
fixes#208
I think it was dropped during #157. It used to be added to nixosModules, but I think its better added to hosts, I don't see a reason to export the cachix module as an output.
Co-authored-by: Pacman99 <pachum99@gmail.com>
156: Improve Home Manager support: profiles/suites, modules, extern, flake outputs r=Pacman99 a=Pacman99
A really simple method of implementing #119.
This relies on a feature that I added in home-manager master for module options of extraSpecialArgs and sharedModules, nix-community/home-manager#1793. I could try and get that backported to 20.09. But I thought I'd get some feedback on these changes first.
Co-authored-by: Pacman99 <pachum99@gmail.com>
192: flake: nixos -> nixos-unstable r=nrdxp a=nrdxp
20.09 is getting stale as we move toward a new release so track unstable for now.
Co-authored-by: Timothy DeHerrera <tim.deh@pm.me>
I originally wanted to use the nix flake to allow users to take
advantage of the latest changes. Just so happened that nixpkgs was
recently updated with a new version around the same time, and this
just adds complexity for no real gain.
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>
161: Multi-arch support for hosts(nixosConfigurations) r=nrdxp a=Pacman99
fixes#72
also related, #125
This allows users to set `nixpkgs.system` to any architecture exported by the nixpkgs flake and nixpkgs.pkgs will be set to that system.
I also added `multiPkgs` as a special arg and made `nixpkgs.pkgs` a default. So if someone wanted to do crossSystem builds or anything else with pkgs, that is also an option(eg. mobile-nixos!!).
Co-authored-by: Pacman99 <pachum99@gmail.com>
This is just for convenience, since the closuers are already in the
store. It might be helpful to be able to test out some things
of those deactivated profiles een on the iso isntaller.
IN order to avoid random startup of systemd services, filter out all
profiles, except for core and user profiles.
This works becasue of a fundamental devos contract, that modules
only define configuration, but don't implement them and profiles
only implement confguration but don't define them. So only ever an
activated profile is expected to effectively start up a systemd service.
closes: #194
This is required so that filtering via lib.remove works against
modules.core and similar which are of path type.
It is also a prerequisite for disabledModules to match by module.key
instead of path string relative to nixpkgs' modulePath.
198: hosts/devosSystem: pass modules as attrset r=nrdxp a=Pacman99
This is a fairly simple change that only changes the lib api for devosSystem. But doesn't add any features by itself. Hosts now pass modules to devosSystem as an attrset. And devosSystem just grabs all modules in the set and passes it to nixosSystem.
I plan to use this in #197 to selectively import modules. And I think it could help with nix-darwin - and other config systems - support, since not all profiles and modules are config system agnostic. This could be a workaround to add rudimentary support for other config systems by only importing the necessary modules.
Overall I think its a useful change and extends the abilities of `devosSystem`
Co-authored-by: Pacman99 <pachum99@gmail.com>