mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-25 15:33:20 +03:00
35 lines
653 B
Nix
35 lines
653 B
Nix
{ self, lib, inputs, ... }: {
|
|
perSystem = { config, self', inputs', pkgs, system, ... }: let
|
|
|
|
l = lib // builtins;
|
|
|
|
allNewFileCommands = l.flatten
|
|
(l.mapAttrsToList
|
|
(name: pkg: pkg.eval-cache.refresh or [])
|
|
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
|
|
;
|
|
};
|
|
};
|
|
}
|