Skip to content

Nix handbook

Yash Raj edited this page Dec 8, 2023 · 7 revisions
Welcome to the dotfiles wiki!

🔧 System info

These are my personal ideologies towards using nixos

Instead of changing font size or xcursor size use, dpi settings which will help to keep it global, in a way that you can use the same configuration on small screens and large screens.

My hardware-configuration file is very universal as it uses variable names for disks so can be used without changing anything.

Miscellaneous

How to move to a new system?

Update files in hosts/"system name". Eg. "acer", It is my main system so If I have another secondary system I will just make new host like "secsystem" and update flake, If I have to shift to a new main system I will just update the "acer" folder files.

How to nixos rebuild?

sudo nixos-rebuild switch --flake .#hostName

If I have flake.nix file in a seperate directory, say ".setup", then

sudo nixos-rebuild switch --flake .setup#hostName

I use .setup and so the same is configured in my bash.nix file. If you want your own folder name then also change the name in bash.nix.

How to use nix shell to install packages?

nix shell nixpkgs#packageName

Change channels directly from terminal

$ nix-env -f channel:nixos-unstable -iA unrar

How to cleanup nixos

nix-collect-garbage -d
sudo nix-collect-garbage -d

Efficient usage (WIP)

Git PAT

git remote set-url origin https://<TOKEN>@github.com/<USERNAME>/<REPOSITORYNAME>.git

Neofetch bug: wallpaper image not changing.

neofetch --clean

nix develop directly in neovim figsoda/nix-develop

:NixDevelop ~/path_to_flake_config

Nix develop with vscode? To use the development environment packages (shell.nix) we need to first do nix develop inside a terminal and then run codium . to open vscode in the dev environment with all packages available.

Clone this wiki locally