mirror of
https://github.com/RGBCube/AdventOfCode
synced 2025-07-25 02:57:42 +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
|
outputs = { nixpkgs, ... }: let
|
||||||
lib = nixpkgs.lib;
|
lib = nixpkgs.lib;
|
||||||
|
|
||||||
pathToResult = path: (import ./${path}.nix {
|
solutions = [
|
||||||
inherit lib;
|
"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
|
input = let
|
||||||
inputPath = lib.head (lib.splitString "-" path);
|
inputPath = head (splitString "-" path);
|
||||||
in builtins.concatStringsSep "\n"
|
inputStringLines = splitString "\n" (readFile ./${inputPath}.in);
|
||||||
(builtins.filter (line: line != "")
|
inputStringNoEmpty = concatStringsSep "\n" (filter (line: line != "") inputStringLines);
|
||||||
(lib.splitString "\n" (builtins.readFile ./${inputPath}.in)));
|
in inputStringNoEmpty;
|
||||||
}).result;
|
}).result);
|
||||||
in lib.genAttrs [
|
|
||||||
"2023/1-1"
|
|
||||||
"2023/1-2"
|
|
||||||
"2023/2-1"
|
|
||||||
"2023/2-2"
|
|
||||||
] pathToResult;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue