mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-11-26 09:46:04 +03:00
48 lines
750 B
Nix
48 lines
750 B
Nix
# custom app to update the eval-cache of each exported package.
|
|
{
|
|
self,
|
|
lib,
|
|
inputs,
|
|
...
|
|
}: {
|
|
perSystem = {
|
|
config,
|
|
self',
|
|
inputs',
|
|
pkgs,
|
|
system,
|
|
...
|
|
}: let
|
|
l = lib // builtins;
|
|
|
|
scripts =
|
|
l.flatten
|
|
(l.mapAttrsToList
|
|
(name: pkg: pkg.config.eval-cache.refresh or [])
|
|
self'.packages);
|
|
|
|
update-caches =
|
|
config.writers.writePureShellScript
|
|
(with pkgs; [
|
|
coreutils
|
|
git
|
|
nix
|
|
])
|
|
(
|
|
"set -x\n"
|
|
+ (l.concatStringsSep "\n" scripts)
|
|
);
|
|
|
|
toApp = script: {
|
|
type = "app";
|
|
program = "${script}";
|
|
};
|
|
in {
|
|
apps = l.mapAttrs (_: toApp) {
|
|
inherit
|
|
update-caches
|
|
;
|
|
};
|
|
};
|
|
}
|