mirror of
https://github.com/RGBCube/AdventOfCode
synced 2025-05-31 09:58:10 +00:00
Clean up flake
This commit is contained in:
parent
ffeb490257
commit
c3c1aa3d7d
1 changed files with 14 additions and 14 deletions
28
flake.nix
28
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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue