packages/catalog: add packages and pins
This commit is contained in:
parent
4db993b108
commit
8aaa15dd16
2 changed files with 30 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./checks.nix
|
./checks.nix
|
||||||
|
./packages.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
29
packages/catalog/packages.nix
Normal file
29
packages/catalog/packages.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue