nix: Add meta field to package

The most relevant part (and the reason for this change) is the addition
of the `mainProgram` attribute. This allows getting the executable name
from inside nix expressions with ease:

```
# before
lib.getExe' jujutsu "jj"
# or
"${jujutsu}/bin/jj"
```

```
# now
lib.getExe jujutsu
```
This commit is contained in:
Joaquín Triñanes 2024-11-09 03:20:57 +01:00 committed by Austin Seipp
parent 560d66ecee
commit f1a9f62e3d

View file

@ -118,13 +118,20 @@
--fish <($out/bin/jj util completion fish) \
--zsh <($out/bin/jj util completion zsh)
'';
meta = {
description = "Git-compatible DVCS that is both simple and powerful";
homepage = "https://github.com/martinvonz/jj";
license = pkgs.lib.licenses.asl20;
mainProgram = "jj";
};
};
default = self.packages.${system}.jujutsu;
};
apps.default = {
type = "app";
program = "${self.packages.${system}.jujutsu}/bin/jj";
program = pkgs.lib.getExe self.packages.${system}.jujutsu;
};
formatter = pkgs.nixpkgs-fmt;