From c3c1aa3d7de81a3c9f97f1e9e2d1515a1b87b018 Mon Sep 17 00:00:00 2001 From: RGBCube Date: Sat, 2 Dec 2023 17:50:50 +0300 Subject: [PATCH] Clean up flake --- flake.nix | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/flake.nix b/flake.nix index 7900399..0c2a5fe 100644 --- a/flake.nix +++ b/flake.nix @@ -10,19 +10,19 @@ outputs = { nixpkgs, ... }: let lib = nixpkgs.lib; - pathToResult = path: (import ./${path}.nix { - inherit lib; + solutions = [ + "2023/1-1" + "2023/1-2" + "2023/2-1" + "2023/2-2" + ]; + in with builtins; with lib; genAttrs solutions (path: (import ./${path}.nix { + inherit lib; - input = let - inputPath = lib.head (lib.splitString "-" path); - in builtins.concatStringsSep "\n" - (builtins.filter (line: line != "") - (lib.splitString "\n" (builtins.readFile ./${inputPath}.in))); - }).result; - in lib.genAttrs [ - "2023/1-1" - "2023/1-2" - "2023/2-1" - "2023/2-2" - ] pathToResult; + input = let + inputPath = head (splitString "-" path); + inputStringLines = splitString "\n" (readFile ./${inputPath}.in); + inputStringNoEmpty = concatStringsSep "\n" (filter (line: line != "") inputStringLines); + in inputStringNoEmpty; + }).result); }