- Nix 99.7%
- Makefile 0.3%
| hosts | ||
| img | ||
| modules | ||
| .gitignore | ||
| flake.lock | ||
| flake.nix | ||
| Makefile | ||
| README.md | ||
NixOS Configuration
Personal NixOS configuration using flakes and home-manager.
Overview
This repository contains declarative NixOS configurations for multiple machines, organized into modular components for easy maintenance and reusability.
Machines
- ghost - Desktop system (user: damyr)
- lapwar - Laptop system with professional tools (user: thomas)
Project Structure
.
├── flake.nix # Main flake configuration
├── hosts/ # Host-specific configurations
│ ├── ghost/
│ │ └── configuration.nix
│ └── waays/
│ ├── configuration.nix
│ └── disko.nix
└── modules/ # Modular configuration components
├── core/ # System-level configuration
│ ├── default.nix
│ ├── user.nix
│ ├── packages.nix
│ ├── security.nix
│ ├── services.nix
│ └── system.nix
├── desktop/ # Desktop environments
│ ├── default.nix
│ ├── gnome.nix
│ └── hyprland.nix
├── home/ # Home-manager configurations
│ ├── default.nix
│ ├── home.nix
│ ├── home-manager.nix
│ ├── kitty.nix
│ ├── neovim.nix
│ └── zellij.nix
└── pro/ # Professional laptop configuration
├── default.nix
├── packages.nix # Pro laptop packages
└── ssh.nix # SSH configuration
Module Organization
Core Modules
System-level configuration shared across all machines:
- user.nix - User account configuration
- packages.nix - Base system packages
- security.nix - Security settings (AppArmor, firewall, etc.)
- services.nix - System services
- system.nix - Basic system settings (timezone, locale, networking)
Desktop Modules
Desktop environment configurations:
- gnome.nix - GNOME desktop environment
- hyprland.nix - Hyprland window manager
Home Modules
User-level configurations via home-manager:
- home.nix - Shell configuration (zsh, starship, aliases)
- kitty.nix - Kitty terminal emulator
- neovim.nix - Neovim editor
- zellij.nix - Zellij terminal multiplexer
Pro Modules
Professional laptop configurations (lapwar only):
- packages.nix - Professional tools (Framework laptop utilities, Mattermost, etc.)
- ssh.nix - SSH configuration
Installation
Initial Setup
- Clone this repository:
git clone <repository-url> ~/nixos-config
cd ~/nixos-config
- Build the configuration for your machine:
sudo nixos-rebuild switch --flake ~/nixos-config#<hostname>
Replace <hostname> with either ghost or lapwar.
Using the Alias
After the first rebuild, you can use the convenient alias:
nixupgrade
This automatically rebuilds the system for the current hostname.
Making Changes
Adding System Packages
Edit modules/core/packages.nix and add packages to the environment.systemPackages list:
environment.systemPackages = with pkgs; [
# Your new package here
package-name
];
Adding User Packages
Edit modules/home/home.nix and add packages to the home.packages list:
home.packages = with pkgs; [
package-name
];
Adding Professional Packages (lapwar only)
Edit modules/pro/packages.nix:
home.packages = with pkgs; [
package-name
];
Modifying Shell Aliases
Edit the shellAliases section in modules/home/home.nix:
shellAliases = {
alias-name = "command";
};
Features
System Configuration
- OS: NixOS 25.11
- Shell: Zsh with starship prompt
- Terminal: Kitty with custom light theme
- Editor: Neovim with custom configuration
- Desktop: GNOME (configurable)
- Security: AppArmor, ClamAV, automatic updates
- Garbage Collection: Automatic cleanup of old generations (7 days)
Development Tools
- Languages: Python, Node.js, Go, Ruby
- DevOps: kubectl, k9s, terraform, opentofu, helm
- Cloud: Google Cloud SDK, OpenStack client, Scaleway CLI
- Containers: Podman, buildah, podman-compose
- Virtualization: virt-manager, vagrant
Key Packages
tree- Directory structure visualizationripgrep- Fast text searchfzf- Fuzzy finderkubectl/k9s- Kubernetes managementterraform/opentofu- Infrastructure as Codepass- Password managerclaude-code- AI development assistant
Professional Tools (lapwar)
mattermost-desktop- Team communicationframework-tool- Framework laptop utilitiesframework-tool-tui- Framework laptop TUIcrush- Shell scripting helper
Git Configuration
The configuration includes global git settings:
- Editor: neovim
- GPG Signing: SSH key signing enabled
- Useful aliases:
lg(pretty log),am(amend) - Pull strategy: rebase
Customization
Changing Theme
The Kitty terminal uses a light theme (One Light inspired). To modify:
nvim modules/home/kitty.nix
Changing Desktop Environment
Currently configured for GNOME. To switch to Hyprland or add another DE, modify the imports in your host-specific configuration.
Adding a New Machine
- Create a new directory in
hosts/:
mkdir -p hosts/new-machine
-
Create
hosts/new-machine/configuration.nix -
Add the configuration to
flake.nix:
new-machine = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
username = "your-username";
hostname = "new-machine";
};
modules = [
./hosts/new-machine/configuration.nix
./modules/core
./modules/desktop
./modules/home
# Add other modules as needed
];
};
Maintenance
Update Flake Inputs
nix flake update
Garbage Collection
Automatic garbage collection runs periodically, removing generations older than 7 days.
Manual garbage collection:
sudo nix-collect-garbage --delete-older-than 7d
List Generations
sudo nix-env --list-generations --profile /nix/var/nix/profiles/system
Rollback
sudo nixos-rebuild switch --rollback
Troubleshooting
Build Fails
- Ensure all files are tracked by git (flakes only include tracked files)
- Check for syntax errors in nix files
- Use
--show-tracefor detailed error messages:
sudo nixos-rebuild build --flake ~/nixos-config#<hostname> --show-trace
Git Permission Issues
If you encounter git permission errors:
sudo chown -R $USER:users ~/nixos-config/.git
License
Personal configuration - use at your own risk.
Credits
- NixOS: https://nixos.org
- Home Manager: https://github.com/nix-community/home-manager
- Disko: https://github.com/nix-community/disko
