Skip to content

ryhkml/nix-home-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nix Home Manager

The nix home manager configuration i use is my never-ending journey to keep things smooth and fun.

Installation

Note

This is my personal best practice how to install Nix Home Manager on all Linux distributions, except immutable distributions.

If you are using an immutable distribution, visit here.

  1. Choose single-user installation, run:

    sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --no-daemon
    . /home/$USER/.nix-profile/etc/profile.d/nix.sh

    For more information, visit nixos.org/download

  2. Add Home Manager channel, run:

    nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
    nix-channel --add https://github.com/nix-community/nixGL/archive/main.tar.gz nixgl
    nix-channel --update

    In the Nix ecosystem, which includes the Nix Home Manager, a channel refers to a method for managing and distributing collections of Nix packages and configurations. Channels are essentially repositories of Nix expressions that define both packages and configurations. These channels are regularly updated, allowing users to subscribe to them to receive the latest updates. The mentioned command adds a channel named "home-manager", indicating that any package installed through this channel will be updated to the latest version available, as per the unstable branch listed on search.nixos.org/packages. For the channel called “nixgl”, you can visit here.

  3. Run the Home Manager installation command and create the first Home Manager generation:

    nix-shell '<home-manager>' -A install
    echo ". /home/$USER/.nix-profile/etc/profile.d/nix.sh" | tee -a ~/.bashrc > /dev/null
    source ~/.bashrc
  4. Check home.nix configuration, run:

    cat ~/.config/home-manager/home.nix

Next Step

Visit configuration example, how to use home-manager command.

Packages

The installed packages include command line interface, language server protocol, formatter, and some plugins of the package itself.

A

  1. act - Run GitHub Actions locally
  2. air - Live reload for Go apps
  3. alacritty - A cross-platform OpenGL terminal emulator
  4. asciiquarium-transparent - Aquarium/sea animation in ASCII art
  5. asm-lsp - LSP fo Assembly
  6. asmfmt - Formatter fo Assembly
  7. astyle - Formatter only for Java

B

  1. bat - Alternative to cat
  2. bash-language-server - LSP for Bash
  3. beautysh - Formatter for Shell
  4. bun - Javascript runtime, bundler, test runner, and package manager
  5. btop - A monitor of resources

C

  1. cmus - Console music player for Unix-like operating systems
  2. ctop - Top-like interface for container metrics
  3. curl - Tool and library to transfer data (with c-ares and gsasl features)

D

  1. direnv - Unclutter your .profile
  2. dockerfile-language-server-nodejs - LSP for Dockerfile
  3. duf - Disk usage or free utility. A better df alternative

E

  1. editorconfig - Enforces consistent coding styles across editors and IDEs
  2. exiftool - Meta information reader or writer
  3. eza - A modern alternative to ls

F

  1. fastfetch - Neofetch like system information tool
  2. fd - Alternative to find
  3. file - Shows the type of files
  4. firebase - Firebase CLI
  5. fish - User friendly command line shell
  6. fishPlugins.autopair - Auto complete matching pairs in the fish command line
  7. fzf - Command line fuzzy finder

G

  1. gcloud - Google Cloud CLI
  2. go - Golang!
  3. go-migrate - Database migrations. CLI and Golang library
  4. gopls - LSP for Go

H

  1. hey - HTTP load generator, ApacheBench (ab) replacement
  2. hyperfine - Command line benchmarking tool

I

  1. id3v2 - Command line editor for id3v2 tags

J

  1. java - Java Development Kit
  2. jdt-language-server - LSP for Java
  3. jq - Lightweight and flexible command line JSON processor

K

  1. k6 - Modern load testing tool, using Go and JavaScript

L

  1. lazydocker - The lazier way to manage everything docker
  2. lazygit - Terminal UI for git commands
  3. lmstudio - Run local LLMs
  4. lua - Lualang!

M

  1. minify - Web formats minifier

N

  1. neovim - Hyperextensible Vim-based text editor
  2. nginx-language-server - LSP for nginx.conf
  3. nil - Yet another LSP for Nix
  4. nixgl - A wrapper tool for Nix OpenGL application
  5. nix-prefetch-git - Script used to obtain source hashes for fetchgit
  6. nixfmt-rfc-style - Formatter for Nix
  7. nodejs - Event-driven I/O framework for the V8 Javascript engine
  8. nodePackages.prettier - Formatter only for HTML, CSS, JS, TS, and JSON
  9. nodePackages.vls - LSP for Vue
  10. noisetorch - Virtual microphone device with noise supression for PulseAudio

P

  1. pnpm - Fast, disk space efficient package manager
  2. podman-compose - Implementation of docker-compose with podman backend

R

  1. ripgrep - Searcher with the raw speed of grep
  2. rlwrap - A readline wrapper
  3. rustup - Rust toolchain installer
  4. rust-analyzer - Modular compiler frontend for the Rust language
  5. rustfmt - Formatter for Rust

S

  1. shellcheck - Shell script analysis tool
  2. speedtest-cli - Testing internet bandwidth
  3. stylua - Formatter for Lua
  4. sqlite - Small and fast SQL database engine

T

  1. taplo - TOML toolkit written in Rust
  2. tokei - Count your code quickly
  3. typescript - Javascript with syntax for types
  4. typescript-language-server - LSP for Typescript using tsserver

U

  1. unar - Archive unpacker program

V

  1. vscode-langservers-extracted - LSP extracted from Vscode only for HTML/CSS/JSON/ESLint
  2. Vscodium - VSCode without MS branding, telemetry, or licensing

Y

  1. yamlfmt - Formatter for YAML
  2. yaml-language-server - LSP for YAML
  3. yt-dlp - Command line tool to download videos from Youtube and other sites

Z

  1. zellij - A terminal workspace
  2. zig - Ziglang!
  3. zls - LSP for Zig
  4. zoxide - Fast cd that learns your habits

Uninstalling Nix and Nix Home Manager (Single-User)

Just delete the files and directories containing nix and home-manager

nix-collect-garbage -d
rm -rf ~/.cache/nix \
    ~/.config/nix ~/.config/home-manager \
    ~/.local/share/nix ~/.local/share/home-manager \
    ~/.local/state/nix ~/.local/state/home-manager \
    ~/.nix-channels ~/.nix-defexpr ~/.nix-profile
sudo rm -rf /nix

Finally, remove the installation script section from the .bashrc and .bash_profile files as well

# .bash_profile
if [ -e /home/user/.nix-profile/etc/profile.d/nix.sh ]; then . /home/user/.nix-profile/etc/profile.d/nix.sh; fi
# .bashrc
. "$HOME"/.nix-profile/etc/profile.d/nix.sh

About

An alternative approach to replacing dotfiles

Topics

Resources

License

Stars

Watchers

Forks

Languages