mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-18 19:26:02 +00:00
fd0f8adaab
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.
39 lines
698 B
Nix
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 ];
|
|
|
|
};
|
|
|
|
}
|