-
Notifications
You must be signed in to change notification settings - Fork 0
Customization Guide
NullOS is designed to be highly customizable while remaining declarative and reproducible. This guide covers the main ways to customize your system.
NullOS uses a layered configuration approach:
-
variables.nix- High-level per-machine settings -
home/- User-level configurations (Home Manager) -
modules/- System-level configurations (NixOS) -
flake.nix- System integration and inputs
✅ Essential Configuration (in variables.nix):
- Username and hostname
- Git credentials
- Keyboard layout and timezone
- Default applications (terminal, browser)
- Monitor configuration
- Wallpaper path
✅ Desktop Customization:
- Waybar configuration
- Hyprland keybindings
- Animation settings
- Theme and colors (via Stylix)
✅ Application Management:
- System packages
- Home Manager packages
- Service configuration
The variables.nix file is your main configuration hub. See Variables Reference for all options.
browser = pkgs.firefox; # Instead of pkgs.braveextraMonitorSettings = "
monitor = DP-1, 2560x1440@144, 0x0, 1
monitor = HDMI-A-1, 1920x1080@60, 2560x0, 1
";useNvidiaPrime = false;Waybar can be customized by modifying the configuration file:
- Edit
home/waybar/default.nix - Rebuild with
sudo nixos-rebuild switch --flake .#yourhostname
Common customizations:
- Add/remove modules (clock, CPU, memory, etc.)
- Change module positions (left, center, right)
- Customize styling and colors
- Add custom scripts
Edit home/hyprland/binds.nix to customize keybindings:
bind = $mainMod, Return, exec, ghostty # Terminal
bind = $mainMod, W, exec, brave # Browser
bind = $mainMod, E, exec, dolphin # File managerTip: Press SUPER + K to view all current keybindings!
NullOS includes custom animation sets. To change:
# In variables.nix
animationSet = home/hyprland/animations-end4.nix;Create your own animation file in home/hyprland/ and reference it.
Modify home/hyprland/windowrules.nix to customize window behavior:
windowrulev2 = float, class:^(pavucontrol)$
windowrulev2 = size 800 600, class:^(pavucontrol)$
windowrulev2 = center, class:^(pavucontrol)$Stylix provides system-wide theming based on your wallpaper.
# In variables.nix
stylixImage = wallpapers/your-wallpaper.jpg;If you want specific colors instead of auto-generated:
# In home/stylix.nix
stylix.base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-medium.yaml";# In home/default.nix
stylix.targets = {
vscode.enable = false; # Keep VSCode theme
firefox.enable = false; # Keep Firefox theme
};Edit modules/software/packages.nix:
environment.systemPackages = with pkgs; [
# Add your packages here
btop
neofetch
vlc
];Edit home/default.nix:
home.packages = with pkgs; [
# Add user-level packages
discord
spotify
obs-studio
];Tip: See Adding Applications for detailed guide.
Edit modules/services/services.nix:
services.tailscale.enable = true; # Enable Tailscale VPN
services.printing.enable = false; # Disable printingservices.ollama = {
enable = true;
acceleration = "cuda"; # Use NVIDIA GPU
};services.sunshine = {
enable = true;
openFirewall = true;
capSysAdmin = true;
};Edit home/git.nix for advanced Git settings:
programs.git = {
enable = true;
userName = "Your Name";
userEmail = "you@email.com";
aliases = {
st = "status";
co = "checkout";
br = "branch";
};
extraConfig = {
init.defaultBranch = "main";
pull.rebase = true;
};
};Edit home/ghostty.nix:
programs.ghostty = {
enable = true;
settings = {
font-family = "JetBrainsMono Nerd Font";
font-size = 12;
theme = "gruvbox";
window-padding-x = 10;
window-padding-y = 10;
};
};Edit home/starship.nix to customize your shell prompt.
Add custom aliases and functions in home/zsh/zshrc-personal.nix:
programs.zsh.initExtra = ''
alias ll='ls -lah'
alias gs='git status'
function mkcd() {
mkdir -p "$1" && cd "$1"
}
'';NullOS uses NVF for Neovim configuration. Edit home/nvf.nix:
programs.nvf = {
enable = true;
settings = {
vim = {
# Your Neovim config
viAlias = true;
vimAlias = true;
theme.enable = true;
};
};
};Edit home/vscode.nix:
programs.vscode = {
enable = true;
extensions = with pkgs.vscode-extensions; [
jnoortheen.nix-ide
github.copilot
# Add more extensions
];
userSettings = {
"editor.fontSize" = 14;
"editor.fontFamily" = "JetBrains Mono";
};
};For managing multiple machines, see Per Machine Config.
Create boot-time variants in your hardware configuration:
specialisation = {
nvidia-on.configuration = {
# NVIDIA enabled config
};
nvidia-off.configuration = {
# Integrated graphics only
};
};Edit modules/services/backup.nix:
services.restic = {
backups = {
daily = {
repository = "sftp:user@server:/backups";
passwordFile = "/path/to/password";
paths = [
"/home/${username}"
];
exclude = [
"/home/${username}/.cache"
"**/.git"
];
timerConfig = {
OnCalendar = "daily";
};
};
};
};NullOS includes direnv support. Create a .envrc in your project:
use flakeOr for specific packages:
use nixCreate a shell.nix in your project:
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
buildInputs = with pkgs; [
nodejs
python3
rust-bin.stable.latest.default
];
}Edit flake.nix to change or add inputs:
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
# Add custom input
my-package.url = "github:user/my-package";
};Create a new file in modules/ and import it in the appropriate default.nix:
# modules/software/my-custom-app.nix
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
my-custom-package
];
# Additional configuration
}Then import in modules/software/default.nix:
imports = [
./my-custom-app.nix
];Test changes without making them permanent:
sudo nixos-rebuild test --flake .#yourhostnamesudo nixos-rebuild build --flake .#yourhostnamenix flake checkIf something breaks:
- Reboot
- Select previous generation from GRUB menu
- System boots with old configuration
sudo nix-env --list-generations --profile /nix/var/nix/profiles/systemsudo nix-env --switch-generation 42 --profile /nix/var/nix/profiles/system
sudo /nix/var/nix/profiles/system/bin/switch-to-configuration switch- Start Small - Make one change at a time
-
Test First - Use
nixos-rebuild testbefore switching - Document Changes - Add comments explaining why you changed something
- Use Git - Commit working configurations
- Check Nixpkgs - Search https://search.nixos.org for packages and options
- Read Source - Look at the actual Nix files to understand how things work
- Variables Reference - Complete list of all variables
- Adding Applications - Detailed guide for adding software
- Hyprland - Deep dive into Hyprland configuration
- Theming - Advanced theming techniques
- Troubleshooting - Fix common issues