about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2018-06-13 17:03:56 +0000
committerGitHub <noreply@github.com>2018-06-13 17:03:56 +0000
commitf35cc5eb42006429738b2866951c06d632301605 (patch)
tree9dcf2321d5d9db4c09edc4aa9665e5a5cf4a6206 /nixos
parentc4de089cbd4a5fb8f94ee7404ff7a7b946df724a (diff)
parentb01ccbb89918b0c0ab2347405a4a101544045c86 (diff)
downloadnixlib-f35cc5eb42006429738b2866951c06d632301605.tar
nixlib-f35cc5eb42006429738b2866951c06d632301605.tar.gz
nixlib-f35cc5eb42006429738b2866951c06d632301605.tar.bz2
nixlib-f35cc5eb42006429738b2866951c06d632301605.tar.lz
nixlib-f35cc5eb42006429738b2866951c06d632301605.tar.xz
nixlib-f35cc5eb42006429738b2866951c06d632301605.tar.zst
nixlib-f35cc5eb42006429738b2866951c06d632301605.zip
Merge pull request #41764 from oxij/nixos/some-more-related-packages
nixos: add some more related packages
Diffstat (limited to 'nixos')
-rw-r--r--nixos/doc/manual/default.nix5
-rw-r--r--nixos/modules/services/x11/xserver.nix7
2 files changed, 10 insertions, 2 deletions
diff --git a/nixos/doc/manual/default.nix b/nixos/doc/manual/default.nix
index 2c6309474b37..fef6b2f86c85 100644
--- a/nixos/doc/manual/default.nix
+++ b/nixos/doc/manual/default.nix
@@ -31,11 +31,12 @@ let
                   else p;
       describe = args:
         let
+          title = args.title or null;
           name = args.name or (lib.concatStringsSep "." args.path);
           path = args.path or [ args.name ];
           package = args.package or (lib.attrByPath path (throw "Invalid package attribute path `${toString path}'") pkgs);
         in "<listitem>"
-        + "<para><literal>pkgs.${name} (${package.meta.name})</literal>"
+        + "<para><literal>${lib.optionalString (title != null) "${title} aka "}pkgs.${name} (${package.meta.name})</literal>"
         + lib.optionalString (!package.meta.available) " <emphasis>[UNAVAILABLE]</emphasis>"
         + ": ${package.meta.description or "???"}.</para>"
         + lib.optionalString (args ? comment) "\n<para>${args.comment}</para>"
@@ -51,7 +52,7 @@ let
   // lib.optionalAttrs (opt ? example) { example = substFunction opt.example; }
   // lib.optionalAttrs (opt ? default) { default = substFunction opt.default; }
   // lib.optionalAttrs (opt ? type) { type = substFunction opt.type; }
-  // lib.optionalAttrs (opt ? relatedPackages) { relatedPackages = genRelatedPackages opt.relatedPackages; });
+  // lib.optionalAttrs (opt ? relatedPackages && opt.relatedPackages != []) { relatedPackages = genRelatedPackages opt.relatedPackages; });
 
   # We need to strip references to /nix/store/* from options,
   # including any `extraSources` if some modules came from elsewhere,
diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix
index 1404231f837e..3048cd02683f 100644
--- a/nixos/modules/services/x11/xserver.nix
+++ b/nixos/modules/services/x11/xserver.nix
@@ -244,6 +244,13 @@ in
           "ati_unfree" "amdgpu" "amdgpu-pro"
           "nv" "nvidia" "nvidiaLegacy340" "nvidiaLegacy304"
         ];
+        # 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