Skip to content

ahmedelgabri/dotfiles

Repository files navigation

~ 🍭 ~

built with nix

For setting up development environment on any Unix machine (Darwin/Linux). The config officially supports macOS & NixOS & managed by nix

screenshot

Font is Pragmata Pro, theme is a my own fork of vim-colors-plain, Terminal is kitty

What's in it?

These are the main configs:

Officially supported OSs

  • ARM macOS Sonoma
  • [Experimental] NixOS (tested on 22.11)

Installation

  1. Install Command line tools.
xcode-select --install
  1. Install nix (I tested mostly with https://github.com/DeterminateSystems/nix-installer, but I think everything should work fine with the default nix installer)
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
  1. Build

Note

The flake attribute in my case is usually the host machine name

online:

nix --experimental-features 'nix-command flakes' run nix-darwin -- switch --flake "github:ahmedelgabri/dotfiles#<flake attribute>"

local:

nix --experimental-features 'nix-command flakes' run nix-darwin -- switch --flake "~/path/to/dotfiles#<flake attribute>"

Homebrew

I still use it mostly for GUI apps, since Nix and/or Home-manager support for GUI applications have problems with symlinking to the Applications/ folder. Homebrew is fully managed by nix it gets installed and run through nix using nix-homebrew

Notes

  • zsh: add these to ${XDG_DATA_HOME}/$(hostname)/zshrc
export HOMEBREW_GITHUB_API_TOKEN =
export GITHUB_TOKEN =
export WEECHAT_PASSPHRASE =
  • For git add your GPG key info in ${XDG_DATA_HOME}/$(hostname)/gitconfig
[user]
  signingkey =

Don't forget to upload your public key to GitHub!

Note: There needs to be a three-way match on your email for GitHub to show the commit as 'verified': The commit email, github email, & the email associated with the public key

Learn about creating a GPG key and signing your commits here

Email

My email messages are synchronised between the remote server and my computer with isync, I read them with neomutt and search index is built by notmuch.

After linking the dotfiles, there are only a few more things that need to be done.

Authentication

Each account must authenticate with an IMAP server and an SMTP server. The passwords, need be stored in the OS X keychain.

For Fastmail (or Gmail accounts with two-factor authentication enabled), use an application-specific password.

In order for all this to work, a few items have to be stored in the macOS keychain:

Create a "generic"(A.K.A. "application") keychain item (that is, without protocols, only hostnames):

For sending mail:

Repeat this for each account you want to add.

Synchronizing periodically

Incoming messages are fetched from the remote server when mbsync runs (the executable name for isync).

On macs I use launchd, on NixOS using systemd. You can check mail.nix.

Authors

Ahmed El Gabri