spacegauch0/nixos-dotfiles
My personal NixOS configuration files with flakes + home-manager, wayland + hyprland, network-manager, kitty, zsh, neovim, rofi
Welcome to my NixOS config files!
NixOS is a fully reproducible operating system based on the Nix package manager. A good guide on NixOS can be found here.
๐ ๏ธ What I use
| What | Item |
|---|---|
| OS | NixOS \w Flakes && Home-Manager |
| Display Manager | Wayland |
| Compositor | HyprLand |
| Bar | Waybar |
| Notification Manager | Dunst |
| Audio | Pipewire |
| App Launcher | Rofi |
| Network | Network-Manager |
| Take Screenshots | Grim + Slurp + Wl-clipboard |
| Terminal Emulator | Kitty |
| Shell | Zsh |
| Wallpaper Manager | Hyprpaper |
| Email client | Thunderbird |
| Knowledge Management | Obsidian |
| File Manager | Thunar / Ranger |
| Editor | Neovim |
| Browser | Vivaldi |
| Change Brightness | Brightnessctl |
Vim plugins
| Name | Description |
|---|---|
| nvim-tree-lua | Directory Tree |
| vim-stratify | Fancy Start Screen |
| nerdtree | Another Directory tree |
| surround-nvim | Shortcut to surround a work with char |
| syntastic | Code syntax checking for a lot of languages |
| YouCompleteMe | Code completition for most languages |
| vim-airline | Bottom bar with some informations |
| emmet-vim | Amazing html completition |
| telescope-zoxide | Fuzzy finder |
| fine-cmdline | Better looking command line |
| nvim-colorizer-lua | Show hex colors immediately |
| gitsigns-nvim | Hilight text that has changes since last commit |
| copilot-nvim | Github's AI assistant |
๐ฉ My Hardware
๐ฅ๏ธ Computers
| Name | System | Role | Notes | User |
|---|---|---|---|---|
| Desktop | NixOS | Main workstation for computation and Gaming | i5-6500K 3.2 GHz, Nvidia 1060 3G, 16 GB ram DDR4, AC-Game Mechanical Keyboard, HP Monitor, Creative Speakers, Gaming Mouse | santo |
| Hp Laptop | NixOS | University Note taking and Programming when I'm outside | - | lanto |
| Laptop Acer | NixOS | Tests and Backups | - | santo |
| Computerino | Ubuntu Server | Backups and Server | - | santo |
| Laptop 3 | Archlinux | - | - | - |
| Laptop 4 | Debian | - | Too old to be useful | - |
๐ Devices
| Nome | Role | Notes |
|---|---|---|
| Kingdian SSD | Archlinux Boot | 100 GB |
| USB Stick | Installation Media | 8 GB |
| Samsung A13 | Main Phone | |
| Samusng J6 | Wifi Hotspot | |
| Launchpad S | App-launcher |
โจ๏ธ My keyboard configuration
I use home row with the following settings
(deflayer homerow
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 ssrq slck pause
grv 1 2 3 4 5 6 7 8 9 0 - = bspc ins home pgup nlck kp/ kp* kp-
tab q w e r t y u i o p [ ] ret del end pgdn kp7 kp8 kp9 kp+
caps @met_a @alt_s @ctl_d @sft_f @num_g h @sft_j @ctl_k @alt_l @met_; ' \ kp4 kp5 kp6
lsft 102d z x c v b n m , . / rsft up kp1 kp2 kp3 kprt
lctl lmet lalt spc ralt rmet cmp rctl left down rght kp0 kp.
)
(deflayer numbers
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ XX / 7 8 9 - _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ XX * 4 5 6 + _ _ _ _
_ _ _ _ _ _ XX 0 1 2 3 _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _
)
I'm looking forward to change keyboard layout soon
๐ช Use my config files
Clone my repo, then add .secrets/ directory with the file .secrets/github-access-token
Make sure there is no new line in the file (0x0a)
Build the system with with
sudo nixos-rebuild switch --flake .<profile-here> --impureOr with the build.sh script
./build.sh system <profile-here>impure lets you read gihub credentials from .secrets
I don't place my config in /etc/nixos/ but I have this repo on my home inside .config/nixos
๐๏ธ Structure
Take a look around (might not be updated to the lastest version)
โโโ build.sh # Easy to use build script
โโโ flake.lock # Lock file for flakes
โโโ flake.nix # All flakes profiles are defined here
โโโ home # Home Manager configurations
โย ย โโโ lanto # Minimal user with just the necessary stuff
โย ย โย ย โโโ default.nix
โย ย โย ย โโโ dev
โย ย โย ย โโโ default.nix
โย ย โย ย โโโ git.nix # Git configurations and setting up credentials
โย ย โโโ santo # Power user with many programs
โย ย โย ย โโโ default.nix
โย ย โย ย โโโ dev
โย ย โย ย โย ย โโโ default.nix
โย ย โย ย โย ย โโโ git.nix
โย ย โย ย โโโ programs
โย ย โย ย โโโ default.nix
โย ย โโโ shared # Pakages and configurations shared between users
โย ย โโโ default.nix
โย ย โโโ desktop
โย ย โย ย โโโ default.nix
โย ย โย ย โโโ hyprland.conf # Hyprland
โย ย โย ย โโโ hyprpaper.conf # Wallpapers
โย ย โย ย โโโ i3.nix
โย ย โย ย โโโ neofetch.nix
โย ย โย ย โโโ ranger.nix
โย ย โย ย โโโ rofi.nix
โย ย โย ย โโโ waybar.nix
โย ย โโโ dev
โย ย โย ย โโโ default.nix
โย ย โย ย โโโ neovim.nix # Neovim Plugins
โย ย โโโ shells
โย ย โโโ alacritty.nix
โย ย โโโ bash.nix
โย ย โโโ default.nix
โย ย โโโ fhs.nix # FHS filesystem
โย ย โโโ kitty.nix # I use kitty
โย ย โโโ shell.nix
โย ย โโโ zsh.nix
โโโ hosts # Configuration specific per machine
โย ย โโโ acer-laptop # Backup / Second Laptop
โย ย โย ย โโโ configuration.nix
โย ย โย ย โโโ default.nix
โย ย โย ย โโโ hardware-configuration.nix
โย ย โโโ desktop # Main workstation, nvidia drivers
โย ย โย ย โโโ configuration.nix
โย ย โย ย โโโ default.nix
โย ย โย ย โโโ hardware-configuration.nix
โย ย โโโ hp-laptop # Unversity note taking and programming
โย ย โโโ configuration.nix
โย ย โโโ default.nix
โย ย โโโ hardware-configuration.nix
โโโ misc # Some notes I took that I might need in future
โย ย โโโ powertop.md
โย ย โโโ screenshots
โย ย โโโ 01.jpg
โย ย โโโ 02.jpg
โย ย โโโ 03.jpg
โย ย โโโ 04.jpg
โโโ modules # System-wide configuration and packages
โย ย โโโ cache-server.nix
โย ย โโโ default.nix # All system packages
โย ย โโโ memory-optimization.nix
โย ย โโโ network-manager.nix
โย ย โโโ nvidia.nix # Nvidia settings
โย ย โโโ users.nix
โโโ README.md
โโโ wallpapers # A bunch of wallpapers
โโโ anime1.jpeg
โโโ anime2.jpeg
โโโ anime3.jpeg
โโโ fishing.png
โโโ free-as-in-freedom.jpeg
โโโ grass.jpg
โโโ lake.png
โโโ mountain.png
โโโ nixos-dark.png
โโโ nixos-light.png
โโโ only-grey.png
โโโ telescope.png
๐ home-manager
You can manage the user environment without sudo thanks to home manager. Inside flake.nix there is a profile for santo@home that imports the modules at home/santo/. You can build your profile with home-manager with this command:
home-manager switch --flake flake.nix#santo@home --impureOr with my build script
./build.sh home santo@home๐ nix-shell
For developement consistency, NixOS uses (enforces...) the use of nix-shell (or nix develop for flake configuration). You can create and enter into developement environment it with the command nix-shell. You can provide the packages with -p or use a configuration file like so:
modules/shell/shell.nix
{ pkgs ? import <nixpkgs> {} }: pkgs.mkShell {
nativeBuildInputs = with pkgs.buildPackages; [
libgcc
# cargo
# rustc
];
}See modules/shell/shell.nix for more information.
Example usage
nix-shell -p gcc
nix-shell /path/to/shell/configuration.nix
nix develop nixpkgs#gccWith nix develop you mantain in scope all your user programs
Run a FHS shell
nix-shell home/shared/fhs.nixRun Appimage
nix-shell -p appimage-run
[nix-shell]$ appimage-run <your-appimage>โฌ๏ธ Upgrade the system
nix flake update๐๏ธ Remove Garbage
Remove system versions and packages no longer used by new generations by 15 days
nix-channel --update
sudo nix-channel --update
sudo rm /nix/var/nix/gcroots/auto/*
nix-collect-garbage -d
sudo nix-collect-garbage -d
sudo nix-store --optimizeCreate a new module
Create a file such as main-user.nix
Then add It into the configuration.nix file
imports = [
./hardware-configuration.nix
./main-user.nix
]In main-user.nix
{ whatever, ... }:
{
# Config here
}Default
If you call a file default.nix, you can access It just bu importing It's folder
Finding options and functions
nix search nixpkgs <searchterm>๐ฅ Resources
Videos
https://www.youtube.com/watch?v=CwfKlX3rA6E
https://www.youtube.com/watch?v=a67Sv4Mbxmc
https://www.youtube.com/watch?v=1ED9b7ERTzI
Sites
https://search.nixos.org/options?channel=23.11&from=0&size=50&sort=relevance&type=packages&query=git
TODO
- Login Manager




