Skip to content

Commit

Permalink
lib/categories.nix: create
Browse files Browse the repository at this point in the history
As a proof-of-concept for NixOS/rfcs#146
  • Loading branch information
AndersonTorres committed Jul 8, 2024
1 parent 6f4c77a commit f2fae82
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions lib/categories.nix
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f2fae82

Please sign in to comment.