-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
Complete guide to installing NullOS on your system.
Before installing NullOS, ensure you have:
- ✅ A working NixOS installation
- ✅ Git installed (
nix-shell -p git) - ✅ Nix flakes enabled
- ✅ Basic familiarity with NixOS concepts
If you haven't already enabled flakes, add this to /etc/nixos/configuration.nix:
nix.settings.experimental-features = [ "nix-command" "flakes" ];Then rebuild:
sudo nixos-rebuild switchClone NullOS to your home directory or preferred location:
git clone https://github.com/yourusername/NullOS.git ~/NullOS
cd ~/NullOSNullOS uses a variables.nix file for per-machine configuration.
cp variables.nix.example variables.nixOpen variables.nix and customize:
{ nixpkgs, ... }:
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
in
{
# User Configuration
username = "youruser";
hostname = "yourhostname";
gitUsername = "Your Name";
gitEmail = "your@email.com";
# System
system = "x86_64-linux";
timeZone = "Europe/London";
locale = "en_GB.UTF-8";
keyboardLayout = "gb";
consoleKeyMap = "uk";
# Applications
terminal = "ghostty";
browser = pkgs.brave; # or pkgs.firefox, pkgs.chromium
# NVIDIA (for hybrid graphics laptops)
useNvidiaPrime = false; # Set to true if you have NVIDIA + Intel
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:2:0:0";
# Theming
stylixImage = wallpapers/screen.jpg;
waybarConfig = home/waybar/default.nix;
animationSet = home/hyprland/animations-end4.nix;
# Backup (optional)
resticRepository = "sftp:user@host:/backup/path";
# Monitor Configuration
extraMonitorSettings = "
monitor = eDP-1, 1920x1080@60,auto,1
";
# Printing
printEnable = true;
printDrivers = [ ];
# Hardware
add_rtl8852cu = false;
}See Variables Reference for detailed explanations of all options.
Generate hardware configuration for your machine:
sudo nixos-generate-config --show-hardware-config > /tmp/hardware.nixCreate a hardware configuration file for your new machine. You can start by copying an existing configuration as a template:
cp modules/system/hardware_nslapt.nix modules/system/hardware_yourhostname.nixThen, open modules/system/hardware_yourhostname.nix and update the hardware-specific sections using the content from /tmp/hardware.nix generated in the previous step.
Key sections to update:
boot.initrd.availableKernelModulesboot.kernelModules-
fileSystems(ensure UUIDs match your system) swapDevices-
networking.hostName(set to "yourhostname")
Edit flake.nix to add your machine (or modify an existing configuration):
nixosConfigurations = {
yourhostname = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit vars;
inherit inputs;
inherit home-manager;
};
pkgs = import nixpkgs {
inherit system;
overlays = overlays;
config = {
allowUnfree = true;
android_sdk.accept_license = true;
};
};
modules = [
inputs.home-manager.nixosModules.home-manager
{
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup";
home-manager.extraSpecialArgs = {
inherit vars;
inherit inputs;
username = vars.username;
};
home-manager.users.${username} = {
imports = [
inputs.stylix.homeModules.stylix
./home/default.nix
];
home = {
username = "${username}";
homeDirectory = "/home/${username}";
stateVersion = "26.05";
};
};
}
{
users.mutableUsers = true;
users.users.${username} = {
isNormalUser = true;
description = "${vars.gitUsername}";
extraGroups = [
"kvm" "adbusers" "docker" "libvirtd" "lp"
"networkmanager" "scanner" "wheel" "dialout" "audio"
];
shell = nixpkgs.legacyPackages.${system}.zsh;
ignoreShellProgramCheck = true;
};
nix.settings.allowed-users = [ "${username}" ];
}
./modules/misc
./modules/services
./modules/software
./modules/system
./modules/system/hardware_yourhostname.nix
];
};
};Now build and switch to your new configuration:
sudo nixos-rebuild switch --flake .#yourhostnameIf you have git-ignored files (like variables.nix), use:
sudo nixos-rebuild switch --flake .#yourhostname --impure- Takes time: First build downloads and builds many packages
- Large download: Expect several GB of downloads
- Check logs: Watch for errors during build
- Don't panic: If it fails, read the error message carefully
After successful build:
- Reboot your system:
sudo reboot - You should see SDDM login manager
- Login with your user account
- Hyprland should start automatically
After logging in, proceed to First Steps to:
- Set your password
- Configure wallpapers
- Learn keybindings
- Customize your environment
Make sure all files are tracked in git or use --impure flag:
git add -A
# or
sudo nixos-rebuild switch --flake .#yourhostname --impureCheck your hostname matches what you defined in flake.nix:
hostname # Should match the name in flake.nixEnsure you're using sudo for nixos-rebuild:
sudo nixos-rebuild switch --flake .#yourhostnameIf you have NVIDIA hardware, see NVIDIA configuration guide.
If hardware isn't detected properly:
- Check your hardware config has all necessary modules
- Review
boot.initrd.availableKernelModules - Ensure filesystem UUIDs are correct
If you have an existing NixOS installation:
- Backup your current
/etc/nixos/configuration.nix - Follow steps above
- Can mix old config with NullOS by importing your old config as a module
For a fresh NixOS installation:
- Install NixOS using official installer
- Clone NullOS during first boot
- Follow this guide
- First Steps - Initial configuration
- Customization Guide - Make it yours
- Hyprland - Learn the window manager
Need help? Check Troubleshooting or open an issue on GitHub.