2023-02-17 05:08:57 +03:00
|
|
|
{ self, lib, inputs, ... }: {
|
|
|
|
perSystem = { config, self', inputs', pkgs, system, ... }: let
|
|
|
|
|
|
|
|
l = lib // builtins;
|
|
|
|
|
|
|
|
allNewFileCommands = l.flatten
|
|
|
|
(l.mapAttrsToList
|
2023-03-04 09:41:44 +03:00
|
|
|
(name: pkg: pkg.config.eval-cache.refresh or [])
|
2023-02-17 05:08:57 +03:00
|
|
|
self'.packages);
|
|
|
|
|
|
|
|
update-caches = config.writers.writePureShellScript
|
|
|
|
(with pkgs; [
|
|
|
|
coreutils
|
|
|
|
git
|
|
|
|
nix
|
|
|
|
])
|
|
|
|
(
|
|
|
|
"set -x\n"
|
|
|
|
+ (l.concatStringsSep "\n" allNewFileCommands)
|
|
|
|
);
|
|
|
|
|
|
|
|
toApp = script: {
|
|
|
|
type = "app";
|
|
|
|
program = "${script}";
|
|
|
|
};
|
|
|
|
|
|
|
|
in {
|
|
|
|
apps = l.mapAttrs (_: toApp) {
|
|
|
|
inherit
|
|
|
|
update-caches
|
|
|
|
;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|