<commit_before>{ stdenv, writeText, lib, xorg, mesa, xterm, slim, gnome
, compiz, feh
, kdelibs, kdebase
, xkeyboard_config
, openssh, x11_ssh_askpass
, nvidiaDrivers, libX11, libXext
, synaptics

, config

, # Virtual console for the X server.
  tty ? 7

, # X display number.
  display ? 0

, # List of font directories.
  fontDirectories

, # Is Clone mode on?
  isClone ? "on"
}:

let

  cfg = config.services.xserver;

  optional = condition: x: if condition then [x] else [];

  # Get a bunch of user settings.
  videoDriver = cfg.videoDriver;
  resolutions = map (res: "\"${toString res.x}x${toString res.y}\"") (cfg.resolutions);
  sessionType = cfg.sessionType;
  sessionStarter = cfg.sessionStarter;
  renderingFlag = cfg.renderingFlag;


  sessionCmd =
    if sessionType == "" then sessionStarter else
    if sessionType == "xterm" then "${xterm}/bin/xterm -ls" else
    if sessionType == "gnome" then "${gnome.gnometerminal}/bin/gnome-terminal -ls" else
    abort ("unknown session type "+ sessionType);


  windowManager =
    let wm = cfg.windowManager; in
    if wm != "" then wm else
    if sessionType == "gnome" then "metacity" else
    if sessionType == "kde" then "none" /* started by startkde */ else
    "twm";

    
  modules = 
    optional (videoDriver == "nvidia") nvidiaDrivers ++       #make sure it first loads the nvidia libs
    [
      xorg.xorgserver
      xorg.xf86inputkeyboard
      xorg.xf86inputmouse
    ] 
    ++ optional (videoDriver == "vesa") xorg.xf86videovesa
    ++ optional (videoDriver == "vga") xorg.xf86videovga
    ++ optional (videoDriver == "sis") xorg.xf86videosis
    ++ optional (videoDriver == "i810") xorg.xf86videoi810
    ++ optional (videoDriver == "intel") xorg.xf86videointel
    ++ (optional (cfg.isSynaptics) [(synaptics+"/"+xorg.xorgserver) /*xorg.xf86inputevdev*/]);
    
  configFile = stdenv.mkDerivation {
    name = "xserver.conf";
    src = ./xserver.conf;<commit_msg>added driver nv as suggested by niksnut<commit_after>{ stdenv, writeText, lib, xorg, mesa, xterm, slim, gnome
, compiz, feh
, kdelibs, kdebase
, xkeyboard_config
, openssh, x11_ssh_askpass
, nvidiaDrivers, libX11, libXext
, synaptics

, config

, # Virtual console for the X server.
  tty ? 7

, # X display number.
  display ? 0

, # List of font directories.
  fontDirectories

, # Is Clone mode on?
  isClone ? "on"
}:

let

  cfg = config.services.xserver;

  optional = condition: x: if condition then [x] else [];

  # Get a bunch of user settings.
  videoDriver = cfg.videoDriver;
  resolutions = map (res: "\"${toString res.x}x${toString res.y}\"") (cfg.resolutions);
  sessionType = cfg.sessionType;
  sessionStarter = cfg.sessionStarter;
  renderingFlag = cfg.renderingFlag;


  sessionCmd =
    if sessionType == "" then sessionStarter else
    if sessionType == "xterm" then "${xterm}/bin/xterm -ls" else
    if sessionType == "gnome" then "${gnome.gnometerminal}/bin/gnome-terminal -ls" else
    abort ("unknown session type "+ sessionType);


  windowManager =
    let wm = cfg.windowManager; in
    if wm != "" then wm else
    if sessionType == "gnome" then "metacity" else
    if sessionType == "kde" then "none" /* started by startkde */ else
    "twm";

    
  modules = 
    optional (videoDriver == "nvidia") nvidiaDrivers ++       #make sure it first loads the nvidia libs
    [
      xorg.xorgserver
      xorg.xf86inputkeyboard
      xorg.xf86inputmouse
    ] 
    ++ optional (videoDriver == "vesa") xorg.xf86videovesa
    ++ optional (videoDriver == "vga") xorg.xf86videovga
    ++ optional (videoDriver == "sis") xorg.xf86videosis
    ++ optional (videoDriver == "i810") xorg.xf86videoi810
    ++ optional (videoDriver == "intel") xorg.xf86videointel
    ++ optional (videoDriver == "nv") xorg.xf86videonv;
    ++ (optional (cfg.isSynaptics) [(synaptics+"/"+xorg.xorgserver) /*xorg.xf86inputevdev*/]);
    
  configFile = stdenv.mkDerivation {
    name = "xserver.conf";
    src = ./xserver.conf;
{'fraction_non_alphanumeric': 0.12865792129162462, 'fraction_numerical': 0.014631685166498487, 'mean_word_length': 3.395787139689579, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5291744', 'n_tokens_mistral': 1434, 'n_tokens_neox': 1337, 'n_words': 357}