Merge pull request #41764 from oxij/nixos/some-more-related-packages

nixos: add some more related packages
This commit is contained in:
Michael Raskin 2018-06-13 17:03:56 +00:00 committed by GitHub
commit f35cc5eb42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -31,11 +31,12 @@ let
else p; else p;
describe = args: describe = args:
let let
title = args.title or null;
name = args.name or (lib.concatStringsSep "." args.path); name = args.name or (lib.concatStringsSep "." args.path);
path = args.path or [ args.name ]; path = args.path or [ args.name ];
package = args.package or (lib.attrByPath path (throw "Invalid package attribute path `${toString path}'") pkgs); package = args.package or (lib.attrByPath path (throw "Invalid package attribute path `${toString path}'") pkgs);
in "<listitem>" 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>" + lib.optionalString (!package.meta.available) " <emphasis>[UNAVAILABLE]</emphasis>"
+ ": ${package.meta.description or "???"}.</para>" + ": ${package.meta.description or "???"}.</para>"
+ lib.optionalString (args ? comment) "\n<para>${args.comment}</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 ? example) { example = substFunction opt.example; }
// lib.optionalAttrs (opt ? default) { default = substFunction opt.default; } // lib.optionalAttrs (opt ? default) { default = substFunction opt.default; }
// lib.optionalAttrs (opt ? type) { type = substFunction opt.type; } // 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, # We need to strip references to /nix/store/* from options,
# including any `extraSources` if some modules came from elsewhere, # including any `extraSources` if some modules came from elsewhere,

View File

@ -244,6 +244,13 @@ in
"ati_unfree" "amdgpu" "amdgpu-pro" "ati_unfree" "amdgpu" "amdgpu-pro"
"nv" "nvidia" "nvidiaLegacy340" "nvidiaLegacy304" "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 = '' description = ''
The names of the video drivers the configuration The names of the video drivers the configuration
supports. They will be tried in order until one that supports. They will be tried in order until one that