Niri scrolling wayland compositor config

{
  pkgs,
  lib,
  config,
  ...
}:
let
  cfg = config.mjm.desktop;
in
{
  options.mjm.desktop = {
    niri.enable = lib.mkEnableOption "Niri scrolling wayland compositor";
  };

  config = lib.mkIf (cfg.enable && cfg.niri.enable) {
    environment.systemPackages = [
      <<packages>>
    ];

    <<config>>
  };

  _class = "nixos";
}

Niri is my current Linux desktop environment of choice. Scrolling window management is a game changer, and Niri is the best of version of that I've used.

Note that this module is not all of the configuration for Niri. Some of it happens on in the desktop module on the home-manager side.

programs.niri.enable = true;
services.displayManager.defaultSession = "niri";

Enables Niri, which makes it an available Wayland session, and then sets that session as the default in the display manager.

pkgs.noctalia-shell
pkgs.adw-gtk3
qt = {
  enable = true;
  platformTheme = "qt5ct";
};

To avoid needing to build an entire desktop environment from small pieces, I use Noctalia shell to provide most of the things you expect to have in a desktop shell. I also install the Adwaita GTK3 theme and enable the qt5ct theme for Qt, as Noctalia is equipped to customize both of these to look correct with a chosen color scheme. It's not perfect but it does the job well enough.

pkgs.nautilus
programs.niri.useNautilus = true;
services.gvfs.enable = true;

With Niri, I use Nautilus as a file manager. The useNautilus option for Niri sets up the file chooser portal to use it, but for some reason it doesn't actually install the package on the system, so I also do that.

GVfs is used to be able to connect to network file servers from Nautilus.

pkgs.xwayland-satellite

To be able to run X11 applications, Niri needs xwayland-satellite available, as it doesn't build in support for Xwayland like some other compositors do.

services.power-profiles-daemon.enable = true;

I think power-profiles-daemon is currently the best option for power management on Linux desktops.

services.upower.enable = true;

UPower enables the machine to respond to things like battery state or the laptop lid closing.

programs.seahorse.enable = true;

Seahorse is a GUI tool for managing items stored in gnome-keyring. The NixOS Niri module enables gnome-keyring by default, so I don't need to do that here, but it's useful to have a UI to see what's in there.

programs.gnupg.agent.enable = true;

I don't use GnuPG, but other things use the pinentry command that's configured for it to prompt for things like passphrases. If the agent isn't enabled, the config file where that pinentry command is set will not be written.

security.pam.services.login.fprintAuth = false;

I don't want to use a fingerprint sensor to login. I'm either going to be auto-login, or I will be relying on my password being entered to unlock gnome-keyring. Either way, fingerprint login is not desirable.

Proxy Information
Original URL
gemini://midna.dev/homelab/modules/nixos/desktop/niri.gmi
Status Code
Success (20)
Meta
text/gemini;lang=en-US
Capsule Response Time
21.266415 milliseconds
Gemini-to-HTML Time
0.269548 milliseconds

This content has been proxied by September (UNKNO).