dotfiles/guix-profile.org

164 lines
8.2 KiB
Org Mode

I don't know where to put this file. It's meant to pull everything together by making sure that the right software is installed on my system. It's not really a configuration file like the others, and yet it also kind-of is.
First off I must import some modules to that the right functions are available to me to define my profile.
#+begin_src scheme :tangle guix-manifest.scm
(use-modules
(guix transformations)
(guix packages))
#+end_src
These imports provide me the functions =package->manifest=, =options->transformations=, etc.
First I define a function to allow me to specify that I want to use the git master version of a package, not the latest stable release. Usually I don't want this, but with some programs I like to live on the edge, and others might do a /lot/ of work before they release anything. BTW I run Guix on Arch, I like being on the bleeding edge.
#+begin_src scheme :tangle guix-manifest.scm
(define (with-master-branch package)
"Apply a transformation to PACKAGE so that it uses the master branch."
((options->transformation
`((with-branch . ,(string-append (package-name package) "=master"))))
package))
#+end_src
This function will take any package definition (from =specification->package=) and returns a new package definition that specifies to use the “master” branch. It's like calling =guix install --with-branch=master PKG=.
I define packages through this file as I need them, so here is just the setup to collect them all and create a manifest from them.
#+begin_src scheme :noweb yes :tangle guix-manifest.scm
(packages->manifest
(list
<<guix-packages>>))
#+end_src
This just expects a flat list of package definitions and it will turn them into manifest. This needs to be the last part of the file so that it returns that package manifest and =guix package --manifest FILE= understands what the contents of the manifest are. The ~<<guix-packages>>~ reference there is a [[https://www.cs.tufts.edu/~nr/noweb/][Noweb]] marker, it lets me specify other code blocks with a =:noweb-ref guix-packages= header argument that will make them get added here when they're tangled. This code block itself also needs a header argument for this to work: =:noweb yes=. This is all cool [[https://www.orgmode.org/][Org Mode]] magic.
Always the first thing I install is [[https://www.gnu.org/software/emacs/][Emacs]]. As long as I have that anything else is bearable. On my main machine I like using the very latest from git. For one I want the latest features, and for another I want the challenge of finding out what is wrong when something breaks, in the hopes of finding and fixing bugs. Alas so far it's generally been pretty stable and I've had no reason to get involved with anything.
#+begin_src scheme :noweb-ref guix-packages
(with-master-branch (specification->package "emacs-next"))
#+end_src
I use these two fonts generally in my configurations.
#+begin_src scheme :noweb-ref guix-packages
(specification->package "font-fantasque-sans")
(specification->package "font-comic-neue")
(specification->package "font-awesome")
#+end_src
To make my system actually able to render them properly Fontconfig needs to be explicitly installed. It doesn't matter if it's installed in Arch as well.
#+begin_src scheme :noweb-ref guix-packages
(specification->package "fontconfig")
#+end_src
One of the reasons I wanted to go back to using Guix on Arch was that I really liked the setup I had in my full Guix distro with Shepherd. And the fact that all of a sudden, for an unknown reason, systemd removed some of my enabled services. This is a service manager configured in scheme. It lets me set up user-level services such as my Emacs daemon, mbsync, mcron, etc.
#+begin_src scheme :noweb-ref guix-packages
(specification->package "shepherd")
#+end_src
There's a few settings that I set through the X Server Resource Database, like my preferred mouse cursor.
#+begin_src scheme :noweb-ref guix-packages
(specification->package "xrdb")
#+end_src
I've tried to keep my X resources configurations modular so that I can easily include and exclude them based on what I use at the time and also what machine I'm configuring. By default the =xrdb= program uses the C pre-processor to allow you to define some macros and such, but that wasn't quite adequate for what I needed. So I'm using the =m4= macro pre-processor instead, which will let me do more things.
#+begin_src scheme :noweb-ref guix-packages
(specification->package "m4")
#+end_src
I use Herbstluftwm as my window manager. So far even Stumpwm can't seem to beat it for me. It's very configurable through anything that can run shell scripts, and it has a nice mix of automatic and manual tiling that I just really enjoy.
#+begin_src scheme :noweb-ref guix-packages
(specification->package "herbstluftwm")
#+end_src
With herbstluftwm I use polybar as the status bar for my desktop.
#+begin_src scheme :noweb-ref guix-packages
(specification->package "polybar")
#+end_src
I like configurable software. And I'm not quite used to it yet, I still use Firefox a lot, but I'm trying to learn and use Nyxt more. After Conkeror it's the most interesting browser I've come across so far.
#+begin_src scheme :noweb-ref guix-packages
(specification->package "nyxt")
#+end_src
Whenever I use Guix on a foreign distribution (meaning not on a 100% Guix distribution) I end up with a number of applications being unable to find the hicolor theme. I don't quite know the details yet, but I'm installing it now.
#+begin_src scheme :noweb-ref guix-packages
(specification->package "hicolor-icon-theme")
#+end_src
The problem might actually not be missing the hicolor icon theme but the fact that Arch keeps the =XDG_DATA_DIRS= environment variable empty on my machine. This means that certain programs that search through the directories in there will stop searching through =/usr/share= once Guix sets the variable, because Guix will not automatically add =/usr/local/share/:/usr/share/= when the variable is empty (since that wouldn't make sense on a Guix distribution).
Mcron is a cron daemon configured in scheme. I run it as a user so I can easily run tasks periodically while using scheme!
#+begin_src scheme :noweb-ref guix-packages
(specification->package "mcron")
#+end_src
I've been using the =dunst= notification daemon for a long time now. It's nice and configurable even if it isn't written in Lisp.
#+begin_src scheme :noweb-ref guix-packages
(specification->package "dunst")
#+end_src
I've used various terminal emulators, and I try to use =vterm= in Emacs when I can, but I've settled on using Kitty for a while now when I use the terminal outside of Emacs.
#+begin_src scheme :noweb-ref guix-packages
(specification->package "kitty")
#+end_src
Oneko is a completely useless program, that is also kind-of fun. A cat runs after your cursor or the window you've selected.
#+begin_src scheme :noweb-ref guix-packages
(specification->package "oneko")
#+end_src
Even though it's a dead project, seemingly, there is something so special about scsh that I just can't stop using it more and more. Writing shell scripts in Scheme is just too good to give up.
#+begin_src scheme :noweb-ref guix-packages
(specification->package "scsh")
#+end_src
I use xbindkeys to define my keybindings because it lets me configure them in Scheme.
#+begin_src scheme :noweb-ref guix-packages
(specification->package "xbindkeys")
#+end_src
Syncthing is an easy way to set up automatic file sharing between different devices.
#+begin_src scheme :noweb-ref guix-packages
(specification->package "syncthing")
#+end_src
I need openconnect and freerdp for work.
#+begin_src scheme :noweb-ref guix-packages
(specification->package "openconnect")
(specification->package "freerdp")
#+end_src
Shellcheck is great to help make sure I don't make dumb mistakes in my shell scripts.
#+begin_src scheme :noweb-ref guix-packages
(specification->package "shellcheck")
#+end_src
Flameshot is a great application for making screenshots.
#+begin_src scheme :noweb-ref guix-packages
(specification->package "flameshot")
#+end_src
Kde Connect is an awesome application to connect devices together for functions other than file sharing (such as notification sharing).
#+begin_src scheme :noweb-ref guix-packages
(specification->package "kdeconnect")
#+end_src