Skip to content

home configuration files (dotfiles) using home-manager and nix

License

Notifications You must be signed in to change notification settings

mogria/nixpkgs-config

Repository files navigation

Mogria's .dotfiles

These are Home-Manager based configuration for my home directory files.

Home-Manager allows one to configure his own $HOME directory using the nix language and the nixpkgs package collection.

These configuration files are in use on multiple 64-Linux Linux NixOS machine's and on a recent MacBook. Some minor modifications might be needed to make them runnable on other architectures or with other distributions than NixOS just using the Nix package manager.

Environment and Tools Included

This collection of configuration files and script almost gives you a complete "IDE"-like environment. At least, I use it as such. This environment is heavily tuned toward how my own workflow works (keybindings and programs used and such). So feel free to adjust these files to your wishes or take out little bits and pieces here and there.

Here a little screenshot (to show off) of a busy screen when I'm running the terminal IDE:

Tmux + Neovim + Ranger + Alacritty + ZSH + Nix-Shell used for development

Programming: NeoVim

These configuration files contain a heavily customized neovim with a lot of plugins for supporting programming. I usually start multiple instances of neovim inside tmux. The .zshrc automatically starts a new tmux session.

Some of the plugins include:

  • Syntastic
  • UltiSnips + Some of my own snippets
  • Language Specific Plugins for languages and configuration for
    • PHP
    • Python
    • PgSQL
    • LaTeX
    • HTML, XHTML
    • Nix
  • a lot of tpope's plugins
  • Git integration is provided via vim-fugitive plugin.

Interactive Shell Environment: tmux + zsh

This configuration includes a customized ZSH with powerline with a custom dark theme. It also contains integration with various tools.

Allows you to set different environment variables and load different configurations when entering a directory automatically if it contains a .envrc configuration file. I use this in a lot of project root directories to automatically spawn a nix-shell when entering a directory which contains all the development dependencies.

A general fuzzy search program. Is used in diverse places:

  • Can be called from vim to fuzzy search files using <Space>sf while in normal mode
    • You can then press CTRL-X or CTRL-V to automatically open a new :split or :vsplit window respectively.
    • More vim keybindings can be found in my vimrc. Feel free to adjust them to your needs.
  • Can be called from zsh to fuzzy search files by typing \<Tab>
  • Can be called from zsh to fuzzy search the shell history by pressing CTRL-R. This one is very useful and gets more useful the bigger your shell history is. (The size of the history $HISTSIZE is configured to be 100000).

A fast recursive grep wit nice colored output. One of my most used shell utilities during an interactive shell session. I even have a script vrg pass to start vim and pass the search results into the quickfix list automatically.

It can be called from within vim as well to fill the quickfix list using <Space>F to search for the word below the cursor. <Space>f searches for the last thing you searched using / in vim, so you can expand your file scoped search to the while project directory. Alternatively type :Rg to search for something else. This functionality is provided by the vim-ripgrep plugin.

Git Integration

Various tools have been configured to work better with git.

Graphical

Different graphical tools are included as well but only on Linux. This includes

  • Rofi: A little menu I use to start programs and search for windows of currently opened windows. Only used on Linux in conjuction with the NixOS's XFCE 4.14a (needs to be activated in /etc/nixos/configuration.nix).
  • Alacritty terminal emulator: cross-platform GPU-accelerated terminal emulator

Installation

  • Install Nix or even NixOS

  • Clone this repository into ~/.config/home-manager

    git clone https://github.com/mogria/nixpkgs-config.git ~/.config/home-manager
    
  • Symlink the used nixpkgs configuration from this repo into ~/.config/nixpkgs

    mkdir ~/.config/nixpkgs
    ln -s ~/.config/home-manager/config.nix ~/.config/nixpkgs/config.nix
    
  • Configure your git settings and github repositories in user-config.nix

  • Install Home-Manager: https://github.com/nix-community/home-manager

    nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
    nix-channel --update
    nix-shell '<home-manager>' -A install