Skip to content

Commit 8d88a3b

Browse files
committed
Stub out day 1
1 parent 9ebc928 commit 8d88a3b

File tree

5 files changed

+77
-1
lines changed

5 files changed

+77
-1
lines changed

day01/derivation.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{ stdenv, powershell }:
2+
stdenv.mkDerivation {
3+
name = "advent-of-code-2024-day01";
4+
src = ./src;
5+
6+
installPhase = ''
7+
mkdir -p $out/bin
8+
cp day01.ps1 $out/bin/day01
9+
'';
10+
}

day01/flake.lock

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

day01/flake.nix

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
description = "Advent of Code 2024 - Day 01 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/day01";
25+
};
26+
});
27+
};
28+
}

day01/src/day01.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env pwsh
2+
3+
Write-Output "Hello, world!"

paths.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
[]
1+
[
2+
{
3+
"lang": {
4+
"codemirror": "powershell",
5+
"name": "PowerShell"
6+
},
7+
"path": "day01/src/day01.ps1"
8+
}
9+
]

0 commit comments

Comments
 (0)