Configuration is now held by the `.org` files. All `.nix` files are tangled from the org-mode files.
1.1 KiB
1.1 KiB
X Server
X Server
What’s left of services.xserver on my hosts now that GNOME runs on
Wayland: picking extra video drivers to load, and my own keyboard
layout. Here’s the skeleton of the nixos.xserver module.
{
flake.modules.nixos.xserver = {
config,
lib,
...
}:
with lib; let
cfg = config.mySystem.desktop.xserver;
in {
<<options>>
<<config>>
};
}
Declaring the Option
videoDrivers lets a host load extra X11 drivers, such as amdgpu on
the machine with an AMD GPU.
options.mySystem.desktop.xserver.videoDrivers = mkOption {
type = types.listOf types.str;
default = [];
example = ["amdgpu"];
description = "Extra X11 video drivers to load";
};
Enabling It
I use the same Bépo AFNOR keyboard layout everywhere, so it’s baked in directly rather than exposed as an option.
config.services.xserver = {
enable = true;
videoDrivers = cfg.videoDrivers;
xkb = {
layout = "fr";
variant = "bepo_afnor";
};
};