Profiles

A profile is a composable feature toggle. Each one wires up a whole subsystem – the daemon, the user groups, the packages, and (for the desktop) the home-manager dotfiles – from a single line in your config.nix:

my.profiles.libvirt.enable = true;

You choose which profiles to switch on when you run setup host (the multi-select prompt), and you can enable or disable any of them later by editing ~/nixos/config.nix and re-applying with admin upgrade. There is no separate “minimal vs sway” install mode: a minimal server is simply a host with no profiles enabled, and every option – including the whole desktop – is one of these toggles.

The available profiles

  • dotfiles – your shell/CLI home environment with no GUI: the sway-home bashrc, the ~/bin scripts, the ~/.config dotfiles, git config, emacs, the vm command’s setup, and the command-line package toolbox (ripgrep, fzf, bat, just, babashka, docker, kubectl, and so on). This is what you want on a headless server that you still live in over SSH.
  • sway – the full Sway desktop: a Wayland login greeter, the Sway compositor, fonts, firefox, and the Wayland desktop package set (waybar, foot, rofi, grim, …). Enabling sway implies dotfiles, so a desktop gets the shell environment too – you don’t need to tick both.
  • sound – PipeWire audio (ALSA + PulseAudio compatibility). Nothing else in sway-home enables sound, so a desktop that wants audio needs this.
  • podman – Podman containers (Docker-compatible), with container DNS.
  • flatpak – Flatpak with the Flathub remote pre-added, ready for flatpak install flathub <app>.
  • libvirt – libvirt/KVM virtualization: virt-manager and the vm command (nixos-vm-template). It also adds your user to the libvirtd group.

Each profile is a module under nixos/modules/profiles/ in sway-home. They are always imported but do nothing until their flag is set, so enabling one never requires touching flake.nix.

Enabling a profile

The config.nix that setup host generated already lists every profile as a commented example. Open ~/nixos/config.nix and uncomment the one(s) you want:

# --- Profiles (sway-home) ---
# my.profiles.sway.enable    = true;   # Sway desktop
# my.profiles.sound.enable   = true;   # PipeWire audio
# my.profiles.podman.enable  = true;   # Podman containers (Docker-compatible)
# my.profiles.flatpak.enable = true;   # Flatpak + Flathub remote
my.profiles.libvirt.enable = true;     # <-- enabled

Then commit and apply:

[bash]: Run this on your workstation:
git -C ~/nixos commit -am "Enable the libvirt profile"
admin upgrade
tip

A profile that adds you to a group (libvirt adds you to libvirtd) only takes effect on your next login, since group membership is established at login. Log out and back in (or reboot) before using virsh or the vm command – otherwise you’ll get a permission error reaching the libvirt socket.

The Sway desktop

sway is the largest profile: enabling it is the difference between a headless server and a full graphical workstation. It turns on the system desktop (the Wayland login greeter and the Sway compositor) and your complete home-manager user environment.

my.profiles.sway.enable = true;
[bash]: Run this on your workstation:
git -C ~/nixos commit -am "Enable the sway profile"
admin upgrade

This downloads and builds the desktop closure (the first build is large), enables the greetd login manager, and installs your home-manager environment. When it finishes, reboot to land on the graphical greeter; log in and you are in Sway.

tip

Want to preview the desktop without committing to it across reboots? Use admin test instead of admin upgrade. The test generation is temporary and is not added to the boot menu, so a reboot returns you to your previous system.

Turning a profile off

Reverting is symmetric: set the flag back to false (or re-comment the line), commit, and admin upgrade. Because every profile is gated internally, disabling it removes everything it added. For sway that includes the dotfiles home-manager wrote into your home directory (~/.config/sway, the desktop scripts in ~/bin, and so on) – home-manager stays active and prunes what it no longer manages, so the next boot is a clean headless server again, with no leftovers to tidy by hand.

// settings
theme:
fx: