Skip to content

Latest commit

Β 

History

110 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation


Rachit's NixOS configuration

Introduction

Note

Looks matter. It is a good thing to have utility with a good rice.

Util Program used
Shell Zsh
WM/DE Niri
Editor Neovim
Terminal Kitty
Audio RMPC + MPD
System Monitor Bottom
Mail Aerc
Matrix Client Iamb (with Cinny as my WebUI)
IRC Client Halloy
File Manager (GUI) PCManFM
File Manager (TUI) Yazi
RSS Reader MiniFlux (WebUI) + Eilmeldung (TUI)
Theme Gruvbox Material Dark Hard
Browser (GUI) Firefox
Text Browser (Terminal) w3m
Agenda/Task Maintainer taskwarrior

Instructions for Installation:

Note

I am assuming that an ISO is already created. for more details see the NixOS Manual

πŸ§ͺ Enable Experimental Features

Experimental features are not enabled in NixOS by default. They can be enabled by exporting the NIX_CONFIG variable or by passing the --extra-experimental-features flag to the nix command utility.

First, enter into a root shell:

sudo -i

Run this to enable flakes and the nix-command utility:

export NIX_CONFIG="experimental-features = nix-command flakes"

↙️ Clone this Repo

Clone the repository into /tmp:

mkdir -p /tmp
cd /tmp
git clone --depth=1 https://github.com/rachitvrma/dotfiles.git

πŸ’Ύ Run Disko to Prepare Disks

Disko is available in nixpkgs, but it is advisable to run the latest commit from the nix-community repo. Make sure the disko-config.nix belongs to the correct host. By default, it's set for nixpavilion.

cd /tmp/dotfiles/modules/hosts/nixpavilion
nix run github:nix-community/disko/latest -- --mode destroy,format,mount ./disko-config.nix

🐧 OS Installation

Copy the cloned repo into /mnt/etc/nixos and run the installation:

mkdir -p /mnt/etc
cp -r /tmp/dotfiles /mnt/etc/nixos
nixos-install --no-root-passwd --root /mnt --cores 8 --max-jobs 1 --flake /mnt/etc/nixos#nixpavilion

Reboot after unmounting:

umount -R /mnt
reboot

πŸ’» Post-OS-Installation

πŸ”’ Change user password

passwd $USER

✏️ Editing NixOS configuration without sudo

Move /etc/nixos to $HOME/etc/nixos so that the user can edit NixOS configuration files without sudo. Taken from the wiki.

mkdir ~/etc
sudo mv /etc/nixos ~/etc/
sudo chown -R $(id -un):users ~/etc/nixos
sudo ln -s ~/etc/nixos /etc/

πŸ“° Miniflux setup

Important

If miniflux doesn't find these credentials in the designated directory rebuild will fail, because it's systemd-unit will fail.

To set up miniflux for RSS feeds.

sudo mkdir -p /etc/secrets/miniflux-admin-credentials
sudo chmod 600 /etc/secrets/miniflux-admin-credentials

In that file put:

ADMIN_USERNAME=<username>
ADMIN_PASSWORD=something6charactersLong

πŸ”‘ GPG / pass restoration

Important

Do this BEFORE the first home-manager switch/nh os switch/rebuild after a reinstall. Nix does not and cannot manage your GPG secret key material β€” pass, pass-secret-service, and the email module's passwordCommand will all fail until it's restored, which can block the rebuild the same way a missing Miniflux credential does.

Before wiping the old system, export your key and keep it somewhere off-machine (encrypted USB, not this repo):

gpg --homedir ~/.local/share/gnupg --export-secret-keys --armor > gpg-backup.asc

Also confirm ~/.password-store is backed up or pushed to a remote β€” the key alone decrypts nothing without the encrypted store itself.

After reinstall, before rebuilding:

mkdir -p ~/.local/share/gnupg
gpg --homedir ~/.local/share/gnupg --import gpg-backup.asc
gpg --homedir ~/.local/share/gnupg --edit-key <keyid> trust   # choose 5 (ultimate)

git clone <your-pass-store-remote> ~/.password-store

Note

programs.gpg.homedir is ~/.local/share/gnupg, not ~/.gnupg. Restoring your key to the default path is the easy way to reproduce "gpg can't find my key."

Note

pinentry-gnome3 needs gcr on D-Bus to work outside GNOME (niri included). Both nixosModules.gpg and homeModules.gpg already set services.dbus.packages = [ pkgs.gcr ], so this should self-heal on rebuild β€” but if pinentry never appears on first login, log out/in once so the D-Bus session picks it up.

Fastfetch Setup

In my fastfetch config, I use images from Maheswara660's fastfetch repo. So this step must be followed.

  1. Clone the repo somewhere:
git clone --depth=1 https://github.com/Maheswara660/fastfetch/
  1. Go into the images directory and run git lfs pull command.
git lfs pull
  1. Cut the entire images directory into ~/.config/fastfetch/images

Nix / NixOS / Flakes

The book from Reddit

Official / foundational docs

  • nix.dev β€” the official "get things done" guide, opinionated and task-oriented rather than reference-only.
  • Nix Reference Manual β€” the actual language/CLI spec. Dry, but authoritative when nix.dev hand-waves something.
  • Nixpkgs Manual and NixOS Manual β€” same deal, one level down the stack.
  • Nix Pills β€” the classic "build up Nix from first principles" series. Old but still the best mental-model builder for why Nix works the way it does, not just how to invoke it.

Flake-centric / modern onboarding

  • Zero to Nix β€” Determinate Systems' flakes-first onboarding guide. Good "quick start" track plus per-language dev-shell guides.
  • Nix from First Principles: Flake Edition style crash-courses β€” search for the current top hit, these get updated often.
  • Wombat's Book of Nix β€” another book-length intro, more concept-first than ryan4yin's, good second opinion when something doesn't click.

Reference / search tools (bookmark these, you'll use them constantly)

  • Noogle β€” Nix API search by function signature/type. Genuinely the fastest way to find a lib.* function when you know the shape you want but not the name.
  • Home Manager Option Search β€” searchable index of all HM options, faster than grepping the manual.
  • search.nixos.org β€” packages + NixOS options.
  • Searchix / NΓΌschtOS Search β€” alternative option search engines, sometimes surface things the official search misses.
  • MyNixOS β€” another options/packages search, decent UI for cross-referencing multiple option sources at once.

Curated meta-lists (better than any single page)

  • awesome-nix β€” the community-maintained master list. Sections for language tooling, deployment, learning resources, dev-shell frameworks (flake-parts, flake-utils, dream2nix, flakelight, etc.). Worth periodically re-skimming as things move fast here.
  • Nix Shorts β€” short focused write-ups on specific Nix idioms, updated for flakes.
  • How to Learn Nix β€” Ian Henry's "let's-play"-style walkthrough of the language semantics specifically (not NixOS, not flakes β€” just the language, which is usually the part people skip and regret).

Video

  • Nix in 100 Seconds (Fireship) β€” not depth, but a good 100-second gut-check to send to anyone asking what Nix is.
  • Search current channels for "vimjoyer" and "ryan4yin" on YouTube β€” both do NixOS/flake-parts/home-manager walkthroughs pretty regularly; check what's recent since the corpus of videos changes often.

IRC Cheatsheet

Also there are resources here:


πŸ“ƒ License

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.

About

My NixOS Configuration

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages