Benoit J - My mostly tech blog

Guix Home Configuration - Part 2 - Services

2023-10-24


Nix home-manager

Nix home-manager has a lot of services. In fact, I don’t think I manage any configuration files myself except for my Emacs configuration. From daemon, to email, to bash, it’s covered.

In nix term, a program is a package + configuration, while a service is a program with an autorun.

email configuration

Configure account specific information. From email addresses to imap or smtp server details. This information is reused by many mail related tools.

nix guix comment
accounts.email.accounts.* manual configure email accounts w/ user/pass, email addresses, etc
accounts.email.accounts.*.imap manual imap conf for account
accounts.email.accounts.*.smtp manual smtp conf for account
accounts.email.accounts.*.msmtp.enable manual send email with msmtp
accounts.email.accounts.*.imapnotify manual enable goimapnotify support
accounts.email.accounts.*.notmuch.enable manual enable notmuch for account
accounts.email.accounts.*.mbsync manual enable mbsync for account

X11 specific config

These elements configure X and how to load X with Xsession.

nix guix comment
fonts.fontconfig.enable unclear if I need this-command enable font config
xresources.properties home-files-service-type (manual) configure xresources and load it with k/v
xsession.enable home-files-service-type (manual)
xsession.initExtra home-files-service-type (manual)
xsession.windowManager.command home-files-service-type (manual) command to run to start my window manager

programs

Programs in Nix are used to install and configure applications or tools.

nix guix comment
programs.autorandr.enable autorandr
programs.autorandr.profiles missing: install config map of profiles and config
programs.bash.enable bash-service-type enables bash. .bash_profile loads .bashrc, default .profile loading home managers session vars
programs.bash.enableCompletion home-bash-configuration bashrc (manual) enables completion
programs.bash.initExtra home-bash-configuration bashrc adds to .bashrc for interactive shells (after check interactive)
programs.bash.profileExtra home-shell-profile-configuration adds extra at the end of .profile
programs.bash.sessionVariables home-environment-variables-service-type adds extra exports to .profile using k/v map
programs.bash.shellOptions home-bash-configuration bashrc (manual) adds shopts to interactive .bashrc using k/v map
programs.bash.shellAliases home-bash-configuration aliases adds aliases to .bashrc using k/v map
programs.bash.logoutExtra home-bash-configuration bash-logout adds extra to .bash_logout
home.sessionPath home-environment-variables-service-type (manual) add dir to PATH in .profile
programs.direnv.enable direnv w/ home-bash-configuration bashrc (manual) enables direnv in .bashrc interactive
programs.direnv.nix-direnv.enable home-file-service-type for use guix from guix cookbook
programs.emacs.enable I will install my config with home-files-service-type enable configuration of emacs
programs.emacs.package pick the right emacs 29 + nativecomp which emacs package to use
programs.emacs.extraPackages extend the package if needed which extra nix packages is added to the dependencies / visible to emacs. the rest I pull with straight
programs.git.enable home-xdg-configuration-files-service-type (manual) configure git
programs.git.package home-xdg-configuration-files-service-type (manual) package to use
programs.git.userEmail home-xdg-configuration-files-service-type (manual) email
programs.git.userName home-xdg-configuration-files-service-type (manual) user name
programs.git.aliases home-xdg-configuration-files-service-type (manual) aliases k/v map
programs.git.attributes home-xdg-configuration-files-service-type (manual) attributes k/v map
programs.git.difftastic.enable home-xdg-configuration-files-service-type (manual) enable difftastic
programs.git.signing home-xdg-configuration-files-service-type (manual) set signing key
programs.git.extraConfig home-xdg-configuration-files-service-type (manual) extra config k/v
programs.mbsync.enable=true; home-files-service-type (manual) configures mbsync
programs.msmtp.enable home-files-service-type (manual)
programs.notmuch.enable home-files-service-type (manual)
programs.notmuch.new.tags home-files-service-type (manual)
programs.notmuch.search.excludeTags home-files-service-type (manual)
programs.notmuch.maildir.synchronizeFlags home-files-service-type (manual)
programs.notmuch.hooks home-files-service-type (manual)
programs.ncspot.enable missing, nix for now configure ncspot
programs.ncspot.settings home-xdg-configuration-files-service-type (manual) k/v of settings.
programs.password-store.enable password-store enables
programs.password-store.settings home-xdg-configuration-files-service-type (manual) k/v
programs.qutebrowser.enable nixpkgs since qute on guix does not work for all that I use
programs.qutebrowser.loadAutoconfig home-xdg-configuration-files-service-type (manual)
programs.qutebrowser.extraConfig home-xdg-configuration-files-service-type (manual)
programs.qutebrowser.keyBindings home-xdg-configuration-files-service-type (manual)
programs.rofi.enable rofi configure rofi
programs.rofi.font home-xdg-configuration-files-service-type (manual) font to use
programs.rofi.theme home-xdg-configuration-files-service-type (manual) theme to use
programs.rofi.terminal home-xdg-configuration-files-service-type (manual) terminal to use
programs.rofi.extraConfig home-xdg-configuration-files-service-type (manual) extra config to add
programs.starship.enable found in 3rd party channel adds starship setup to .bashrc
programs.starship.settings home-xdg-configuration-files-service-type (manual) i disable stuff

services

Services are programs which are autolaunched in various ways: shepherd, from Xsession, from a startup script.

nix guix comment
services.syncthing.enable home-syncthing-service-type start syncthing user daemon
services.gpg-agent.enable home-gpg-service-type enable agent
services.gpg-agent.enableScDaemon there is a system service, unclear what else enable support for yubikey
services.gpg-agent.enableSshSupport home-gpg-agent-configuration ssh-support? enable gpg agent as ssh agent
services.gpg-agent.sshKeys home-openssh-configuration specify keys to load
services.spotifyd.enable abandon
services.spotifyd.settings abandon k/v
services.imapnotify.enable home-xdg-configuration-files-service-type (manual) w/ shepherd
services.mbsync.enable=false; home-files-service-type (manual) since I start mbsync with imapnotify
services.dunst.enable home-files-service-type w/ xsession.initExtra (manual)
services.picom.enable home-files-service-type w/ xsession.initExtra (manual)
services.sxhkd.enable xsession.initExtra (manual)
services.sxhkd.keybindings home-files-service-type w/ xsession.initExtra (manual) k/v
services.dwm-status.enable xsession.initExtra (manual)
services.dwm-status.order home-files-service-type w/ xsession.initExtra (manual) array of info to see
services.dwm-status.extraConfig home-files-service-type w/ xsession.initExtra (manual) k/v
services.screen-locker.enable xsession.initExtra (manual) enables auto locking
services.screen-locker.lockCmd home-files-service-type w/ xsession.initExtra (manual) process to start when locking
services.poweralertd.enable home-batsignal-service-type
services.unclutter.enable home-unclutter-service-type

Other configuration

Where I want to supply my own complete dotfile, I use home.file to install it. In nix, it’s really just for few.

My strategy for getting Guix running ASAP for missing services or programs is to capture my current configuration files and install them with a similar guix home service.

nix guix comment
home.file.abcde home-files-service-type copy dotfile
home.file.emacs-init home-xdg-configuration-files-service-type basic home file copy of my emacs init file to ~/.config/emacs
home.file.local-bin home-files-service-type copy my small shell scripts to ~./local/bin
home.file.lynx home-xdg-configuration-files-service-type copy dotfile
home.file.surfraw home-xdg-configuration-files-service-type copy dotfile

3rd party services

I found couple of services like dunst in 3rd party channels. Once I have a working setup, I should be looking at them + RDE which has a lot of good home services, on top of writing my own.

What’s next?

I know this works and can work.

I’ve got solutions for everything, the next steps are: