Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NixOS Sway Configuration

A modular NixOS flake configuration with Sway window manager, Home Manager integration, hybrid graphics support, and theme switching capabilities.

Warning

Unverified on a clean install. This config runs on my own machine, but I have not tested it end to end from a fresh NixOS install. Applying it as-is on your hardware may fail or leave your system in a broken state. Read every file before running anything, especially nixos/hardware.nix (NVIDIA bus IDs) and nixos/users.nix (accounts, sudo). Use at your own risk.

Structure

.
├── flake.nix                 # Root flake definition
├── nixos/                    # NixOS system configuration
│   ├── configuration.nix     # Main system configuration
│   ├── hardware.nix         # Hardware configuration (NVIDIA hybrid graphics)
│   ├── system.nix           # System settings (timezone, locale)
│   ├── users.nix            # User configuration
│   ├── services.nix         # System services
│   ├── graphics.nix         # Graphics settings
│   └── packages.nix         # System packages
└── home/                     # Home Manager configuration
    ├── home.nix             # Main home configuration
    ├── programs.nix         # Program configurations
    ├── packages.nix         # User packages
    ├── theme.nix            # Theme switching setup
    ├── theme-switch.sh      # Theme switching script
    ├── sway/                # Sway window manager
    │   ├── sway.nix         # Sway module
    │   └── config            # Sway configuration file
    └── waybar/              # Waybar status bar
        ├── waybar.nix       # Waybar module
        ├── config           # Waybar JSON configuration
        ├── style.css        # Dark theme CSS
        └── style-light.css  # Light theme CSS

Features

  • Sway Window Manager: Tiling window manager for Wayland
  • Hybrid Graphics: NVIDIA Prime offloading support (Intel UHD 630 / NVIDIA GTX 1660 Ti)
  • Theme Switching: Toggle between dark and light themes (Mod+Shift+t)
  • Development Tools: VS Code, Chrome, Python, Node.js, Rust, Go
  • Minimalist Aesthetics: Clean, dark theme by default

Usage

Installing on a fresh machine? See INSTALL.md for a full walkthrough (disk partitioning, bus ID detection, first boot).

Building the Configuration

# Build NixOS configuration
sudo nixos-rebuild switch --flake .#nixos-laptop

# Build Home Manager configuration
home-manager switch --flake .#user

Theme Switching

Press Mod+Shift+t to toggle between dark and light themes. The theme preference is saved and restored on startup.

Configuration

NVIDIA Bus IDs

You may need to adjust the NVIDIA bus IDs in nixos/hardware.nix. Find your bus IDs with:

lspci | grep VGA

Update the nvidiaBusId and intelBusId accordingly.

User Configuration

Edit nixos/users.nix to change the default username and groups.

Security Note: The default configuration sets security.sudo.wheelNeedsPassword = false, which allows passwordless sudo for the wheel group. For multi-user systems or enhanced security, consider setting this to true or using security.sudo.extraRules for more granular control.

Packages

  • System packages: nixos/packages.nix
  • User packages: home/packages.nix

Requirements

  • NixOS with flakes enabled
  • Home Manager
  • NVIDIA graphics card with Prime offloading support

About

Modular NixOS flake: Sway (Wayland), Home Manager, NVIDIA Prime hybrid graphics, and dark/light theme switching.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages