refactor: change to litterate config

Configuration is now held by the `.org` files. All `.nix` files are
tangled from the org-mode files.
This commit is contained in:
2026-10-26 00:43:40 +01:00
parent 5f4a7a4a42
commit a3df5e937f
94 changed files with 4194 additions and 913 deletions
+50
View File
@@ -0,0 +1,50 @@
#+title: X Server
#+setupfile: ../headers
* 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.
#+begin_src nix :tangle yes
{
flake.modules.nixos.xserver = {
config,
lib,
...
}:
with lib; let
cfg = config.mySystem.desktop.xserver;
in {
<<options>>
<<config>>
};
}
#+end_src
** Declaring the Option
=videoDrivers= lets a host load extra X11 drivers, such as =amdgpu= on
the machine with an AMD GPU.
#+name: options
#+begin_src nix
options.mySystem.desktop.xserver.videoDrivers = mkOption {
type = types.listOf types.str;
default = [];
example = ["amdgpu"];
description = "Extra X11 video drivers to load";
};
#+end_src
** Enabling It
I use the same Bépo AFNOR keyboard layout everywhere, so it’s baked in
directly rather than exposed as an option.
#+name: config
#+begin_src nix
config.services.xserver = {
enable = true;
videoDrivers = cfg.videoDrivers;
xkb = {
layout = "fr";
variant = "bepo_afnor";
};
};
#+end_src