nixpkgs/nixos/modules/services/x11/desktop-managers/xterm.nix
Samuel Dionne-Riel fd0f8adaab nixos/desktop-managers/xterm: Defaults to xserver's state
This enhances #61423, which removed the gating of desktop-managers from
being linked to the xserver's state.

This, though, brought in xterm into all systems, even those without X
servers.

This change sets the *default* of the xterm desktop-manager to the state
of the xserver, keeping it enabled by default as a sane fallback.

The xterm desktop-manager can still be enabled or disabled as needed,
without it being affected by xserver's state.
2019-06-08 01:01:22 -04:00

39 lines
698 B
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.xserver.desktopManager.xterm;
xserverEnabled = config.services.xserver.enable;
in
{
options = {
services.xserver.desktopManager.xterm.enable = mkOption {
type = types.bool;
default = xserverEnabled;
defaultText = "config.services.xserver.enable";
description = "Enable a xterm terminal as a desktop manager.";
};
};
config = mkIf cfg.enable {
services.xserver.desktopManager.session = singleton
{ name = "xterm";
start = ''
${pkgs.xterm}/bin/xterm -ls &
waitPID=$!
'';
};
environment.systemPackages = [ pkgs.xterm ];
};
}