1
Fork 0
mirror of https://github.com/RGBCube/AdventOfCode synced 2025-05-31 09:58:10 +00:00

Clean up flake

This commit is contained in:
RGBCube 2023-12-02 17:50:50 +03:00
parent ffeb490257
commit c3c1aa3d7d
No known key found for this signature in database

View file

@ -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);
}