Skip to content

Commit a86f40c

Browse files
committed
Stub out day 11 in Lua
1 parent aaf79ad commit a86f40c

File tree

8 files changed

+88
-1
lines changed

8 files changed

+88
-1
lines changed

.github/workflows/run.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
matrix:
1313
os: ['ubuntu-latest', 'macos-latest']
14-
day: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10']
14+
day: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11']
1515
exclude:
1616
# TODO: Investigate why building Zig on macOS fails
1717
# https://github.com/fwcd/advent-of-code-2024/actions/runs/12202208638/job/34042374507

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ My solutions to the [Advent of Code 2024](https://adventofcode.com/2024), writte
1616
- [x] [**Day 08**](day08): [PHP](day08/src/day08.php)
1717
- [x] [**Day 09**](day09): [JavaScript](day09/src/day09.js)
1818
- [x] [**Day 10**](day10): [Groovy](day10/src/day10.groovy)
19+
- [ ] [**Day 11**](day11): [Lua](day11/src/day11.lua)
1920

2021
## Development
2122

day11/derivation.nix

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{ stdenv, lua }:
2+
stdenv.mkDerivation {
3+
name = "advent-of-code-2024-day11";
4+
src = ./src;
5+
6+
buildInputs = [
7+
lua
8+
];
9+
10+
installPhase = ''
11+
mkdir -p $out/{bin,share}
12+
cp day11.lua $out/share
13+
14+
cat <<EOF > $out/bin/day11
15+
#!/bin/bash
16+
exec "${lua.outPath}/bin/lua" "\$(dirname "\$0")/../share/day11.lua" "\$@"
17+
EOF
18+
19+
chmod +x $out/bin/day11
20+
'';
21+
}

day11/flake.lock

+27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

day11/flake.nix

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
description = "Advent of Code 2024 - Day 11 solution";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
6+
};
7+
8+
outputs = { self, nixpkgs }:
9+
let
10+
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
11+
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
12+
in {
13+
packages = forAllSystems (system:
14+
let
15+
pkgs = import nixpkgs { inherit system; };
16+
in {
17+
default = pkgs.callPackage ./derivation.nix {};
18+
}
19+
);
20+
21+
apps = forAllSystems (system: {
22+
default = {
23+
type = "app";
24+
program = "${self.packages.${system}.default}/bin/day11";
25+
};
26+
});
27+
};
28+
}

day11/resources/demo.txt

Whitespace-only changes.

day11/src/day11.lua

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env lua
2+
3+
print "Hello"

paths.json

+7
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,12 @@
7878
},
7979
"path": "day10/src/day10.groovy",
8080
"completed": true
81+
},
82+
{
83+
"lang": {
84+
"codemirror": "lua",
85+
"name": "Lua"
86+
},
87+
"path": "day11/src/day11.lua"
8188
}
8289
]

0 commit comments

Comments
 (0)