Home

Awesome

Configuration for my workstation

CI Status

This repository can reproduce the entirety of my system; including services, applications and configurations. It should contain everything necessary for an usable OS without any further configuration.

The configuration is based on my needs, however it does not mention my details anywhere (except user.nix); so it should be usable to anyone with similar tastes.

Features

Motivation

I follow the philosophy of "things should do one thing and do it well", so I try to avoid complex tools. I found a few rule-of-thumbs which helps me decide if a tool is sufficiently complex or not. I try not to use something if it:

It's pretty hard to find applications fitting all of those criteria; so sometimes I resort to disabling features, preferably with a configuration flag, or simply by disabling the relevant keybindings.

Installation

$(nix-build -A cachix https://cachix.org/api/v1/install)/bin/cachix use utdemir
./make.sh switch

Warning: The installed system is configured to use a binary cache populated by me (https://utdemir.cachix.org). It should reduce the amount of things you build on updates; however, theoretically, I could publish malicious binaries to that server without you knowing. So, remove the parts referring to utdemir.cachix.org from nix.binaryCaches field on configuration.nix if you do not trust me.

Maintenance

There is a make.sh on the repository responsible for common maintenance tasks.

Docs

Below some tips for the tools I'm using, and my rationale for using them. They are not comprehensive, so consult their own documentation to use them effectively.


Operating System: NixOS

All this configuration revolves around using NixOS operating system and the Nix programming language.

Nix provides a declarative way to declare your system, and has enough theory behind to have purity and rollbacks trivial.

The way I use Nix/NixOS slightly differs from the common usage:


Window Manager: i3

I use i3 as the window manager. It is fast and does its jobs well.

i3 is my only window manager. So; I do not use terminal-multiplexers, applications with tabs/panes/frames/buffers etc.


Shell: zsh

I use zsh. I have some amount of customisation, but nothing unusual. There is not a huge plus of using zsh, probably bash would also just do fine.


Terminal Emulator: kitty

I use kitty, with minimal features. I find it sufficiently simple, easy to configure, and it has a hints feature I use quite frequently. However its main developer is a bit mean, so I am keen to switch to a new terminal emulator; however I couldn't figure out a easy way to get hints without using tmux.


Editor: kakoune

I spend a lot of time editing text, so it took me quite a long time to settle on using kakoune. I think it's the only usable editor adhering to the UNIX philosophy.

Surprisingly, I only have about 30 lines of configuration for it, they just add a few keybindings, make it always use the system clipboard, and change a few visuals.

Even if I am a software developer using multiple programming ecosystems daily; I do not have programming-specific configuration on my editor. I use kakoune solely for editing code, and have an another terminal window open which runs/typechecks the project continuously.


Web Browser: qutebrowser

I use qutebrowser as my web browser. It is a keyboard-oriented minimal web browser using QtWebEngine (WebKit). The only customisation I make makes it use separate windows as tabs and makes it use kakoune as editor. Also, javascript is disabled by default, see the keybindings to disable it per-host basis (or just modify the configuration).

Actually, I would prefer to use Firefox with some addons & customisation to make it keyboard-oriented & disabling tabs. However currently there is no easy way to configure Firefox easily & install addons without using the GUI. There are some ongoing work adding this functionality to nixpkgs, I will consider switching when they are merged.


Password Manager: pass

I use password-store to manage my passwords and OTP's, and use its git integration to sync them to a private Git repository.

Checkout its documentation for the usage, I don't have any special configuration for it. However, there are a few helpers:


Other tools

I also use tons of other tools for various purposes.

Checkout ./home.nix to see them all.


FAQ

  1. Opening {images,pdfs,videos,documents}

    • sxiv for images
    • zathura for pdfs
    • mpv for videos
    • soffice for office documents
  2. Installing an application

    Add a line to ./home.nix. Do not use nix-env.

  3. External monitors

    • You can use arandr to interactively configure monitors.
    • If you have a setup you frequently use, use autorandr to save it.
  4. Software development

    I don't use an IDE and I was never able to configure Vim or Emacs to work reliably and uniformly on different programming languages and build systems. So, here is the setup I use:

    • I open three terminal windows (a big one on the left, two small ones on the right.

    • I execute the editor on the left, ranger on the top-right and make the compilation output available on the bottom-right. It looks like this:

      +--------+--------+
      |        | ranger |
      |        |        |
      + editor +--------+
      |        | watch  |
      |        |        |
      +--------+--------+
      
    • I use the ranger window for browsing the other files or using rg to search for definitions, or for any auxiliary things I do using a terminal.

    • On bottom-right, I figure out a way to have the compilation output available. Here are some examples:

      • Haskell: Use ghcid.
      • Scala: Use ~ compile command on sbt.
      • Interpreted languages: Use entr to continuously run the interpreter:
        • fd '.*.py' | entr -c python main.py
        • fd | entr -c nix-build --show-trace
        • echo slides.md | entr -c pandoc -t beamer slides.md -o slides.pdf
  5. Autostarting applications

    • If it is a simple command running as your user, put a line to dotfiles/i3/autostart.sh.
    • If it is a system daemon, put it to system.nix; either using an available NixOS module or as a custom systemd service.
  6. Something else

    If you have a problem, probably I had faced it before. Just open an issue and I will get back to you.