packages/catalog: add packages and pins

This commit is contained in:
Max Headroom 2024-07-06 22:26:21 +02:00
parent 4db993b108
commit 8aaa15dd16
2 changed files with 30 additions and 0 deletions

View file

@ -1,5 +1,6 @@
{ {
imports = [ imports = [
./checks.nix ./checks.nix
./packages.nix
]; ];
} }

View file

@ -0,0 +1,29 @@
{ 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;
};
};
}