There are some things I couldn't figure out to use with Nix so I'm leaving the
imperative way of these things.
Flameshot has been changed to Gradia
Spicetify works now
This repository contains all of my learning process since installing NixOS. It
is pretty simple in my mind, but sometimes I find myself lost in these .nix
files not being able to figure out where is the thing I need. Moreover, some
blocks of code are blidnly copy-pasted, so after sometime I can't tell what it
does clearly, so I decided to document it for myself, maybe it serves as an
example for anyone who is reading this. One more time, keep in mind that it was
written to explain it to myself. Thanks
My nix flake currenrlty contains 4 outputs. They are:
nixosConfigurationfor my PC namelyrookwith usersae- another
nixosConfigurationfor my ThinkPad namely justpadwith usedt34 nixpkgs-fmtformatter forx86_64-linux- devshell for
x86_64-linuxwith nix language server, linter and etc.
The folder structure is also quite simple. nixosConfigurations point to
hosts/ folder for each device with device/default.nix. There is also a
folder called shared with shared NixOS related configuration, which is equally
helpful and necessary in all of my linux machines(I don't have darwin yet).
Device folders follow this structure:
configuration.nixcreated by NixOS installer but without the shared content. However, all the device specific things are stored here, such as finger print and touchpad on ThinkPad, and bluetooth configurations inrook(PC)- pure
hardware-configuration.nixwithout any modifications, because I'm not advanced yet to do anything with it yet. default.nixwhich just exports a result ofnixosSystemfunction from nixpkgs standart library.
Under certain circumstances, ThinkPad only at the time of writing:
power.nixcontains power management related configuration such astlp,powertopandpower-profile-daemons(currently disabled.)
shared/ folder contains following files:
default.nixcombines all the*.nixfiles inside shared folder and contains shared configuration that is too short to be written in a separate file.bootloader.nixfor boot loader options, I use GRUB, I wanted to customize it initially, but couldn't find a moment to do it yet.network.nix, as the name is self explanatory, it has very few lines, but I planned to extend it furthermore while learning, that's why I moved out network configuration beforehand.spicetify.nixcontains configurations of my spotify modified with spicetify to have better keyboard experience.- in
keyboard.nix, I have placedkanataconfiguration to activate home row mods and replace Caps Lock with Escape because of its original long distance from home row. kanata.kbdis the actual keyboard configurations used bykanata
Second folder by importance is home-manager which is as the name suggests, the
folder of my home-manager configurations. Surprisingly, my HM folder is so
simple and small. It only has 3 files:
shared.nix, the name may suggest that shared configs should be a lot, but it only contains singleimportsarray. It imports everything frommodulesall of which is shared configuration explained below.
The other two files are pc-home.nix and pad-home.nix which contains single
./shared.nix import, and single username and user path declaration. I tend to
have a single user per device, so I can keep my HM config as simple as possible.
My modules folder have application configurations, and the file names are self
explanatory except additions.nix:
✦ ❯ ee modules/
modules
├── additions.nix
├── alacritty.nix
├── astronvim.nix
├── chromium.nix
├── firefox.nix
├── fish.nix
├── ghostty.nix
├── git.nix
├── kitty.nix
├── lazygit.nix
├── litexl.nix
├── spotify.nix
├── starship.nix
├── vscode.nix
├── wezterm.nix
├── zellij.nix
└── zsh.nixadditions.nixcontains configuration of apps that I don't bother to modify a lot and are too simple to configure anyways, such asdirenv,btopandzoxide.
My packages folder have only 2 files, home.nix and system.nix with each of
them storing list of packages I need.
home.nixhashome.packagessystem.nixhasenvironment.systemPackages
As the name suggests, it keeps my neovim configurations that I have very
little idea how it works. It was configured solely by
Shakhzod Kudratov, my participance
included listening and learning it which I might have failed too.
Remaining folders don't have much impact, but I chose to document them because it is fun.
a_maidens_wish.pngis my wallpaper on all of my devices, which I found from my colleagues Telegram channel.- inside
fonts.nix, I tried to confiure my fonts declaratively, because San Francisco Mono was not available onnixpkgs, after some time I decided to give up and use the beautiful Iosevka instead. watershot.nixhas Shakhzod's attempt on making flameshot alternative, watershot work, but eventually failed, so I used another alternative calledGradiaanways.
In this folder, I just keep San Francisco's .otc files just in case I want to
try to make it work in the future.
With that being said, this is the total overview of my nihh repository. This
document will be updated further, but slowly.