depot/packages/catalog/packages.nix

30 lines
754 B
Nix
Raw Normal View History

{ lib, ... }:
let
pins = import ../sources;
in
{
perSystem = { config, ... }: {
catalog.depot = {
packages = lib.mapAttrs (name: package: {
description = package.meta.description or "Package: ${name}";
actions = lib.mkMerge [
{
build = {
description = "Build this package.";
command = "nix build -L '${builtins.unsafeDiscardStringContext package.drvPath}^*'";
};
}
(lib.mkIf (pins ? ${name}) {
updatePin = {
description = "Update this package's source pin.";
command = "${lib.getExe config.packages.pin} update ${name}";
};
})
];
}) config.packages;
};
};
}