
Creating and using a custom Linux kernel on Guix System - kgwxd
https://www.gnu.org/software/guix/blog/2019/creating-and-using-a-custom-linux-kernel-on-guix-system/
======
georgyo
Since the technologies are so closely related, it's worth it to also look at
the nixos equivalent.

[https://nixos.wiki/wiki/Linux_kernel](https://nixos.wiki/wiki/Linux_kernel)

~~~
jchw
NixOS is great here. I like how easy it is to just specify patches.

------
raehik
Perfect, exactly what I needed. Trying to make the switch to Guix from Arch
Linux but my hardware is hopelessly unsupported. There's a guix-nonfree repo
out there but I couldn't get wrap my head around the config (new to Scheme).
Guix looks really, really cool.

~~~
neilv
They could make it look slightly more friendly, with little things like
reducing unnecessary punctuation characters. For example, this:

    
    
      (make-linux-libre
       %linux-libre-version
       %linux-libre-hash
       '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
       #:patches %linux-libre-5.1-patches
       #:configuration-file kernel-config)
    

Could be this:

    
    
      (make-linux-libre
       :version      linux-libre-version
       :hash         linux-libre-hash
       :list         (list "x86_64-linux"
                           "i686-linux"
                           "armhf-linux"
                           "aarch64-linux")
       :patches      linux-libre-5-1-patches
       :config-file  kernel-config)
    

Then it's easier to see that the semantics is actually familiar to you: it's
just a call of function `make-linux-libre` with keyword arguments like
`:version`.

Minus characters are parts of identifiers (like underscores in many other
languages), parentheses delimit lists of things, and the first identifier in
parentheses list is usually either a function name or a macro name.

If you want to invest half an hour into being able to read most Scheme code,
you could skim the old R5RS paper, and skip the parts on first-class
continuations, formal semantics, and `do`.
[https://schemers.org/Documents/Standards/R5RS/](https://schemers.org/Documents/Standards/R5RS/)

On your first skim, also don't spend much time trying to understand R5RS
`syntax-rules` -- it's neat, and worth learning someday, but there are now
much more powerful and easier ways to extend syntax, especially in Racket.

~~~
sriram_sun
Thanks. Your revised syntax looks so much cleaner. I'm interested in learning
Guix because I was hoping the syntax would be cleaner than Nix's. From a dev
ops perspective Nix/Guix is the way to go. To me, the syntax plays a great
part in coming up to speed and trying new stuff without going back to the
manual.

My understanding is that Guix is 7 years in the making (at least) so is there
even a remote possibility that syntax revisions like the one above will be
considered?

~~~
neilv
I don't know anything about Guix itself yet, but you could ask the developers.

Scheme is great as an imperative (or declarative) configuration language,
because the language is super-powerful, yet small and elegant. So many
configuration languages end up being ad-hoc.

