Simplify concatApps
This commit is contained in:
parent
2ed780a50a
commit
8db1c56767
1 changed files with 5 additions and 8 deletions
13
flake.nix
13
flake.nix
|
@ -61,16 +61,13 @@
|
|||
|
||||
# Concat a list of Flake apps to produce a new app that runs all of them
|
||||
# in sequence.
|
||||
concatApps = system: apps:
|
||||
let
|
||||
lists = pkgs.lib.lists;
|
||||
joinBy = sep: lists.foldr (a: b: a + sep + b) "";
|
||||
programs = lists.forEach apps (app: app.program);
|
||||
in
|
||||
concatApps = apps:
|
||||
{
|
||||
type = "app";
|
||||
program = checkedShellScript "concatApps"
|
||||
(joinBy "\n" programs);
|
||||
(pkgs.lib.strings.concatStringsSep
|
||||
"\n"
|
||||
(pkgs.lib.lists.forEach apps (app: app.program)));
|
||||
};
|
||||
|
||||
in
|
||||
|
@ -82,7 +79,7 @@
|
|||
|
||||
# Used by `nix run ...`
|
||||
apps = {
|
||||
format = concatApps system [
|
||||
format = concatApps [
|
||||
inputs.lint-utils.apps.${system}.${haskellFormatter}
|
||||
inputs.lint-utils.apps.${system}.cabal-fmt
|
||||
inputs.lint-utils.apps.${system}.nixpkgs-fmt
|
||||
|
|
Loading…
Reference in a new issue