NixOS is a fully reproducible operating system based on the Nix package manager. A good guide on NixOS can be found here.
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 |
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 |
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 | - |
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 |
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
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> --impure
Or 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
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
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 --impure
Or with my build script
./build.sh home santo@home
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#gcc
With nix develop
you mantain in scope all your user programs
nix-shell home/shared/fhs.nix
nix-shell -p appimage-run
[nix-shell]$ appimage-run <your-appimage>
nix flake update
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 --optimize
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
}
If you call a file default.nix
, you can access It just bu importing It's folder
nix search nixpkgs <searchterm>
https://www.youtube.com/watch?v=CwfKlX3rA6E
https://www.youtube.com/watch?v=a67Sv4Mbxmc
https://www.youtube.com/watch?v=1ED9b7ERTzI
https://search.nixos.org/options?channel=23.11&from=0&size=50&sort=relevance&type=packages&query=git
- Login Manager