1
Fork 0
mirror of https://github.com/RGBCube/AdventOfCode synced 2025-07-25 19:17:44 +00:00
AdventOfCode/flake.nix
2023-12-02 17:50:50 +03:00

28 lines
673 B
Nix

{
description = "RGBCube's Advent of Code solutions.";
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-unstable";
};
};
outputs = { nixpkgs, ... }: let
lib = nixpkgs.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 = head (splitString "-" path);
inputStringLines = splitString "\n" (readFile ./${inputPath}.in);
inputStringNoEmpty = concatStringsSep "\n" (filter (line: line != "") inputStringLines);
in inputStringNoEmpty;
}).result);
}