My personal NixOS configuration
Overview | Structure | Machines | Setup | Usage
My personal NixOS configuration as a Nix flake, with Home Manager for dotfiles and software. Includes a common base config and opt-in modules, consumed via machine profiles.
| Flake input | Description |
|---|---|
nixpkgs 26.05 |
NixOS packages |
home-manager 26.05 |
User environment & dotfiles |
| nix-flatpak | Declarative Flatpak installs |
| nix-vscode-extensions | VSCodium extensions |
nix/
├── flake.nix # Flake definition and inputs
├── common.nix # Base config, shared by all machines
├── machines/
│ └── <hostname>/ # Machine-specific settings
│ ├── default.nix
│ └── hardware-configuration.nix
├── modules/ # Opt-in features
├── profiles/
│ └── workstation.nix # Full desktop
└── assets/
All machines include fish shell, starship prompt, direnv + nix-direnv, git, docker, nh, and a curated set of CLI tools via the shared common.nix config.
| Hostname | Profile | Type |
|---|---|---|
vm |
workstation | Virtual machine |
thinkpad |
workstation | Laptop |
brick |
workstation | Desktop |
gigabyte |
workstation | Desktop |
Note
Requires an fresh/existing NixOS installation.
nix-shell -p git
git clone https://github.com/FjellOverflow/nix.git ~/nix && cd ~/nix
# Create a machine config
mkdir machines/<hostname>
sudo cp /etc/nixos/configuration.nix machines/<hostname>/default.nix
sudo cp /etc/nixos/hardware-configuration.nix machines/<hostname>/hardware-configuration.nix
sudo chown $(whoami): machines/<hostname>/*
# Adapt machines/<hostname>/default.nix (see existing machines/ for reference)
# Replace /etc/nixos with this repo
sudo rm -rf /etc/nixos
sudo ln -s ~/nix /etc/nixos
# Build and switch
sudo nixos-rebuild switch --flake /etc/nixos#<hostname>git pull && nh os switchnh clean all