-
-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Start decoupling X and graphics support with
videoDrivers
Now that Wayland is less unviable, we should begin to refactor our options so you don't need to use X11-named options just to do graphics without X11. This will be a long process, and I am not really sure where to start, but `videoDrivers` seems like a decent option.
- Loading branch information
1 parent
bb0bae4
commit 60820ed
Showing
17 changed files
with
121 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{ config, lib, pkgs, ... }: | ||
|
||
with lib; | ||
|
||
let | ||
|
||
# Abbreviations. | ||
cfg = config.hardware.graphics; | ||
xorg = pkgs.xorg; | ||
|
||
|
||
in | ||
|
||
{ | ||
|
||
imports = [ | ||
(mkRenamedOptionModule [ "services" "xserver" "videoDrivers" ] [ "hardware" "graphics" "videoDrivers" ]) | ||
]; | ||
|
||
|
||
|
||
###### interface | ||
|
||
options = { | ||
|
||
hardware.graphics = { | ||
|
||
enable = mkOption { | ||
type = types.bool; | ||
default = config.services.xserver.enable; | ||
description = '' | ||
Whether to enable GPU support, whether for graphics like X or Wayland, or other purposes. | ||
''; | ||
}; | ||
|
||
videoDrivers = mkOption { | ||
type = types.listOf types.str; | ||
default = [ "amdgpu" "radeon" "nouveau" "modesetting" "fbdev" ]; | ||
example = [ | ||
"nvidia" "nvidiaLegacy390" "nvidiaLegacy340" "nvidiaLegacy304" | ||
"amdgpu-pro" | ||
]; | ||
# TODO(@oxij): think how to easily add the rest, like those nvidia things | ||
relatedPackages = concatLists | ||
(mapAttrsToList (n: v: | ||
optional (hasPrefix "xf86video" n) { | ||
path = [ "xorg" n ]; | ||
title = removePrefix "xf86video" n; | ||
}) pkgs.xorg); | ||
description = '' | ||
The names of the video drivers the configuration | ||
supports. They will be tried in order until one that | ||
supports your card is found. | ||
Don't combine those with "incompatible" OpenGL implementations, | ||
e.g. free ones (mesa-based) with proprietary ones. | ||
For unfree "nvidia*", the supported GPU lists are on | ||
https://www.nvidia.com/object/unix.html | ||
''; | ||
}; | ||
|
||
}; | ||
|
||
}; | ||
|
||
|
||
|
||
###### implementation | ||
|
||
config = mkIf cfg.enable { | ||
|
||
|
||
}; | ||
|
||
# uses relatedPackages | ||
meta.buildDocsInSandbox = false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.