Skip to content

Lesson 09 — COSMIC and Hyprland

Two modern Wayland desktop options that come up a lot in the NixOS community. Both are worth knowing. Neither replaces the other — they're solving different problems.


X11 vs Wayland — The Context

Before getting into specifics: bspwm (lesson 07) runs on X11, the display system that's been around since 1984. COSMIC and Hyprland both run on Wayland, the modern replacement.

X11 Wayland
Age 1984 2008 (mainstream ~2021+)
Architecture One X server, all clients connect to it Compositor IS the display server
Security Any app can snoop on any other window Apps are isolated
Screen sharing / capture Works everywhere Needs portal support (mostly works now)
Fractional scaling Hacks and workarounds Native support
NVIDIA support Mature Improved a lot, mostly fine now

X11 still works fine — Ian runs bspwm on it. But for new setups in 2025+, Wayland is the direction everything is moving.


The Landscape

Full Desktop Environments      Compositors / Window Managers
(batteries included)           (build your own setup)
─────────────────────────      ──────────────────────────────
GNOME       (Wayland/X11)      Hyprland    (Wayland)
KDE Plasma  (Wayland/X11)      Sway        (Wayland, i3 clone)
COSMIC      (Wayland)          Wayfire     (Wayland)
XFCE        (X11)              bspwm       (X11)
                               i3          (X11)

COSMIC is in the left column — it's a complete desktop environment with its own file manager, text editor, terminal, app store, settings app, etc.

Hyprland is in the right column — it manages windows and compositing, but you assemble the rest yourself (bar, launcher, notifications, lock screen).


COSMIC

What is it?

COSMIC is a brand-new desktop environment built by System76 (makers of Pop!_OS) entirely in Rust. It targets power users who want a tiling-capable desktop without assembling everything from parts.

  • Hit stable 1.0 in December 2025 after ~18 months of alpha/beta
  • Wayland-native from the start
  • Built-in tiling window management (optional, toggled per-workspace)
  • Designed to feel like a proper desktop environment, not a minimal WM

What it looks like

COSMIC ships with its own complete application suite: - cosmic-files — file manager - cosmic-edit — text editor - cosmic-term — terminal - cosmic-store — app store (Flatpak) - cosmic-settings — system settings - cosmic-launcher — app launcher (Pop!_Shell style)

You get a complete desktop out of the box. The tiling is opt-in per-workspace — you can have floating workspaces and tiling workspaces side by side.

NixOS setup

NixOS 25.05 shipped Alpha 7. The stable 1.0 is in newer nixpkgs. Two options:

Option A — from nixpkgs (stable channel):

services.desktopManager.cosmic.enable = true;
services.displayManager.cosmic-greeter.enable = true;

That's it. NixOS wires everything up.

Option B — from the nixos-cosmic flake (bleeding edge):

The community flake lilyinstarlight/nixos-cosmic tracks upstream more closely. Add it to your flake inputs:

inputs.nixos-cosmic.url = "github:lilyinstarlight/nixos-cosmic";

Then in your NixOS config:

imports = [ inputs.nixos-cosmic.nixosModules.default ];

nix.settings = {
  substituters = [ "https://cosmic.cachix.org/" ];
  trusted-public-keys = [
    "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE="
  ];
};

services.desktopManager.cosmic.enable = true;
services.displayManager.cosmic-greeter.enable = true;

The Cachix cache avoids building COSMIC from source (which takes a long time). Ian's config already has this cache set up — you can see it in vendor/dotfiles-main/flake.nix.

COSMIC on the EliteBook 845

COSMIC is a strong candidate for the main setup. It handles AMD graphics well, has good touchpad support, and the tiling is gentler to learn than a pure tiling WM since you can toggle it per workspace.


Hyprland

What is it?

Hyprland is a dynamic tiling Wayland compositor — think bspwm's keyboard-driven philosophy, but Wayland-native with smooth animations, blur effects, and extensive customisation. It's the most popular choice in the NixOS ricing community.

  • Stable v0.55 as of May 2026
  • v0.55 introduced Lua as the config language (replacing the old hyprland.conf format — more on this below)
  • Very active development
  • Excellent NixOS support — the Hyprland team officially supports NixOS alongside Arch

Wimpy uses Hyprland as one of his two desktop options in nix-config-main — see vendor/nix-config-main/nixos/_mixins/desktop/hyprland/ and vendor/nix-config-main/home-manager/_mixins/desktop/compositor/hyprland/.

NixOS setup

programs.hyprland = {
  enable = true;
  withUWSM = true;       # recommended since NixOS 24.11
  xwayland.enable = true; # X11 app compatibility
};

withUWSM enables the Universal Wayland Session Manager, which handles proper session startup. It's been the recommended approach since 24.11.

If you also use Home Manager, add this to prevent conflicts:

wayland.windowManager.hyprland.systemd.enable = false;

Home Manager setup

wayland.windowManager.hyprland = {
  enable = true;
  settings = {
    # Your monitor (use `hyprctl monitors` to find the name)
    monitor = "eDP-1,2560x1600@120,0x0,1.6";

    # Startup programs
    exec-once = [
      "waybar"
      "dunst"
      "hyprpaper"
    ];

    # General appearance
    general = {
      gaps_in = 5;
      gaps_out = 10;
      border_size = 2;
      "col.active_border" = "rgba(88c0d0ff)";
    };

    # Animations
    animations = {
      enabled = true;
      bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
      animation = [
        "windows, 1, 7, myBezier"
        "fade, 1, 7, default"
        "workspaces, 1, 6, default"
      ];
    };

    # Keybindings — $mod is the Windows/Super key
    "$mod" = "SUPER";
    bind = [
      "$mod, Return, exec, ghostty"
      "$mod, Q, killactive"
      "$mod, Space, exec, rofi -show drun"
      "$mod, F, fullscreen"
      "$mod, V, togglefloating"
      # Move focus
      "$mod, H, movefocus, l"
      "$mod, L, movefocus, r"
      "$mod, K, movefocus, u"
      "$mod, J, movefocus, d"
      # Switch workspaces
      "$mod, 1, workspace, 1"
      "$mod, 2, workspace, 2"
      "$mod, 3, workspace, 3"
      # Move window to workspace
      "$mod SHIFT, 1, movetoworkspace, 1"
      "$mod SHIFT, 2, movetoworkspace, 2"
    ];

    # Mouse bindings (for floating windows)
    bindm = [
      "$mod, mouse:272, movewindow"
      "$mod, mouse:273, resizewindow"
    ];

    # Window rules
    windowrulev2 = [
      "float, class:pavucontrol"
      "float, class:nm-connection-editor"
      "workspace 2, class:firefox"
    ];
  };
};

The Lua config transition

As of v0.55, Hyprland moved to Lua as its config language. The old hyprland.conf format still works for now but will be removed in a future version.

The Home Manager module is catching up — check the current state before relying on the settings = {} attribute set above, as the module may need extraLua for some options in the meantime.

The Lua config lives at ~/.config/hypr/hyprland.lua when generated.

What else you need with Hyprland

Same story as bspwm — Hyprland only manages windows. You assemble the rest:

Need Wayland-compatible options
Status bar waybar (most popular), eww
App launcher rofi (with Wayland patch), wofi, fuzzel
Notifications mako, dunst
Wallpaper hyprpaper, swww
Screen lock hyprlock (official), swaylock
Screenshots hyprshot, grimblast, grim + slurp
Clipboard wl-clipboard, cliphist
Polkit agent polkit-kde-agent, hyprpolkitagent

The Hyprland project now ships its own versions of several of these: hyprlock, hyprpaper, hypridle, hyprshot. Using the official ones reduces compatibility headaches.

Electron apps on Wayland

Electron apps (VS Code, Slack, Discord, etc.) default to X11 mode even on Wayland. Fix it with one environment variable:

environment.sessionVariables.NIXOS_OZONE_WL = "1";

Add this to your NixOS config and all Electron apps use Wayland natively.


Comparing the Three Options

bspwm (lesson 07) Hyprland COSMIC
Display system X11 Wayland Wayland
Type Window manager Compositor / WM Full desktop environment
Tiling style Binary space partitioning Dynamic tiling Optional tiling (per-workspace)
Learning curve Steep — assemble everything Moderate — assemble most things Low — works out of the box
Customisation Total control Total control Limited to COSMIC's settings
Animations None Extensive Built-in
Config language Shell scripts + sxhkd Lua (v0.55+) / attrsets in Nix GUI settings + Nix options
Nixpkgs support Stable Stable (uses own Cachix) Stable (25.05+)
Real-world example Ian's dotfiles Wimpy's nix-config Ian's flake has cosmic.cachix.org

What to Try First

If you want something that just works on the EliteBook with minimal fuss → start with COSMIC. It's a complete desktop and the NixOS integration is two lines.

If you want to build your own environment and learn how everything fits together → Hyprland is the modern choice. The NixOS/Home Manager support is excellent and the community is very active.

bspwm is still valid if you prefer X11, but for a fresh NixOS setup in 2025+ Wayland is the better foundation.


Sources