Skip to content

Repository files navigation

Configuration

This repository contains configuration for my hosts. It is built around Dendritic Pattern

Key features:

  1. Declarative encrypted BtrFs using disko
  2. Minimal NixOS configuration: as much as possible is moved to Home Manager
  3. Minimal Home Manager configuration: as much as possible is configured in stow-compatible way
  4. UWSM Hyprland
  5. Minimal NeoVim configuration:
    • As much as possible is done with either LSP or TreeSitter
    • Desktop notifications
    • External (yet integrated with editor) file manager (n³)
    • External (yet integrated with editor) Git GUI (Lazygit)
    • External (yet integrated with editor) terminal (Kitty)

Stow Compatibility

Where possible tools and services are configured using GNU Stow and Nix is used only for installing packages and their plugins/extensions.

This repository contains three Stow directories each corresponding to it's target directory:

  1. stow-home: target is ~/
  2. stow-system: target os /etc/
  3. stow-service target is /var/lib/

Instead of the usual programs.helix.settings = { ... } what basically happens in Nix code is this:

# home.nix

xdg.configHome."helix/config.toml".source = "${self}/stow-home/helix/.config/helix/config.toml"

But instead of manually linking each configuration file like this a helper functions exist: packageHomeFiles, packageSystemFiles.

# home.nix

home.file = lib.mkMerge [
    (packageHomeFiles "helix")
];

So all it takes is just picking the right helper function depending on a target directory and giving it a package name. The function will walk the entire package and link files to the right places just like what stow -t ~ -S helix would do.

Here are some advantages of this approach:

  1. I didn't had to rewrite all my dotfiles when migrating to Nix.
  2. I don't have to rewrite configuration examples I find on the internet when configuring a new tool.
  3. I won't have to rewrite all my dotfiles once I decide to leave NixOS for whatever reason.
  4. I theoretically can reuse parts of my dotfiles on a machines with no Nix whatsoever.
  5. Combined with impurity.nix I can make parts of nix store point directly at dotfiles repository when debugging which allows me to easily test changes without constant rebuilding.

Installation

CAUTION:

DO NOT RUN DISKO ON A HOST WITH SIMILAR SETUP, USE LIVECD ON A FUTURE HOST INSTEAD !!!

Filesystem and partition labels are used, expect conflicts

# Could be: pluto, mars, jupiter, venus
NIXHOST=pluto
NIXUSER=general
echo -n 'main drive encryption password here' > /tmp/secret.key
sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko/latest -- --mode destroy,format,mount --flake github:aitvann/dotfiles#${NIXHOST}
nixos-generate-config --show-hardware-config --no-filesystems --root /mnt
# Edit configuration.nix accordingly
sudo nixos-install --root /mnt --flake github:aitvann/dotfiles#${NIXHOST}
sudo nixos-enter --root /mnt
chown -R ${USER}:users /home/${USER}/{.local,.snapshots}
su - ${NIXUSER}
# Insert cd with secrets
import-secrets ~/secrets.tar.gpg
restic-jupiter restore -t ~ latest:home/${USER}
mkdir -p {~/.local/share/mpd,~/.config/gtk-2.0}
reboot

Workstation

"Workstation" is a configuration shared between two hosts: mars (laptop), pluto (pc)

Change GTK Theme

  1. Add theme package to home.packages
  2. Some files might need to be deleted if they point to /nix/store, otherwise nwg-look won't apply the changes: rm {~/.local/share/icons/default/index.theme,~/.config/xsettingsd/xsettingsd.conf,~/.config/gtk-2.0/gtkrc,~/.config/gtk-3.0/settings.ini,~/.config/gtk-4.0/settings.ini}
  3. Select and apply themes using nwg-look tool
  4. Run systemctl --user restart xsettingsd.service
  5. Run apply-config gtk script to copy GTK configuration files to the repo

Change QT Theme

  1. Add theme package to home.packages
  2. Set QT_QPA_PLATFORMTHEME, QT_STYLE_OVERRIDE in uwsm/env

Change Syncthing Configuration

  1. Do all the changes in a web GUI
  2. Run apply-config syncthing-${HOST} to copy new configuration to the repo

Change ISponsorBlockTV Configuration

docker run --rm -it \
-v $HOME/dotfiles/stow-system/isponsorblocktv/isponsorblocktv:/app/data \
--net=host \
-e TERM=$TERM -e COLORTERM=$COLORTERM \
ghcr.io/dmunozv04/isponsorblocktv \
--setup

About

My dotfiles

Topics

Resources

Stars

8 stars

Watchers

1 watching

Forks

Contributors

Languages