From 8db1c56767512d709979332e463fe7d0a1ab572d Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Sat, 26 Mar 2022 18:43:55 -0400 Subject: [PATCH] Simplify concatApps --- flake.nix | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index 79f2002..bf635ce 100644 --- a/flake.nix +++ b/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