mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-23 06:21:30 +03:00
211528826c
- don't import eval-cache and flags modules by default (those have never been used so far) - mark options of package-func as internal. Those are for maintainers only and don't need to be rendered by default
54 lines
904 B
Nix
54 lines
904 B
Nix
# custom app to update the lock file of each exported package.
|
|
{
|
|
self,
|
|
lib,
|
|
inputs,
|
|
...
|
|
}: {
|
|
imports = [
|
|
./writers.nix
|
|
];
|
|
perSystem = {
|
|
config,
|
|
self',
|
|
inputs',
|
|
pkgs,
|
|
system,
|
|
...
|
|
}: let
|
|
l = lib // builtins;
|
|
|
|
packages = lib.filterAttrs (name: _: lib.hasPrefix "example-package-" name) self'.checks;
|
|
|
|
scripts =
|
|
l.flatten
|
|
(l.mapAttrsToList
|
|
(name: pkg: pkg.config.lock.refresh or [])
|
|
packages);
|
|
|
|
update-locks =
|
|
config.writers.writePureShellScript
|
|
(with pkgs; [
|
|
coreutils
|
|
git
|
|
nix
|
|
])
|
|
(
|
|
"set -x\n"
|
|
+ (l.concatStringsSep "/bin/refresh\n" scripts)
|
|
+ "/bin/refresh"
|
|
);
|
|
|
|
toApp = script: {
|
|
type = "app";
|
|
program = "${script}";
|
|
};
|
|
in {
|
|
apps = l.mapAttrs (_: toApp) {
|
|
inherit
|
|
update-locks
|
|
;
|
|
};
|
|
};
|
|
}
|