Hi Ludo, On Tue, 22 Oct 2019 14:24:51 +0200 Ludovic Courtès wrote: > I’m wondering if we could avoid clobbering the global profile with the > kernel and module packages, though (as is currently the case.) Sounds good. > > (define* (operating-system-profile os) > > "Return a derivation that builds the system profile of OS." > > (mlet* %store-monad > > - ((services -> (operating-system-services os)) > > - (profile (fold-services services > > - #:target-type profile-service-type))) > > + ((kernel -> (operating-system-kernel os)) > > + (services -> (operating-system-services os)) > > + (profile (cons kernel (fold-services services > > + #:target-type > > + profile-service-type)))) > > (match profile > > (("profile" profile) > > (return profile))))) > > The value of ‘profile’ above can never match this pattern, or am I > missing something? Ahhhhh! Now I see it. > Besides, I wonder how much is missing from (gnu build linux-modules) to > do this without resorting to kmod. :-) True :) > Maybe we should not add this hook by default, to avoid overhead for a > very unusual use case. The caller of ‘profile-derivation’ could add it > when needed. I think the eventual overhead of it is minimal because it can just check whether "lib/modules" is anywhere in the source and if not, skip everything. > Thinking more about it, what about handling the union/profile thing in > ‘operating-system-directory-base-entries’? We could still use > ‘profile-derivation’ with the hook you wrote, but we’d be able to keep > that here instead of adding it to (guix profiles). Should we just change out the "kernel" entry to be the union? After all, that's what actually happens at runtime as far as the Linux kernel is concerned. > Also, if we take that route, we would probably need a > ‘linux-module-packages’ field in . Or make the `kernel` field a list, including linux-libre ;-)