DeterminateSystems / flake-schemas

Schemas for common flake output types
MIT License
80 stars 5 forks source link

Add `shortDescription` to `appsSchema` #31

Open shivaraj-bh opened 2 months ago

shivaraj-bh commented 2 months ago

Flake apps could benefit from a description. As an example, here’s a simple flake:

{
  inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
  outputs = { self, nixpkgs, ... }:{
    apps.aarch64-darwin.hello = {
      program = "${nixpkgs.lib.getExe nixpkgs.legacyPackages.aarch64-darwin.hello}";
      type = "app";
      description = "I say hello!";
    };
  };
}

and the corresponding nix flake show --default-flake-schemas github:shivaraj-bh/flake-schemas/apps --json output, where nix is compiled from https://github.com/DeterminateSystems/nix-src/tree/flake-schemas:

{
  "apps": {
    "doc": "The `apps` output provides commands available via `nix run`.\n",
    "output": {
      "children": {
        "aarch64-darwin": {
          "children": {
            "hello": {
              "leaf": true,
              "shortDescription": "I say hello!",
              "what": "app"
            }
          }
        }
      }
    }
  },
  ...
}

Question

Should we stick to the meta attribute of derivations for apps as well?

shivaraj-bh commented 2 months ago

description for flake apps should be standardised after https://github.com/NixOS/nix/pull/11297