Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Desktop

Platforms: NixOS only, apart from othrys.desktop.graphical, which defaults to true on nix-darwin, and othrys.theme. See Darwin.

Desktop environment modules under othrys.desktop.*. Handles compositors, status bar, and session management.

Colours and fonts come from othrys.theme, see Theming.

Available Modules

ModuleOptionDescription
Ashellothrys.desktop.ashellGPU-accelerated status bar, coloured from othrys.theme
Hyprlandothrys.desktop.compositors.hyprlandWayland compositor (dynamic tiling)
Niriothrys.desktop.compositors.niriWayland compositor (scrollable tiling)
Idleothrys.desktop.idleStaged idle management (dim, lock, screen off, suspend)
Keyringothrys.desktop.keyringSecret Service provider (gnome-keyring or pass), on by default on a graphical host
Loginothrys.desktop.logingreetd login manager (tuigreet or cosmic-greeter)
Night lightothrys.desktop.nightLightColor temperature shifting (gammastep)
UWSMothrys.desktop.uwsmSystemd session management for Wayland
Vicinaeothrys.desktop.vicinaeLauncher in the style of Raycast, run as a user server and opened from the launcher chord
Wallpaperothrys.desktop.wallpaperDraws othrys.theme.wallpaper with wpaperd, on by default where a compositor runs and a wallpaper is declared

Ashell

Status bar for Hyprland or Niri. Either compositor satisfies its assertion, and the lock and logout commands follow the session that is running, as described under Sessions. Installed from the ashell flake this library locks, or from othrys.desktop.ashell.package when a host sets it, and configured via a generated ~/.config/ashell/config.toml with the colours of othrys.theme.palette and the font of othrys.theme.fonts.sansSerif written in at build time. A null palette or font leaves the matching keys out, and ashell uses its own defaults. Hot-reloads on config changes.

The bar runs as a user unit tied to the graphical session, and it starts without DISPLAY. It draws through layer-shell and needs no X server, and with DISPLAY set it would hold a connection to the session’s Xwayland server, which aborts the bar whenever that server restarts.

renderer sets the graphics API the bar draws with, through WGPU_BACKEND on the unit. It is "vulkan", ashell’s own default, unless othrys.hardware.nvidia.enable is set, and then "gl". On the NVIDIA driver Vulkan presents frames late, so menus, toasts and resizing modules stutter, while OpenGL draws them smoothly. animations = true turns those animations on, and ashell leaves them off by default.

The lock button runs othrys.desktop.lockCommand, whose locker every compositor host already has. The launcher chord and the launcher button run othrys.desktop.launcherCommand, which is wofi unless another module or the host names a launcher, as Vicinae does. The pickers beside it come from four more signals in othrys.desktop, set the same way.

SignalChordDefault
emojiCommandMod + Erofimoji through wofi, typing with wtype
dmenuCommandMod + Shift + V and the clipboard buttonwofi --dmenu
runCommandMod + Shift + Dwofi --show run
fileSearchCommandMod + Shift + Fnull

A null signal leaves its chord unbound. The clipboard chord and button pipe the cliphist history through dmenuCommand, so the history stays cliphist’s whichever menu shows it. wofi, rofimoji and wtype are installed only while one of these commands or the launcher names them, and hyprpicker is installed on Hyprland. The audio buttons open pavucontrol, which othrys.hardware.audio installs on a graphical host.

The bar uses two unit settings. region is the locale ashell takes its unit system from, and the weather follows it. The default en_US is imperial, so the weather is in °F and the wind in mph. systemTemperatureUnit is the unit of the sensor reading in the system information module, and its default is "Celsius", since hardware temperatures are quoted that way. ashell warns at 60 °C and alerts at 80 °C. A metric host sets region = "de_DE" or another locale, and region = null follows LC_MEASUREMENT and the login locale.

The clock shows no weather until weatherLocation is set. With the default of null the key is left out of the config and the bar makes no forecast request. The value is a city name or a pair of coordinates, and it is identity-shaped, so the host sets it. The module renders either form as the weather_location table ashell reads. A string holding a brace or an equals sign is refused, which catches the raw TOML fragment the option used to take.

othrys.desktop.ashell.weatherLocation = {
  latitude = 40.7128;
  longitude = -74.006;
};

othrys.desktop.ashell.weatherLocation = "New York";

The clipboard button reads a history that cliphist keeps, fed by a Home Manager user service on Hyprland and on Niri alike. The history is a plain file under ~/.cache/cliphist and holds everything copied, apart from entries a password manager marks as sensitive. It keeps clipboard.maxItems entries, 100 by default, and the default lock command wipes it each time the session locks. A host that replaces othrys.desktop.lockCommand takes over that wipe. A second user unit, cliphist-wipe, wipes the history when the graphical session ends, at logout, reboot or shutdown, whatever the lock command is. A session that dies without stopping its units, as on a power cut, leaves the file in place until the next lock or logout. clipboard.enable = false removes the service, the button and the wipe. A Hyprland host without ashell no longer records a clipboard history at all.

The settings group at the right of the bar follows the host. A desktop shows the idle inhibitor, peripheral batteries, audio and the microphone. A host with othrys.hardware.laptop.enable also shows its own battery, the screen brightness and the network, shows Bluetooth when hardware.bluetooth.enable holds, and shows the power profile when services.power-profiles-daemon.enable holds, which leaves it out on a host that uses TLP. On a laptop the settings menu keeps its airplane mode button, and the clock drops its seconds so the bar does not redraw once a second on battery. indicators, airplaneButton and clockFormat override each of these.

The battery indicator reads UPower, which the laptop module enables.

Options

  options.othrys.desktop.ashell = {
    enable = lib.mkEnableOption "Ashell status bar";

    package = lib.mkOption {
      type = lib.types.package;
      # The ashell flake this library locks, handed in by flake/modules.nix.
      default = othrysInputs.ashell.packages.${pkgs.stdenv.hostPlatform.system}.default;
      defaultText = lib.literalMD "the default package of the ashell flake this library locks";
      example = lib.literalExpression "pkgs.ashell";
      description = "The ashell package the bar's unit starts and the user's profile installs.";
    };

    weatherLocation = lib.mkOption {
      type = lib.types.nullOr (lib.types.either
        # A city name holds neither a brace nor an equals sign, and the raw
        # TOML table this option once took holds both, so that form is
        # refused here instead of being looked up as a city.
        (lib.types.strMatching "[^{}=]+")
        (lib.types.submodule {
          options = {
            latitude = lib.mkOption {
              type = lib.types.numbers.between (-90) 90;
              example = 40.7128;
              description = "Latitude in decimal degrees, north positive.";
            };
            longitude = lib.mkOption {
              type = lib.types.numbers.between (-180) 180;
              example = -74.006;
              description = "Longitude in decimal degrees, east positive.";
            };
          };
        }));
      default = null;
      example = lib.literalExpression ''
        {
          latitude = 40.7128;
          longitude = -74.006;
        }
      '';
      description = ''
        Where the clock's weather is for. A string is a city name, which
        ashell looks up, and an attribute set of `latitude` and `longitude`
        is a point. The module renders either as the `weather_location` value
        ashell reads. The bar fetches the forecast over the network. With
        `null` the key is left out, the bar shows no weather and makes no
        request. The location is identity-shaped, so the consuming host sets
        it.
      '';
    };

    region = lib.mkOption {
      type = lib.types.nullOr (lib.types.strMatching "[a-z]{2,3}_[A-Z]{2}");
      default = "en_US";
      example = "de_DE";
      description = ''
        The locale ashell takes its unit system from, which decides the
        weather's temperature and wind speed. `en_US` is imperial, so °F and
        mph, and nearly every other locale is metric. With `null` the key is
        left out and ashell follows `LC_MEASUREMENT` and then the login
        locale.
      '';
    };

    systemTemperatureUnit = lib.mkOption {
      type = lib.types.nullOr (lib.types.enum ["Celsius" "Fahrenheit"]);
      default = "Celsius";
      description = ''
        The unit of the sensor temperature in the system information module,
        which is set apart from `region`. Hardware temperatures are quoted
        in °C, so that is the default while the weather follows the region.
        With `null` the reading follows the region as well.
      '';
    };

    clipboard = {
      enable = lib.mkOption {
        type = lib.types.bool;
        default = true;
        description = ''
          Keep a clipboard history with cliphist, and show the bar button and
          bind the `Mod+Shift+V` chord that pick from it through
          `othrys.desktop.dmenuCommand`. The history is a plain file under `~/.cache/cliphist`
          holding everything copied, apart from entries a password manager
          marks as sensitive. It is capped at `maxItems`, wiped each time
          the session locks through `othrys.desktop.lockCommand` and wiped
          again when the graphical session ends.
        '';
      };
      maxItems = lib.mkOption {
        type = lib.types.ints.positive;
        default = 100;
        description = "Entries the clipboard history keeps before the oldest is dropped.";
      };
    };

    indicators = lib.mkOption {
      type = lib.types.listOf (lib.types.enum [
        "IdleInhibitor"
        "PowerProfile"
        "Audio"
        "Microphone"
        "Network"
        "Vpn"
        "Bluetooth"
        "Battery"
        "PeripheralBattery"
        "Brightness"
      ]);
      default = defaultIndicators;
      defaultText = lib.literalExpression ''
        ["IdleInhibitor" "PeripheralBattery" "Audio" "Microphone"], and with
        othrys.hardware.laptop.enable also "Brightness", "Network" and
        "Battery", plus "Bluetooth" and "PowerProfile" when the host runs
        bluetooth and power-profiles-daemon
      '';
      example = ["Audio" "Network" "Battery"];
      description = ''
        The indicators in the settings group at the right of the bar, in the
        order given. The default follows the host. A desktop gets the idle
        inhibitor, audio, the microphone and peripheral batteries. A host with
        `othrys.hardware.laptop.enable` also gets its own battery, the screen
        brightness and the network, and Bluetooth and the power profile when it
        runs those services.

        `Battery` reads UPower, which the laptop module enables. `Network` reads
        NetworkManager or iwd. `PowerProfile` reads power-profiles-daemon, so
        it is left out on a host that uses TLP.
      '';
    };

    airplaneButton = lib.mkOption {
      type = lib.types.bool;
      default = laptop;
      defaultText = lib.literalExpression "config.othrys.hardware.laptop.enable";
      description = "Show the airplane mode button in the settings menu.";
    };

    clockFormat = lib.mkOption {
      type = lib.types.str;
      default =
        if laptop
        then "%a %b %d  %I:%M %p"
        else "%a %b %d  %I:%M:%S %p";
      defaultText = lib.literalExpression ''
        "%a %b %d  %I:%M:%S %p", and without the seconds when
        othrys.hardware.laptop.enable is set
      '';
      description = ''
        `strftime` format of the clock. A format with seconds makes the bar
        redraw once a second, which a laptop on battery pays for, so the
        default leaves them out there.
      '';
    };

    bar = {
      surface = lib.mkOption {
        type = lib.types.enum ["transparent" "solid"];
        default = "transparent";
        example = "solid";
        description = ''
          Where ashell paints the bar background. `transparent` leaves the bar
          see-through and paints each module group instead, giving the
          "islands" look; `solid` paints the whole bar as one continuous
          surface. Defaults to ashell's own default rather than a preference.
        '';
      };

      opacity = lib.mkOption {
        type = lib.types.float;
        default = 1.0;
        example = 0.92;
        description = ''
          Opacity of the bar surface. Below 1.0 ashell also asks the
          compositor to blur what is behind the bar, since its `blur` setting
          defaults to `auto`. The request needs `ext-background-effect-v1`,
          and a compositor without it draws no blur.
        '';
      };
    };

    animations = lib.mkOption {
      type = lib.types.bool;
      default = false;
      example = true;
      description = ''
        Animate the bar. ashell then slides menus and toasts in and out and
        resizes modules and workspace buttons gradually. Each animation lasts
        100 ms and draws a frame per refresh of the output, so it shows
        stutter on a renderer that misses frames, as Vulkan does on NVIDIA
        (see `renderer`). The default is ashell's own, which is off.
      '';
    };

    renderer = lib.mkOption {
      type = lib.types.enum ["vulkan" "gl"];
      default =
        if config.othrys.hardware.nvidia.enable
        then "gl"
        else "vulkan";
      defaultText = lib.literalMD ''
        `"gl"` when `othrys.hardware.nvidia.enable` is set, and `"vulkan"`
        otherwise
      '';
      description = ''
        The graphics API ashell draws with, written to `WGPU_BACKEND` on the
        unit. Vulkan is ashell's default. On the NVIDIA driver it presents
        frames late, and animations stutter while OpenGL draws them smoothly,
        so an NVIDIA host gets `"gl"`.
      '';
    };
  };

Keybindings (via Hyprland)

BindingAction
Super + DLauncher (othrys.desktop.launcherCommand, wofi drun by default)
Super + Shift + DCommand runner (runCommand, wofi run by default)
Super + EEmoji picker (emojiCommand, rofimoji by default)
Super + Shift + VClipboard history (cliphist through dmenuCommand)
Super + Shift + FFile search (fileSearchCommand, unbound by default)
Super + Shift + CColor picker to clipboard (hyprpicker)

Vicinae

A launcher in the style of Raycast. The module installs it for the primary user through Home Manager’s programs.vicinae and runs vicinae server as a user unit of the graphical session. The server reloads its settings and theme files when they change.

othrys.desktop.compositors.niri.enable = true;
othrys.desktop.ashell.enable = true;
othrys.desktop.vicinae.enable = true;

A host without a graphical session is refused, and the message names othrys.desktop.graphical. The unit starts only where WAYLAND_DISPLAY is set and restarts only on failure, so “Quit Vicinae” in the tray menu stops the server until the next session.

launcher sets othrys.desktop.launcherCommand to vicinae toggle. The chord that runs it is ashell’s Super + D on Hyprland and on Niri, beside the bar’s launcher button, so a host without the bar binds vicinae toggle through the compositor’s extraBinds. Vicinae’s own global_shortcuts setting needs a hotkey protocol of Vicinae’s on Wayland, and the module does not rely on it.

The module also sets the picker signals at mkDefault, whatever launcher holds. Super + E opens Vicinae’s emoji search and Super + Shift + F its file search, and pressing either chord again closes the window. The clipboard chord and button show the cliphist history in vicinae dmenu. Vicinae has no prompt that runs a typed command, so runCommand is null and Super + Shift + D is unbound. A host that sets none of the signals itself installs none of wofi, rofimoji and wtype. The emoji search copies the emoji and pastes it only with inputServer.enable.

The calculator fetches currency exchange rates from api.vicinae.com once when the server starts and then every hour. The module stops the hourly requests, and exchangeRates.hourlyRefresh brings them back. No setting stops the request at start. Vicinae’s update check never runs on Linux, and the extension stores reach api.vicinae.com only when they are opened.

keybinding picks Vicinae’s navigation preset, "default", "vim" or "emacs", and is written to the keybinding setting.

settings is merged over the curated keys one key at a time. Telemetry is off, pop_to_root_on_close is true and input_server.enabled follows inputServer.enable. favicon_service is "none", so links show a placeholder icon and no third party learns their host names. The declared settings go to ~/.config/vicinae/home-manager.json, which the server reads through VICINAE_OVERRIDES. settings.json stays writable for the settings window, and a key declared here wins over the window’s value for that key.

With a palette the module writes the theme othrys and selects it for light and dark alike, with the variant of othrys.theme.polarity. The theme colours list rows as well, hovered rows in base01 and the selected row in base02. With othrys.theme.opacity set the launcher window takes the opacity of popups.

On a host with Hyprland, launcher_window.layer_shell.keyboard_interactivity is "on_demand". Vicinae’s "exclusive" default leaves popups inside the window without mouse input on Hyprland. A host with both compositors writes one settings file, so its Niri session gets "on_demand" as well. Stylix’s own Vicinae target is off while the module is on. Without a palette or a sans-serif font Vicinae keeps its own.

While ashell keeps its cliphist history, Vicinae’s own clipboard monitoring is off. Vicinae’s history would otherwise hold every entry past the bar’s wipe at lock and logout, which does not reach it. A host without the bar’s history keeps Vicinae’s, and it is wiped by nothing.

~/.config/vicinae is persisted, and so are ~/.local/share/vicinae and ~/.local/state/vicinae at mode 0700. The first of those holds the clipboard history, snippets and extension data, and the second the onboarding state, without which the onboarding screen returns after every boot. The file index in ~/.cache/vicinae is rebuilt by Vicinae and is not persisted. inputServer.enable installs the input helper as a security wrapper with cap_dac_override, which any local account can run. Without it Vicinae copies where it would paste, and snippets do not expand.

Options

  options.othrys.desktop.vicinae = {
    enable = lib.mkEnableOption "the Vicinae launcher";

    package = lib.mkPackageOption pkgs "vicinae" {};

    settings = lib.mkOption {
      # The type of programs.vicinae.settings in Home Manager, which renders
      # it as JSON.
      inherit (pkgs.formats.json {}) type;
      default = {};
      example = lib.literalExpression ''
        {
          favicon_service = "twenty";
          search_files_in_root = true;
          launcher_window.layer_shell.keyboard_interactivity = "on_demand";
        }
      '';
      description = ''
        Vicinae settings, merged over the curated defaults. Those are
        written at mkDefault, so a key set here replaces that key alone and
        its siblings stay. The shape is that of
        `~/.config/vicinae/settings.json`, and `vicinae config default`
        prints every key with its upstream value.

        The curated defaults turn telemetry off, set `favicon_service` to
        `"none"`, set `pop_to_root_on_close` to true and set
        `input_server.enabled` from `inputServer.enable`. With a palette in
        `othrys.theme` both theme names are `"othrys"`, and with
        `othrys.theme.fonts.sansSerif` set the interface font is that font.
        With `othrys.theme.opacity` set, the launcher window takes the
        opacity of popups. On a host with Hyprland the layer-shell keyboard
        mode is `"on_demand"`, since the exclusive default leaves popups
        inside the window without mouse input there.
        While ashell keeps its cliphist history,
        `providers.clipboard.preferences.monitoring` is false, so Vicinae
        records no second history that the wipe at lock would miss. On a
        host without that history Vicinae records the clipboard itself.

        The declared settings are merged over the file Vicinae writes from
        its settings window, key by key, each time the server loads them. A
        change made in the window to a key declared here has no effect.
      '';
    };

    extensions = lib.mkOption {
      type = lib.types.listOf lib.types.package;
      default = [];
      example = lib.literalExpression ''
        [
          (config.lib.vicinae.mkRayCastExtension {
            name = "gif-search";
            rev = "4d417c2dfd86a5b2bea202d4a7b48d8eb3dbaeb1";
            sha256 = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
          })
        ]
      '';
      description = ''
        Extensions to install, passed to Home Manager's
        `programs.vicinae.extensions`. Home Manager's `config.lib.vicinae`
        builds them, and that attribute exists only inside the user's Home
        Manager configuration.
      '';
    };

    keybinding = lib.mkOption {
      type = lib.types.enum ["default" "vim" "emacs"];
      default = "default";
      example = "vim";
      description = ''
        The keybinding preset Vicinae navigates with, one of the three it
        ships. It is written to the `keybinding` setting at mkDefault, so
        `settings.keybinding` still wins.
      '';
    };

    exchangeRates.hourlyRefresh = lib.mkOption {
      type = lib.types.bool;
      default = false;
      description = ''
        Let the calculator fetch currency exchange rates from
        `api.vicinae.com` every hour. With false the server still fetches
        them once when it starts, which no setting of Vicinae prevents, and
        currency conversions use those rates for the rest of the session.
      '';
    };

    launcher = lib.mkOption {
      type = lib.types.bool;
      default = true;
      description = ''
        Make `vicinae toggle` the desktop launcher by setting
        `othrys.desktop.launcherCommand`. The chord that runs it, `Mod+D` on
        Niri and `$mainMod + D` on Hyprland, and the launcher button of the
        bar both belong to `othrys.desktop.ashell`, so a host without the bar
        binds the command itself. With false the launcher stays wofi. The
        emoji, clipboard menu, file search and run signals beside it follow
        Vicinae either way, and a host sets any of them to keep its own.
      '';
    };

    inputServer.enable = lib.mkOption {
      type = lib.types.bool;
      default = false;
      description = ''
        Run Vicinae's input helper, which pastes into the focused window and
        expands snippets. The helper reads every keyboard of the host and
        injects keys through uinput, so it is installed as a security
        wrapper with `cap_dac_override`, which any local account can run,
        and the `uinput` kernel module is loaded. With false Vicinae copies
        to the clipboard where it would paste, and snippets do not expand.
      '';
    };
  };

Sessions

A host can enable both compositors and let the greeter choose between them, so an enabled module does not say which compositor is running. The commands that talk to a compositor are therefore chosen at run time on such a host. The screen-off and screen-on stages of the idle module, ashell’s logout button and the default lock command each become a small script that reads XDG_CURRENT_DESKTOP and calls niri msg and swaylock in a Niri session or hyprctl and hyprlock in a Hyprland one. A host with one compositor gets the plain command with no script in between. modules/desktop/session.nix holds the test, and a module that adds a compositor command builds it there.

Both lockers and both PAM services are installed on a host with both compositors, since each session runs its own.

Enabling either compositor installs Nautilus as the file manager, in the primary user’s packages.

Compositors

See Compositors (Hyprland) for the full Hyprland reference.

Hyprland no longer exports TERM to the session, and each terminal sets its own.

othrys.desktop.compositors.hyprland = {
  enable = true;
  monitors = [
    {output = "eDP-1";}
  ];
};

Browser selection

othrys.desktop.defaultBrowser is the command the browser shortcut runs, Super + F in Hyprland and Mod+F in Niri. It follows the browser module that is enabled, floorp before chromium, and names firefox when neither is. No othrys module installs Firefox, so a host with another browser sets the option. It selects a command only and sets no default application for links.

Each compositor’s browser option defaults to the shared one, and setting it changes that compositor alone.

othrys.desktop.defaultBrowser = "chromium";
othrys.desktop.compositors.niri.browser = "floorp";

Options

  options.othrys.desktop.defaultBrowser = lib.mkOption {
    type = lib.types.nonEmptyStr;
    default =
      if config.othrys.apps.floorp.enable
      then "floorp"
      else if config.othrys.apps.chromium.enable
      then "chromium"
      else "firefox";
    defaultText = lib.literalMD ''
      `"floorp"` when `othrys.apps.floorp` is enabled, `"chromium"` when
      `othrys.apps.chromium` is, and `"firefox"` otherwise
    '';
    example = "chromium";
    description = ''
      Browser command the browser shortcut of Hyprland and Niri runs, unless a
      compositor's own `browser` option is set. The default follows the
      browser module that is enabled. `firefox` is installed by no othrys
      module, so a host with another browser names it here. This selects a
      command only and sets no default application for links.
    '';
  };

Niri

Scrollable-tiling compositor via niri-flake (typed, build-time-validated config, self-contained, with no extra upstream import for consumers). The option surface mirrors hyprland where concepts map (chords, terminal/browser, outputs, touchpad, screenshots) and is niri-native where they do not (columns scroll, and Mod+S opens the overview). Niri manages its own systemd session, and the login module starts niri-session by default on a host where niri is the only compositor. The window border takes the accent of othrys.theme.palette in place of niri’s focus ring. On a host with the Stylix adapter, niri-flake’s Stylix target themes the cursor as well.

outputs takes JSON values only, which is everything an output is made of. extraBinds and settings stay free-form, since an action written with niri-flake’s config.lib.niri.actions helpers is an attribute set carrying a function, and niri-flake validates both once they reach programs.niri.settings.

othrys.desktop.compositors.niri = {
  enable = true;
  outputs."DP-1".mode = {
    width = 1920;
    height = 1080;
    refresh = 144.0;
  };
};

Options

  options.othrys.desktop.compositors.niri = {
    enable = lib.mkEnableOption "Niri scrollable-tiling Wayland compositor";

    outputs = lib.mkOption {
      # An output is plain data all the way down, a mode, a position, a scale
      # and a transform, so each one is held to JSON values. niri-flake then
      # checks the keys against its own schema.
      type = lib.types.attrsOf (lib.types.attrsOf (pkgs.formats.json {}).type);
      default = {};
      example = lib.literalExpression ''
        {
          "DP-1" = {
            mode = {
              width = 1920;
              height = 1080;
              refresh = 144.0;
            };
            position = {
              x = 0;
              y = 0;
            };
          };
        }
      '';
      description = "Monitor configuration (programs.niri.settings.outputs). Empty lets niri auto-configure.";
    };

    terminal = lib.mkOption {
      type = lib.types.str;
      default = "kitty";
      description = "Terminal emulator the terminal bind spawns.";
    };

    browser = lib.mkOption {
      type = lib.types.str;
      default = config.othrys.desktop.defaultBrowser;
      defaultText = lib.literalExpression "config.othrys.desktop.defaultBrowser";
      description = ''
        Browser the browser bind spawns. Defaults to the shared
        `othrys.desktop.defaultBrowser`. Set this for a Niri-specific override
        without changing Hyprland's browser shortcut.
      '';
    };

    screenshots.directory = lib.mkOption {
      type = lib.types.str;
      default = "~/Pictures/Screenshots";
      description = "Directory niri's built-in screenshot UI saves into.";
    };

    # Curated actions with configurable chords, the hyprland pattern. Same
    # chords where the concept maps (muscle-memory parity), and niri-native
    # actions (columns, overview) where it doesn't.
    binds = {
      focusLeft = bindOpt "Mod+H" "focus column left";
      focusRight = bindOpt "Mod+L" "focus column right";
      focusDown = bindOpt "Mod+J" "focus window down";
      focusUp = bindOpt "Mod+K" "focus window up";

      moveLeft = bindOpt "Mod+Shift+H" "move column left";
      moveRight = bindOpt "Mod+Shift+L" "move column right";
      moveDown = bindOpt "Mod+Shift+J" "move window down";
      moveUp = bindOpt "Mod+Shift+K" "move window up";

      killActive = bindOpt "Mod+Q" "close the active window";
      terminal = bindOpt "Mod+Return" "launch the terminal";
      browser = bindOpt "Mod+F" "launch the browser";

      fullscreen = bindOpt "Mod+M" "toggle fullscreen";
      maximizeColumn = bindOpt "Mod+P" "maximize the column";
      toggleFloating = bindOpt "Mod+V" "toggle floating";
      overview = bindOpt "Mod+S" "toggle the overview";
      exit = bindOpt "Mod+Shift+E" "quit niri";

      workspacePrev = bindOpt "Mod+Ctrl+Left" "previous workspace";
      workspaceNext = bindOpt "Mod+Ctrl+Right" "next workspace";

      screenshot = bindOpt "Print" "open the interactive screenshot UI";
      screenshotScreen = bindOpt "Mod+Print" "screenshot the full screen";
      screenshotWindow = bindOpt "Mod+Shift+Print" "screenshot the focused window";
    };

    numberedWorkspaceBinds = lib.mkOption {
      type = lib.types.bool;
      default = true;
      description = "Generate Mod+1..9 workspace focus and Mod+Shift+1..9 move binds.";
    };

    extraBinds = lib.mkOption {
      # Left at `anything` on purpose. niri-flake's action helpers under
      # config.lib.niri.actions return attribute sets that carry a
      # `__functor`, so an action is not always plain data, and a JSON type
      # would refuse the form niri-flake documents for writing binds.
      type = lib.types.attrsOf (lib.types.attrsOf lib.types.anything);
      default = {};
      example = lib.literalExpression ''
        {
          "Mod+T".action.spawn = "thunderbird";
        }
      '';
      description = "Additional binds in programs.niri.settings.binds format, merged over the generated set.";
    };

    touchpad = {
      enable = lib.mkEnableOption "touchpad tuning (tap-to-click, natural scroll) for laptops";
    };

    xwayland = {
      enable = lib.mkOption {
        type = lib.types.bool;
        default = true;
        description = "Install xwayland-satellite so X11 applications run (niri detects and manages it automatically).";
      };
    };

    settings = lib.mkOption {
      # Left at `anything` for the same reason as extraBinds, since `binds`
      # and `switch-events` under it take the same action values. niri-flake
      # types the whole tree once it arrives at programs.niri.settings.
      type = lib.types.attrsOf lib.types.anything;
      default = {};
      description = "Extra programs.niri.settings, merged over the generated config (use lib.mkForce to override an already-set leaf).";
    };
  };

UWSM

Universal Wayland Session Manager. When enabled, Hyprland registers as a UWSM-managed compositor for proper systemd session integration.

othrys.desktop.uwsm.enable = true;

Idle

Staged idle policy via hypridle (ext-idle-notify, which works on Hyprland and Niri): optional backlight dim, lock (via the shared othrys.desktop.lockCommand signal), screen off (DPMS through the running compositor), and optional suspend. The stages must increase in that order, and the module refuses a configuration where a later stage fires first.

lockBeforeSleep, on by default, locks the session before the host sleeps. With the module enabled it is hypridle’s before-sleep command. A Hyprland or Niri host that does not enable this module still gets hypridle for that one job, configured with the lock command and no idle stage. Such a host therefore locks on suspend and on loginctl lock-session and never on idle time. Setting othrys.desktop.idle.lockBeforeSleep = false removes the before-sleep lock in both cases.

The locker comes with the lock command rather than with this module or ashell. Every Hyprland or Niri host, and a host with an unmanaged compositor that enables this module, gets the locker othrys.desktop.lockCommand names together with its PAM service, hyprlock for Hyprland and swaylock for Niri or an unmanaged compositor. That holds on a host where nothing locks the session, so a lock command run by hand or by a keybinding finds its locker. A locker whose PAM service is missing rejects the correct password, and the only way out is a VT switch.

Options

  options.othrys.desktop.idle = {
    enable = lib.mkEnableOption "staged idle management (dim, lock, screen off, suspend) via hypridle";

    lockCommand = lib.mkOption {
      type = lib.types.str;
      default = config.othrys.desktop.lockCommand;
      defaultText = lib.literalExpression "config.othrys.desktop.lockCommand";
      description = "Command the lock stage runs (and before-sleep lock).";
    };

    lockBeforeSleep = lib.mkOption {
      type = lib.types.bool;
      default = true;
      description = ''
        Lock the session before the host sleeps, so it does not resume into
        an open session. With `enable` set this is the idle daemon's
        before-sleep command. Without it, a host that runs one of the othrys
        compositors still starts hypridle for this alone, with no idle stage,
        and gets the locker and its PAM service. Set it to `false` on a host
        that should resume unlocked, such as one with no keyboard.
      '';
    };

    timeouts = {
      dim = lib.mkOption {
        type = lib.types.nullOr lib.types.ints.positive;
        default = null;
        example = 240;
        description = "Seconds of idle before dimming the backlight (brightnessctl); null disables the stage.";
      };
      lock = lib.mkOption {
        type = lib.types.nullOr lib.types.ints.positive;
        default = 300;
        description = "Seconds of idle before locking; null disables the stage.";
      };
      screenOff = lib.mkOption {
        type = lib.types.nullOr lib.types.ints.positive;
        default = 330;
        description = "Seconds of idle before turning displays off; null disables the stage.";
      };
      suspend = lib.mkOption {
        type = lib.types.nullOr lib.types.ints.positive;
        default = null;
        example = 1800;
        description = "Seconds of idle before suspending; null disables the stage (desktops usually want null, laptops a value).";
      };
    };
  };

Keyring

Browsers, mail clients and tray applications store credentials in the Secret Service, and a session without a provider leaves each of them to fall back to a plain file or to ask again on every start. othrys.desktop.keyring.enable runs one provider, which othrys.desktop.keyring.provider selects. Its default is othrys.desktop.graphical, so a Hyprland host, a niri host and a host with an unmanaged desktop all get one, while a headless host does not.

A host that runs another provider, such as KeePassXC or KWallet, turns the option off, since two providers compete for the same D-Bus name. niri-flake enables gnome-keyring on every niri host by itself, and the module overrides that whenever gnome-keyring is not the provider it was asked for.

othrys.desktop.keyring.enable = false;

gnome-keyring

The default provider encrypts its store with a password. With othrys.desktop.login the greeter passes the login password to the keyring, which is unlocked when the session starts. This holds while the keyring password and the login password are the same. Under impermanence ~/.local/share/keyrings is persisted at mode 0700 for the primary user.

A login that passes no password leaves the store locked, and the keyring then asks for its own the first time an application reads a secret. An autologin session is one such login. A login with a hardware key alone is another, since a U2F touch yields a signature and no secret, and a signature cannot unlock anything. The two settings below are the ways out.

A store without a password

othrys.desktop.keyring.passwordless creates the gnome-keyring store with no password, so nothing ever asks. gnome-keyring has no setting for this. The module writes the keyring file before the daemon first runs, at Home Manager activation, and only when neither login.keyring nor Default_keyring.keyring exists. A keyring that already exists is never replaced, so a host that had one with a password keeps it until its owner removes the file.

othrys.desktop.keyring.passwordless = true;

The store is then plain files under ~/.local/share/keyrings. File permissions keep other accounts out, and disk encryption keeps out whoever holds the powered-off machine. Any program running as the user reads every secret, and so does anyone who reaches the mounted disk, which includes a backup of the home directory. The greeter is no longer told to unlock the keyring, since there is nothing to unlock.

The module refuses the option on a host that declares no LUKS device in boot.initrd.luks.devices, which othrys.system.disko fills in and a host that set LUKS up by hand fills in as well. A host that accepts plain secrets on a plain disk sets othrys.desktop.keyring.allowUnencryptedDisk.

pass

provider = "pass" runs pass-secret-service for the primary user. It serves the same D-Bus API from a pass password store, where each secret is a file encrypted to the OpenPGP key named in othrys.desktop.keyring.pass.gpgKey. gnome-keyring is turned off, on a niri host as well.

othrys.desktop.keyring = {
  provider = "pass";
  pass.gpgKey = "<fingerprint>";
};

With the key on a hardware token, reading a secret needs the token, its PIN once for each gpg-agent session, and a touch on each read when the token’s touch policy for decryption is set to always. A copy of the disk or of a backup holds ciphertext only. A program running as the user can still ask the service for a secret while the token is present and the PIN is cached, and the touch policy is what stands between that program and the secret. The label of an entry and the attributes applications search by are stored beside it unencrypted, so the store shows which services have a secret.

The store lives in ~/.local/share/password-store unless othrys.desktop.keyring.pass.directory says otherwise, and it is persisted at mode 0700 under impermanence. A new store is initialised by writing its .gpg-id file, and a store that already has one is left as it is. The module does not import the public key or configure gpg-agent. othrys.services.security.yubikey provides the agent and a pinentry. Home Manager has to manage the primary user, and the module refuses the provider without it and without a key.

Which to pick

LoginSettingWhat unlocks the secrets
A password, typed at the greeterThe defaultsThe login password, passed on by the greeter
A hardware key alone, on an encrypted diskpasswordless = trueNothing, since the store has no password and the disk encryption protects it at rest
A hardware key alone, with secrets bound to the tokenprovider = "pass"The OpenPGP key on the token, with its PIN and its touch policy

Options

  options.othrys.desktop.keyring = {
    enable = lib.mkOption {
      type = lib.types.bool;
      default = config.othrys.desktop.graphical;
      defaultText = lib.literalExpression "config.othrys.desktop.graphical";
      example = false;
      description = ''
        Whether to run a Secret Service provider in the graphical session,
        which `provider` selects. Browsers, mail clients and tray
        applications store credentials in the Secret Service, and without a
        provider they fall back to a plain file or ask again on every start.
        It is on by default on a graphical host. A host that runs another
        provider, such as KeePassXC or KWallet, turns it off, since two
        providers compete for the same D-Bus name.
      '';
    };

    provider = lib.mkOption {
      type = lib.types.enum ["gnome-keyring" "pass"];
      default = "gnome-keyring";
      example = "pass";
      description = ''
        Which program serves the Secret Service.

        `gnome-keyring` encrypts its store with a password and unlocks it
        from the login password through PAM. It asks for that password the
        first time a secret is read unless the login passed one that
        matches, or `passwordless` created the store without one. A login
        with a hardware key alone passes no password, and a touch yields a
        signature and no secret, so nothing can unlock the store there.

        `pass` runs `pass-secret-service` for the primary user over a `pass`
        password store, where each secret is a file encrypted to the OpenPGP
        key named in `pass.gpgKey`. With that key on a hardware token,
        reading a secret needs the token, its PIN once for each agent
        session, and a touch on each read when the token's touch policy for
        decryption is set to always. gnome-keyring is turned off, since only
        one provider can own the D-Bus name. Home Manager has to manage the
        primary user, and the host needs a gpg-agent with a pinentry, which
        `othrys.services.security.yubikey` sets up.
      '';
    };

    passwordless = lib.mkOption {
      type = lib.types.bool;
      default = false;
      description = ''
        Whether to create the gnome-keyring store with no password, so that
        nothing ever asks to unlock it. It applies to the `gnome-keyring`
        provider only.

        The store is then plain files under `~/.local/share/keyrings`. File
        permissions protect it from other accounts, and disk encryption
        protects it from someone holding the powered-off machine. Nothing
        else does, so any program running as the user and anyone who can
        read the mounted disk reads every secret. The module refuses the
        option on a host with no encrypted disk unless
        `allowUnencryptedDisk` is set.

        The keyring file is written when Home Manager activates and neither
        `login.keyring` nor `Default_keyring.keyring` exists. A keyring that
        already exists is never replaced, so a host that had a keyring with
        a password keeps it until its owner removes it.
      '';
    };

    allowUnencryptedDisk = lib.mkOption {
      type = lib.types.bool;
      default = false;
      description = ''
        Accept `passwordless` on a host that declares no LUKS device in
        `boot.initrd.luks.devices`. Every stored secret then sits on the
        disk in plain files, readable by whoever holds the disk.
      '';
    };

    pass = {
      gpgKey = lib.mkOption {
        type = lib.types.nullOr (lib.types.strMatching "(0x)?[0-9A-Fa-f]{8,64}");
        default = null;
        example = "0123456789ABCDEF0123456789ABCDEF01234567";
        description = ''
          Key id or fingerprint of the OpenPGP key the password store is
          encrypted to. Required with `provider = "pass"`. A new store is
          initialised for it by writing its `.gpg-id` file, and a store that
          already has one is left alone. The public key has to be in the
          user's GnuPG keyring and trusted, which the module does not
          arrange.
        '';
      };

      directory = lib.mkOption {
        type = lib.types.strMatching "[A-Za-z0-9._-]+(/[A-Za-z0-9._-]+)*";
        default = ".local/share/password-store";
        example = ".password-store";
        description = ''
          The password store, relative to the primary user's home
          directory. `pass` and `pass-secret-service` are both pointed at
          it, and it is persisted at mode 0700 under impermanence.
        '';
      };
    };
  };

Night light

Color temperature shifting via gammastep. The schedule needs a location, and the module refuses to evaluate without one. Provide latitude and longitude from the host, or set geoclue.enable to have the location resolved.

geoclue.enable is off by default because it turns on services.geoclue2 for the whole host. With the nixpkgs defaults geoclue scans for nearby Wi-Fi networks, sends their hardware addresses to an online location service on every query, and answers any application that asks for the location. A host with fixed coordinates needs none of that.

othrys.desktop.nightLight = {
  enable = true;
  latitude = 40.7;
  longitude = -74.0;
};

Options

  options.othrys.desktop.nightLight = {
    enable = lib.mkEnableOption "night light (color temperature shifting) via gammastep";

    temperature = {
      day = lib.mkOption {
        type = lib.types.ints.positive;
        default = 6500;
        description = "Daytime color temperature in Kelvin.";
      };
      night = lib.mkOption {
        type = lib.types.ints.positive;
        default = 4000;
        description = "Nighttime color temperature in Kelvin.";
      };
    };

    latitude = lib.mkOption {
      type = lib.types.nullOr lib.types.float;
      default = null;
      example = 43.7;
      description = "Latitude for sunrise/sunset calculation. Identity-shaped, set from the consuming host together with longitude.";
    };

    longitude = lib.mkOption {
      type = lib.types.nullOr lib.types.float;
      default = null;
      example = -79.4;
      description = "Longitude for sunrise/sunset calculation, set together with latitude.";
    };

    geoclue.enable = lib.mkOption {
      type = lib.types.bool;
      default = false;
      example = true;
      description = ''
        Resolve the location through geoclue when no coordinates are set.
        This enables `services.geoclue2` for the whole host. With the nixpkgs
        defaults geoclue scans for nearby Wi-Fi networks, sends their
        hardware addresses to an online location service on every query, and
        answers any application that asks for the location. It is off by
        default for that reason, and a host with fixed coordinates does not
        need it.
      '';
    };
  };

Wallpaper

othrys.theme.wallpaper says what the wallpaper is, and this module draws it. It runs wpaperd as a user service of the graphical session and renders the daemon’s configuration from the theme. The same daemon serves Hyprland and niri, so a host draws the same wallpaper under either. The forms source takes, rotation and per-monitor settings are described in the theming guide.

othrys.desktop.wallpaper.enable is on by default when three things hold. The host is graphical, an othrys compositor module is enabled, and a wallpaper is declared, either in othrys.theme.wallpaper.source or for a monitor in othrys.theme.wallpaper.outputs. A host with no wallpaper therefore runs no daemon. Turning the option on by hand with no wallpaper declared fails an assertion, since the daemon would have nothing to draw.

The unit is wanted by graphical-session.target and stops with it. A host that draws its wallpaper with another program turns the option off, and a host that used to enable services.wpaperd for the primary user itself drops that setting, since both would write the same configuration file.

othrys.desktop.wallpaper.enable = false;

On a host with the Stylix export, Stylix would start hyprpaper under Hyprland and write a wpaperd section of its own. The adapter switches those targets off while this module is on, so one program draws.

Options

  options.othrys.desktop.wallpaper = {
    enable = lib.mkOption {
      type = lib.types.bool;
      default = config.othrys.desktop.graphical && compositorEnabled && declared;
      defaultText = lib.literalMD "true on a graphical host with an othrys compositor module enabled and a wallpaper declared, in `othrys.theme.wallpaper.source` or for a monitor in `othrys.theme.wallpaper.outputs`";
      example = false;
      description = ''
        Whether to draw `othrys.theme.wallpaper` with wpaperd, as a user
        service of the graphical session. It is on by default wherever an
        othrys compositor runs and a wallpaper is declared. A host that draws
        its wallpaper with another program turns it off, since two programs
        would draw over each other.
      '';
    };
  };