2023-03-23 12:19:53 +03:00
|
|
|
# custom app to update the eval-cache of each exported package.
|
|
|
|
{
|
|
|
|
self,
|
|
|
|
lib,
|
|
|
|
inputs,
|
|
|
|
...
|
|
|
|
}: {
|
2023-03-24 10:54:14 +03:00
|
|
|
imports = [
|
|
|
|
./writers.nix
|
|
|
|
];
|
2023-03-23 12:19:53 +03:00
|
|
|
perSystem = {
|
|
|
|
config,
|
|
|
|
self',
|
|
|
|
inputs',
|
|
|
|
pkgs,
|
|
|
|
system,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
l = lib // builtins;
|
|
|
|
|
2023-03-24 06:47:49 +03:00
|
|
|
scripts =
|
2023-03-23 12:19:53 +03:00
|
|
|
l.flatten
|
|
|
|
(l.mapAttrsToList
|
|
|
|
(name: pkg: pkg.config.lock.refresh or [])
|
|
|
|
self'.packages);
|
|
|
|
|
|
|
|
update-locks =
|
|
|
|
config.writers.writePureShellScript
|
|
|
|
(with pkgs; [
|
|
|
|
coreutils
|
|
|
|
git
|
|
|
|
nix
|
|
|
|
])
|
|
|
|
(
|
|
|
|
"set -x\n"
|
2023-03-24 06:47:49 +03:00
|
|
|
+ (l.concatStringsSep "/bin/refresh\n" scripts)
|
2023-03-23 12:19:53 +03:00
|
|
|
+ "/bin/refresh"
|
|
|
|
);
|
|
|
|
|
|
|
|
toApp = script: {
|
|
|
|
type = "app";
|
|
|
|
program = "${script}";
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
apps = l.mapAttrs (_: toApp) {
|
|
|
|
inherit
|
|
|
|
update-locks
|
|
|
|
;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|