From f2fae82f6f70d383a1ecf497a6f37cbed6a15dfc Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 7 Jul 2024 18:17:49 -0300 Subject: [PATCH 1/9] lib/categories.nix: create As a proof-of-concept for https://github.com/NixOS/rfcs/pull/146 --- lib/categories.nix | 58 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 lib/categories.nix diff --git a/lib/categories.nix b/lib/categories.nix new file mode 100644 index 0000000000000..b21edc36fa395 --- /dev/null +++ b/lib/categories.nix @@ -0,0 +1,58 @@ +/* List of categories + ```nix + handle = { + # Required + name = "Category Name"; + description = '' + Description of category + ''; + relatedCategories = [ related01 related02 . . . ]; + }; + ``` + + where + + - `handle` is the handle you are going to use in nixpkgs expressions; + usually the same as the name but in camelCase + - `name` is the category name + - `description` is a description of the category + - `relatedCategories` is a (possibly empty) list of related categories (like + the `handle` above) + + More fields may be added in the future. + + When editing this file: + * do not modify any of + - mainCategories + - additionalCategories + - reservedCategories + except by reasons of force majeure (e.g. an update on the Freedesktop.org + Desktop Menu Specification); + * keep the lists alphabetically sorted; + * test the validity of the format with: + nix-build lib/tests/categories.nix +*/ +{ lib }: + +let + mainCategories = { + }; + + additionalCategories = { + }; + + reservedCategories = { + }; + + # "Custom" list of categories for the use of Nixpkgs + nixpkgsAdditionalCategories = { + }; + + allCategories = lib.foldl lib.recursiveUpdate {} [ + mainCategories + additionalCategories + reservedCategories + nixpkgsAdditionalCategories + ]; +in +allCategories From 0be99db2e710be53b8bebe2725fe7ffe160e6d05 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 7 Jul 2024 18:17:13 -0300 Subject: [PATCH 2/9] lib/default.nix: point to categories.nix As a proof-of-concept for https://github.com/NixOS/rfcs/pull/146 --- lib/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/default.nix b/lib/default.nix index ef0bb60ab8c51..bc564a881b41a 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -25,6 +25,7 @@ let customisation = callLibs ./customisation.nix; derivations = callLibs ./derivations.nix; maintainers = import ../maintainers/maintainer-list.nix; + categories = callLibs ./categories.nix; teams = callLibs ../maintainers/team-list.nix; meta = callLibs ./meta.nix; versions = callLibs ./versions.nix; From 07cb019db3875a4b73c8355d948c8f78bc01fd26 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 7 Jul 2024 18:28:37 -0300 Subject: [PATCH 3/9] pkgs/stdenv/generic/check-meta.nix: add categories to metaTypes --- pkgs/stdenv/generic/check-meta.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/stdenv/generic/check-meta.nix b/pkgs/stdenv/generic/check-meta.nix index 502343f01fb32..056f8b02d1c47 100644 --- a/pkgs/stdenv/generic/check-meta.nix +++ b/pkgs/stdenv/generic/check-meta.nix @@ -320,6 +320,7 @@ let ]; sourceProvenance = listOf attrs; maintainers = listOf (attrsOf any); # TODO use the maintainer type from lib/tests/maintainer-module.nix + categories = listOf lib.types.attrs; priority = int; pkgConfigModules = listOf str; inherit platforms; From 040eac2e5955e3d925d5aaf865264fd15ea7b76e Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Fri, 28 Jul 2023 23:07:38 -0300 Subject: [PATCH 4/9] doc/stdenv/meta.chapter.md: document meta.categories --- doc/stdenv/meta.chapter.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/stdenv/meta.chapter.md b/doc/stdenv/meta.chapter.md index e6de030ff9c19..6bebe6d9638dd 100644 --- a/doc/stdenv/meta.chapter.md +++ b/doc/stdenv/meta.chapter.md @@ -194,6 +194,10 @@ Unfree package that cannot be redistributed. You can build it yourself, but you This package supplies unfree, redistributable firmware. This is a separate value from `unfree-redistributable` because not everybody cares whether firmware is free. +## Categories {#sec-meta-categories} + +The `meta.categories` attribute of the package should contain a value from `lib.categories` set defined in [`nixpkgs/lib/categories-set.nix`](https://github.com/NixOS/nixpkgs/blob/master/lib/categories-set.nix). + ## Source provenance {#sec-meta-sourceProvenance} The value of a package's `meta.sourceProvenance` attribute specifies the provenance of the package's derivation outputs. From b472a7c45de706f7e95fee2155462d45ff85fdc4 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Wed, 23 Aug 2023 23:02:49 -0300 Subject: [PATCH 5/9] create base category `software` --- lib/categories.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/categories.nix b/lib/categories.nix index b21edc36fa395..7ae015f608861 100644 --- a/lib/categories.nix +++ b/lib/categories.nix @@ -46,6 +46,18 @@ let # "Custom" list of categories for the use of Nixpkgs nixpkgsAdditionalCategories = { + software = { + name = "Software"; + description = '' + Any piece of software, here understood as a set of data, routines and + programs associated with the operation of a computer system. + + This category is a catch-all placeholder for situations in which a more + specific category is not possible or desired - such as automatically + generated packages. + ''; + relatedCategories = [ /* Always empty*/ ]; + }; }; allCategories = lib.foldl lib.recursiveUpdate {} [ From 14c2171b4cc55ff1064a78b8924652eee0c75386 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Thu, 10 Aug 2023 08:54:00 -0300 Subject: [PATCH 6/9] populate maintainers/categories-set.nix As a proof-of-concept for NixOS RFC 146 Double wip because it lacks the descriptions. --- lib/categories.nix | 859 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 859 insertions(+) diff --git a/lib/categories.nix b/lib/categories.nix index 7ae015f608861..3942ef5f50979 100644 --- a/lib/categories.nix +++ b/lib/categories.nix @@ -36,12 +36,871 @@ let mainCategories = { + audioVideo = { + name = "audioVideo"; + description = '' + ''; + relatedCategories = []; + }; + audio = { + name = "audio"; + description = '' + ''; + relatedCategories = []; + }; + video = { + name = "video"; + description = '' + ''; + relatedCategories = []; + }; + development = { + name = "development"; + description = '' + ''; + relatedCategories = []; + }; + education = { + name = "education"; + description = '' + ''; + relatedCategories = []; + }; + game = { + name = "game"; + description = '' + ''; + relatedCategories = []; + }; + graphics = { + name = "graphics"; + description = '' + ''; + relatedCategories = []; + }; + network = { + name = "network"; + description = '' + ''; + relatedCategories = []; + }; + office = { + name = "office"; + description = '' + ''; + relatedCategories = []; + }; + science = { + name = "science"; + description = '' + ''; + relatedCategories = []; + }; + settings = { + name = "settings"; + description = '' + ''; + relatedCategories = []; + }; + system = { + name = "system"; + description = '' + ''; + relatedCategories = []; + }; + utility = { + name = "utility"; + description = '' + ''; + relatedCategories = []; + }; }; additionalCategories = { + _2DGraphics = { + name = "2DGraphics"; + description = '' + 2D based graphical application + ''; + relatedCategories = []; + }; + _3DGraphics = { + name = "3DGraphics"; + description = '' + ''; + relatedCategories = []; + }; + accessibility = { + name = "accessibility"; + description = '' + ''; + relatedCategories = []; + }; + actionGame = { + name = "actionGame"; + description = '' + ''; + relatedCategories = []; + }; + adult = { + name = "adult"; + description = '' + ''; + relatedCategories = []; + }; + adventureGame = { + name = "adventureGame"; + description = '' + ''; + relatedCategories = []; + }; + amusement = { + name = "amusement"; + description = '' + ''; + relatedCategories = []; + }; + arcadeGame = { + name = "arcadeGame"; + description = '' + ''; + relatedCategories = []; + }; + archiving = { + name = "archiving"; + description = '' + ''; + relatedCategories = []; + }; + art = { + name = "art"; + description = '' + ''; + relatedCategories = []; + }; + artificialIntelligence = { + name = "artificialIntelligence"; + description = '' + ''; + relatedCategories = []; + }; + astronomy = { + name = "astronomy"; + description = '' + ''; + relatedCategories = []; + }; + audioVideoEditing = { + name = "audioVideoEditing"; + description = '' + ''; + relatedCategories = []; + }; + biology = { + name = "biology"; + description = '' + ''; + relatedCategories = []; + }; + blocksGame = { + name = "blocksGame"; + description = '' + ''; + relatedCategories = []; + }; + boardGame = { + name = "boardGame"; + description = '' + ''; + relatedCategories = []; + }; + building = { + name = "building"; + description = '' + ''; + relatedCategories = []; + }; + calculator = { + name = "calculator"; + description = '' + ''; + relatedCategories = []; + }; + calendar = { + name = "calendar"; + description = '' + ''; + relatedCategories = []; + }; + cardGame = { + name = "cardGame"; + description = '' + ''; + relatedCategories = []; + }; + chart = { + name = "chart"; + description = '' + ''; + relatedCategories = []; + }; + chat = { + name = "chat"; + description = '' + ''; + relatedCategories = []; + }; + chemistry = { + name = "chemistry"; + description = '' + ''; + relatedCategories = []; + }; + clock = { + name = "clock"; + description = '' + ''; + relatedCategories = []; + }; + compression = { + name = "compression"; + description = '' + ''; + relatedCategories = []; + }; + computerScience = { + name = "computerScience"; + description = '' + ''; + relatedCategories = []; + }; + consoleOnly = { + name = "consoleOnly"; + description = '' + ''; + relatedCategories = []; + }; + construction = { + name = "construction"; + description = '' + ''; + relatedCategories = []; + }; + contactManagement = { + name = "contactManagement"; + description = '' + ''; + relatedCategories = []; + }; + core = { + name = "core"; + description = '' + ''; + relatedCategories = []; + }; + dataVisualization = { + name = "dataVisualization"; + description = '' + ''; + relatedCategories = []; + }; + database = { + name = "database"; + description = '' + ''; + relatedCategories = []; + }; + debugger = { + name = "debugger"; + description = '' + ''; + relatedCategories = []; + }; + desktopSettings = { + name = "desktopSettings"; + description = '' + ''; + relatedCategories = []; + }; + dialup = { + name = "dialup"; + description = '' + ''; + relatedCategories = []; + }; + dictionary = { + name = "dictionary"; + description = '' + ''; + relatedCategories = []; + }; + discBurning = { + name = "discBurning"; + description = '' + ''; + relatedCategories = []; + }; + documentation = { + name = "documentation"; + description = '' + ''; + relatedCategories = []; + }; + economy = { + name = "economy"; + description = '' + ''; + relatedCategories = []; + }; + electricity = { + name = "electricity"; + description = '' + ''; + relatedCategories = []; + }; + electronics = { + name = "electronics"; + description = '' + ''; + relatedCategories = []; + }; + email = { + name = "email"; + description = '' + ''; + relatedCategories = []; + }; + emulator = { + name = "emulator"; + description = '' + ''; + relatedCategories = []; + }; + engineering = { + name = "engineering"; + description = '' + ''; + relatedCategories = []; + }; + feed = { + name = "feed"; + description = '' + ''; + relatedCategories = []; + }; + fileManager = { + name = "fileManager"; + description = '' + ''; + relatedCategories = []; + }; + fileTools = { + name = "fileTools"; + description = '' + ''; + relatedCategories = []; + }; + fileTransfer = { + name = "fileTransfer"; + description = '' + ''; + relatedCategories = []; + }; + filesystem = { + name = "filesystem"; + description = '' + ''; + relatedCategories = []; + }; + finance = { + name = "finance"; + description = '' + ''; + relatedCategories = []; + }; + flowChart = { + name = "flowChart"; + description = '' + ''; + relatedCategories = []; + }; + geography = { + name = "geography"; + description = '' + ''; + relatedCategories = []; + }; + geology = { + name = "geology"; + description = '' + ''; + relatedCategories = []; + }; + geoscience = { + name = "geoscience"; + description = '' + ''; + relatedCategories = []; + }; + gnome = { + name = "gnome"; + description = '' + ''; + relatedCategories = []; + }; + gtk = { + name = "gtk"; + description = '' + ''; + relatedCategories = []; + }; + guiDesigner = { + name = "guiDesigner"; + description = '' + ''; + relatedCategories = []; + }; + hamRadio = { + name = "hamRadio"; + description = '' + ''; + relatedCategories = []; + }; + hardwareSettings = { + name = "hardwareSettings"; + description = '' + ''; + relatedCategories = []; + }; + history = { + name = "history"; + description = '' + ''; + relatedCategories = []; + }; + humanities = { + name = "humanities"; + description = '' + ''; + relatedCategories = []; + }; + ide = { + name = "ide"; + description = '' + ''; + relatedCategories = []; + }; + imageProcessing = { + name = "imageProcessing"; + description = '' + ''; + relatedCategories = []; + }; + instantMessaging = { + name = "instantMessaging"; + description = '' + ''; + relatedCategories = []; + }; + ircClient = { + name = "ircClient"; + description = '' + ''; + relatedCategories = []; + }; + java = { + name = "java"; + description = '' + ''; + relatedCategories = []; + }; + kde = { + name = "kde"; + description = '' + ''; + relatedCategories = []; + }; + kidsGame = { + name = "kidsGame"; + description = '' + ''; + relatedCategories = []; + }; + languages = { + name = "languages"; + description = '' + ''; + relatedCategories = []; + }; + literature = { + name = "literature"; + description = '' + ''; + relatedCategories = []; + }; + logicGame = { + name = "logicGame"; + description = '' + ''; + relatedCategories = []; + }; + maps = { + name = "maps"; + description = '' + ''; + relatedCategories = []; + }; + math = { + name = "math"; + description = '' + ''; + relatedCategories = []; + }; + medicalSoftware = { + name = "medicalSoftware"; + description = '' + ''; + relatedCategories = []; + }; + midi = { + name = "midi"; + description = '' + ''; + relatedCategories = []; + }; + mixer = { + name = "mixer"; + description = '' + ''; + relatedCategories = []; + }; + monitor = { + name = "monitor"; + description = '' + ''; + relatedCategories = []; + }; + motif = { + name = "motif"; + description = '' + ''; + relatedCategories = []; + }; + music = { + name = "music"; + description = '' + ''; + relatedCategories = []; + }; + news = { + name = "news"; + description = '' + ''; + relatedCategories = []; + }; + numericalAnalysis = { + name = "numericalAnalysis"; + description = '' + ''; + relatedCategories = []; + }; + ocr = { + name = "ocr"; + description = '' + ''; + relatedCategories = []; + }; + p2p = { + name = "p2p"; + description = '' + ''; + relatedCategories = []; + }; + packageManager = { + name = "packageManager"; + description = '' + ''; + relatedCategories = []; + }; + parallelComputing = { + name = "parallelComputing"; + description = '' + ''; + relatedCategories = []; + }; + pda = { + name = "pda"; + description = '' + ''; + relatedCategories = []; + }; + photography = { + name = "photography"; + description = '' + ''; + relatedCategories = []; + }; + physics = { + name = "physics"; + description = '' + ''; + relatedCategories = []; + }; + player = { + name = "player"; + description = '' + ''; + relatedCategories = []; + }; + presentation = { + name = "presentation"; + description = '' + ''; + relatedCategories = []; + }; + printing = { + name = "printing"; + description = '' + ''; + relatedCategories = []; + }; + profiling = { + name = "profiling"; + description = '' + ''; + relatedCategories = []; + }; + projectManagement = { + name = "projectManagement"; + description = '' + ''; + relatedCategories = []; + }; + publishing = { + name = "publishing"; + description = '' + ''; + relatedCategories = []; + }; + qt = { + name = "qt"; + description = '' + ''; + relatedCategories = []; + }; + rasterGraphics = { + name = "rasterGraphics"; + description = '' + ''; + relatedCategories = []; + }; + recorder = { + name = "recorder"; + description = '' + ''; + relatedCategories = []; + }; + remoteAccess = { + name = "remoteAccess"; + description = '' + ''; + relatedCategories = []; + }; + revisionControl = { + name = "revisionControl"; + description = '' + ''; + relatedCategories = []; + }; + robotics = { + name = "robotics"; + description = '' + ''; + relatedCategories = []; + }; + rolePlaying = { + name = "rolePlaying"; + description = '' + ''; + relatedCategories = []; + }; + scanning = { + name = "scanning"; + description = '' + ''; + relatedCategories = []; + }; + security = { + name = "security"; + description = '' + ''; + relatedCategories = []; + }; + sequencer = { + name = "sequencer"; + description = '' + ''; + relatedCategories = []; + }; + shooter = { + name = "shooter"; + description = '' + ''; + relatedCategories = []; + }; + simulation = { + name = "simulation"; + description = '' + ''; + relatedCategories = []; + }; + spirituality = { + name = "spirituality"; + description = '' + ''; + relatedCategories = []; + }; + sports = { + name = "sports"; + description = '' + ''; + relatedCategories = []; + }; + sportsGame = { + name = "sportsGame"; + description = '' + ''; + relatedCategories = []; + }; + spreadsheet = { + name = "spreadsheet"; + description = '' + ''; + relatedCategories = []; + }; + strategyGame = { + name = "strategyGame"; + description = '' + ''; + relatedCategories = []; + }; + telephony = { + name = "telephony"; + description = '' + ''; + relatedCategories = []; + }; + telephonyTools = { + name = "telephonyTools"; + description = '' + ''; + relatedCategories = []; + }; + terminalEmulator = { + name = "terminalEmulator"; + description = '' + ''; + relatedCategories = []; + }; + textEditor = { + name = "textEditor"; + description = '' + ''; + relatedCategories = []; + }; + textTools = { + name = "textTools"; + description = '' + ''; + relatedCategories = []; + }; + translation = { + name = "translation"; + description = '' + ''; + relatedCategories = []; + }; + tuner = { + name = "tuner"; + description = '' + ''; + relatedCategories = []; + }; + tv = { + name = "tv"; + description = '' + ''; + relatedCategories = []; + }; + vectorGraphics = { + name = "vectorGraphics"; + description = '' + ''; + relatedCategories = []; + }; + videoConference = { + name = "videoConference"; + description = '' + ''; + relatedCategories = []; + }; + viewer = { + name = "viewer"; + description = '' + ''; + relatedCategories = []; + }; + webBrowser = { + name = "webBrowser"; + description = '' + ''; + relatedCategories = []; + }; + webDevelopment = { + name = "webDevelopment"; + description = '' + ''; + relatedCategories = []; + }; + wordProcessor = { + name = "wordProcessor"; + description = '' + ''; + relatedCategories = []; + }; + xfce = { + name = "xfce"; + description = '' + ''; + relatedCategories = []; + }; }; reservedCategories = { + applet = { + name = "applet"; + description = '' + ''; + relatedCategories = []; + }; + screensaver = { + name = "screensaver"; + description = '' + ''; + relatedCategories = []; + }; + shell = { + name = "shell"; + description = '' + ''; + relatedCategories = []; + }; + trayIcon = { + name = "trayIcon"; + description = '' + ''; + relatedCategories = []; + }; }; # "Custom" list of categories for the use of Nixpkgs From fef21de5ef4dbac8c3fb73cc8f9b846c7a07bdf6 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Wed, 23 Aug 2023 23:05:23 -0300 Subject: [PATCH 7/9] categories: add `compiler` --- lib/categories.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/categories.nix b/lib/categories.nix index 3942ef5f50979..ff0eda924a09f 100644 --- a/lib/categories.nix +++ b/lib/categories.nix @@ -917,6 +917,16 @@ let ''; relatedCategories = [ /* Always empty*/ ]; }; + compiler = { + name = "Compiler"; + description = '' + A program that converts a source from a language to another, usually + from a higher, human-readable level to a lower, machine level. + ''; + relatedCategories = [ + allCategories.development + ]; + }; }; allCategories = lib.foldl lib.recursiveUpdate {} [ From 9cfb472251bdc39beb32f248097265316f0cc3a7 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Wed, 23 Aug 2023 23:06:44 -0300 Subject: [PATCH 8/9] categories: add `assembler` --- lib/categories.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/categories.nix b/lib/categories.nix index ff0eda924a09f..b2ad125eaa956 100644 --- a/lib/categories.nix +++ b/lib/categories.nix @@ -917,6 +917,16 @@ let ''; relatedCategories = [ /* Always empty*/ ]; }; + assembler = { + name = "Assembler"; + description = '' + A program that converts files written in assembly language to binary + code. + ''; + relatedCategories = [ + allCategories.compiler + ]; + }; compiler = { name = "Compiler"; description = '' From 840125727b53392f7ead83c3ceef4b94f6a9c98a Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Wed, 9 Aug 2023 23:34:17 -0300 Subject: [PATCH 9/9] xa: set meta.categories --- pkgs/development/compilers/xa/xa.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/compilers/xa/xa.nix b/pkgs/development/compilers/xa/xa.nix index 52be6de0812df..0a676804e5215 100644 --- a/pkgs/development/compilers/xa/xa.nix +++ b/pkgs/development/compilers/xa/xa.nix @@ -62,6 +62,7 @@ stdenv.mkDerivation (finalAttrs: { suite, as well as "bare" plain binary object files - block structure for label scoping ''; + categories = with lib.categories; [ assembler ]; license = lib.licenses.gpl2Plus; maintainers = with lib.maintainers; [ AndersonTorres ]; platforms = with lib.platforms; unix;