commit d5e9ce2d39148641bc7ca5e9eaf26bee71b98bc0
Author: h7x4 <h7x4@nani.wtf>
Date:   Thu Dec 1 21:38:11 2022 +0100

    Day 01

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e2f5dd2
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+result
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..b657932
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2022 h7x4
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..4ee4681
--- /dev/null
+++ b/README.md
@@ -0,0 +1,13 @@
+# Advent of code 2022 - Nix
+
+This is [Advent of Code 2022][aoc2022] (or at least as far as I'm able to get before having to deal with my exams...)
+
+They're written in nix this year.
+
+To run the code:
+
+```
+nix build github:h7x4/aoc2022#day01
+```
+
+[aoc2022]: https://adventofcode.com/2022
\ No newline at end of file
diff --git a/day01/default.nix b/day01/default.nix
new file mode 100644
index 0000000..c99d67c
--- /dev/null
+++ b/day01/default.nix
@@ -0,0 +1,32 @@
+{ pkgs, lib, ... }:
+
+with lib;
+
+let 
+  elves = pipe (builtins.readFile ./input.txt) [
+    (splitString "\n\n")
+    (map (splitString "\n"))
+    (map (map toInt))
+    (map (fold add 0))
+  ];
+
+  answer1 = toString (fold max (-1) elves);
+
+  max3 = abc: x: if x >= abc.a then { a = x; b = abc.a; c = abc.b; } else
+                 if x >= abc.b then { a = abc.a; b = x; c = abc.b; } else
+                 if x >= abc.c then { inherit (abc) a b; c = x; } else
+                 abc;
+
+  answer2 = pipe elves [
+    (foldl max3 { a = -1; b = -1; c = -1; })
+    (abc: abc.a + abc.b + abc.c)
+    toString
+  ];
+
+in pkgs.writeText "answers" ''
+  Task1:
+    ${answer1}
+
+  Task2:
+    ${answer2}
+''
\ No newline at end of file
diff --git a/day01/input.txt b/day01/input.txt
new file mode 100644
index 0000000..9e4c1ab
--- /dev/null
+++ b/day01/input.txt
@@ -0,0 +1,2265 @@
+11334
+6264
+9318
+
+1209
+4404
+3988
+5816
+3890
+4990
+2796
+4199
+5439
+4249
+2938
+1120
+2612
+
+1755
+12840
+6995
+1547
+13621
+3701
+
+5499
+3383
+3991
+6695
+2008
+2478
+5240
+4782
+6979
+4205
+5604
+
+15226
+5377
+14173
+
+20230
+2467
+12544
+
+1565
+12373
+2270
+16050
+15570
+
+9085
+5182
+16013
+13189
+3946
+
+6852
+4248
+4724
+7276
+1360
+5716
+2826
+7027
+6205
+2153
+
+22304
+32417
+
+28537
+16489
+
+4889
+8276
+4878
+2153
+9966
+7707
+10475
+
+6356
+1641
+4013
+4755
+2573
+1704
+1436
+5073
+4920
+4323
+1353
+4567
+4018
+4757
+
+24959
+1738
+
+8673
+3302
+2644
+7916
+6622
+10673
+7825
+5033
+
+5835
+4641
+2055
+4814
+2258
+1695
+4339
+2847
+3084
+1620
+1941
+5144
+3031
+4725
+2309
+
+7389
+8219
+9570
+9070
+1506
+9126
+6811
+8924
+2168
+
+1968
+2794
+5599
+11745
+6149
+3746
+10430
+
+6440
+5129
+6185
+1291
+1650
+5781
+5906
+3201
+3049
+1684
+5928
+6102
+1758
+2329
+
+3588
+4967
+1614
+7833
+1263
+5707
+2526
+2364
+6887
+5189
+1203
+
+6657
+5609
+2026
+5145
+3759
+1017
+5642
+6401
+5591
+6603
+4481
+6902
+
+3703
+1725
+3851
+6400
+1067
+3622
+1821
+1289
+6275
+1084
+5109
+1314
+2573
+
+7104
+13947
+13792
+9580
+16207
+
+4795
+3946
+3075
+3779
+5102
+5714
+2238
+5909
+2431
+3974
+4521
+5270
+3472
+1319
+5307
+
+9952
+10526
+9228
+17256
+
+1837
+5464
+4679
+7161
+8893
+4385
+5192
+2162
+
+4120
+7616
+7283
+10772
+12730
+6392
+
+4780
+3754
+8783
+4194
+1729
+8145
+8079
+
+6010
+7518
+6221
+2524
+3776
+7509
+7098
+7522
+
+5810
+3448
+2004
+1616
+1821
+5927
+4822
+6329
+2716
+4658
+4423
+6118
+2433
+1364
+
+1440
+1094
+4965
+2289
+2563
+1115
+7574
+6930
+6250
+7034
+7915
+
+6075
+3715
+1676
+3678
+1030
+4644
+5550
+1170
+2853
+3052
+1040
+5022
+1541
+3187
+4911
+
+12659
+10109
+18086
+
+6201
+11140
+11094
+5642
+7756
+
+3949
+4571
+5785
+5968
+2506
+4511
+5234
+6501
+5448
+4961
+2762
+3742
+6426
+3822
+
+7970
+1361
+2038
+8295
+7310
+8541
+8093
+1724
+5640
+
+6042
+5047
+1906
+5636
+1076
+3523
+6230
+1049
+6407
+2524
+1047
+1471
+3374
+4612
+
+7308
+5663
+2499
+4348
+8580
+3296
+8992
+8613
+2071
+
+6055
+10279
+5059
+6980
+10867
+
+4886
+1661
+6238
+5781
+1222
+4091
+2410
+5676
+5677
+1374
+5208
+2638
+4717
+1584
+
+5127
+5007
+10028
+1620
+11974
+1963
+
+6551
+4404
+5982
+7039
+7017
+6286
+5231
+
+36789
+2797
+
+3576
+5030
+6295
+1377
+2157
+1606
+1821
+5538
+2271
+6283
+5131
+2169
+6342
+2364
+
+2349
+3443
+5264
+4607
+5359
+3427
+5595
+3084
+5565
+3409
+3675
+3752
+4383
+1063
+
+5622
+10249
+4024
+6582
+8460
+7761
+
+8024
+16841
+17993
+18910
+
+4005
+3384
+4289
+4866
+8871
+2293
+4932
+6681
+
+4784
+7294
+7676
+1396
+1857
+8221
+4464
+6363
+5377
+1588
+
+4215
+4075
+1379
+4563
+5627
+1960
+2731
+3046
+3953
+2045
+3577
+3025
+4314
+5172
+5896
+
+8140
+3738
+6537
+5232
+8117
+2921
+5722
+1715
+1945
+8107
+
+11759
+15723
+3360
+9712
+13897
+
+3236
+3514
+9710
+10712
+6487
+7852
+3763
+
+9252
+11411
+4553
+2499
+9414
+10970
+8354
+
+9398
+12688
+12433
+7194
+6835
+13527
+
+1099
+2334
+4203
+2624
+4599
+2307
+1456
+2135
+4842
+6027
+5298
+6905
+6134
+
+3319
+5521
+5381
+10721
+5050
+9944
+5384
+7080
+
+5400
+5555
+13400
+2211
+9843
+10099
+
+5367
+23155
+18430
+
+8666
+3397
+10486
+13230
+11386
+13134
+
+5105
+1783
+5480
+6921
+6112
+5068
+4773
+2957
+2779
+6629
+1277
+3325
+5836
+
+62145
+
+8246
+8032
+4490
+2196
+1142
+7528
+7670
+2271
+7153
+8702
+
+1356
+6243
+4405
+4515
+6856
+6739
+3271
+6770
+4164
+4516
+3868
+
+17160
+9103
+
+2672
+3800
+3484
+3552
+3491
+7431
+6362
+6084
+1452
+8223
+
+8188
+5812
+2036
+2896
+5213
+12098
+8186
+
+40717
+
+32479
+28358
+
+1574
+3390
+1499
+3279
+3878
+6813
+5090
+1235
+6311
+1055
+5703
+
+4867
+2281
+2632
+2844
+4119
+4708
+4266
+2136
+2026
+1390
+3376
+3493
+1495
+1798
+3321
+
+6817
+8645
+2311
+
+5440
+6063
+2244
+5956
+7438
+2252
+5061
+4014
+3011
+5518
+
+9559
+1151
+8467
+6584
+10513
+7012
+3593
+3421
+
+1417
+9431
+2766
+9011
+9298
+8704
+9206
+9161
+4989
+
+2586
+1421
+6905
+5206
+3434
+3850
+5340
+2081
+2483
+4906
+5865
+3402
+2597
+
+2560
+8719
+
+6844
+2546
+8047
+1144
+7285
+
+9474
+7764
+4911
+8807
+4244
+3628
+2597
+6534
+
+6050
+3814
+3645
+4917
+2244
+5984
+1232
+5582
+5416
+3612
+3358
+1501
+5290
+1240
+
+5100
+1082
+6394
+1531
+7993
+5108
+5646
+4662
+2371
+5226
+
+5873
+4526
+3416
+3775
+1456
+2017
+6261
+2917
+6117
+5506
+3811
+4837
+3341
+5760
+
+2391
+3493
+10867
+7731
+10775
+1372
+9684
+
+4389
+10467
+2797
+2955
+11766
+1078
+4495
+
+1221
+
+10424
+11414
+16599
+19000
+
+2159
+2404
+4017
+2718
+6936
+4335
+5149
+2775
+2177
+2214
+6993
+5515
+
+2644
+10362
+10528
+13587
+3785
+11715
+
+10272
+3723
+5662
+6758
+11179
+8059
+1675
+
+3791
+1245
+4851
+4549
+1698
+5938
+4085
+1329
+1852
+5842
+4406
+1568
+5481
+2807
+
+22878
+
+12224
+4585
+8162
+19796
+
+2570
+29030
+
+5653
+3046
+2418
+5644
+3878
+5120
+3934
+2208
+5591
+5464
+1102
+6185
+2234
+2385
+
+6864
+4365
+5999
+1714
+2073
+6201
+3945
+3130
+6089
+2679
+7256
+
+3456
+5080
+1997
+1139
+6231
+2569
+3384
+5302
+3448
+1398
+6117
+4745
+4440
+2973
+
+6693
+7920
+6191
+1127
+5822
+3891
+3939
+6968
+
+6130
+5479
+2866
+1184
+1802
+4915
+1363
+6447
+1901
+1178
+3785
+1887
+
+25999
+20786
+
+1215
+8830
+3380
+1831
+
+22459
+16088
+24267
+
+1604
+5797
+6348
+1578
+1911
+4495
+2154
+7467
+6259
+7031
+3889
+2956
+
+33450
+14099
+
+13230
+19195
+1391
+
+8326
+9090
+1059
+6557
+4213
+1549
+2279
+3201
+4203
+
+19461
+13641
+3609
+
+2412
+5441
+12299
+1260
+5819
+3362
+
+11326
+13636
+10003
+10906
+6756
+13011
+
+15338
+32973
+
+1925
+15561
+
+3287
+1988
+5467
+5981
+2509
+5615
+1925
+5927
+1970
+1453
+4419
+4233
+4522
+4961
+1533
+
+2842
+3653
+3492
+1106
+1573
+1144
+1383
+6176
+2142
+3715
+2129
+1275
+3254
+2914
+
+5657
+1040
+6379
+2720
+4309
+4787
+6134
+5200
+5039
+
+27275
+12337
+
+4683
+8728
+8249
+2807
+7096
+11415
+10432
+
+2183
+2157
+1383
+7467
+1251
+1071
+7200
+2322
+8264
+8809
+
+1612
+4864
+1553
+4328
+5673
+3325
+2560
+4730
+2134
+3307
+5206
+3611
+2470
+4916
+3817
+
+10458
+5891
+12635
+2676
+3199
+
+4893
+4426
+2443
+7064
+6339
+7440
+5657
+7584
+7713
+1757
+5576
+
+23065
+5406
+
+4018
+5465
+2565
+4918
+2861
+6617
+6855
+5835
+7019
+5024
+
+6349
+4794
+2531
+3962
+5797
+2954
+1175
+4912
+1138
+2500
+
+5795
+1873
+7665
+11708
+8282
+1317
+3518
+
+2084
+5826
+2528
+
+2580
+1696
+1720
+2555
+4219
+5693
+2722
+4271
+3976
+1649
+1000
+3936
+6497
+2801
+
+12078
+2607
+7834
+7071
+7251
+10879
+2715
+
+18191
+19845
+7373
+
+11080
+4787
+15842
+11315
+2820
+
+5363
+3221
+1252
+2198
+2992
+2205
+4990
+4172
+3312
+5329
+4137
+2218
+5861
+3941
+1047
+
+1973
+5138
+10258
+10571
+9489
+12702
+
+4369
+
+10113
+5034
+3486
+7811
+10724
+2880
+
+5179
+3391
+2619
+1980
+4168
+1004
+4793
+5396
+4552
+5326
+3703
+4533
+1320
+4886
+5532
+
+23536
+6777
+15681
+
+4468
+1624
+1866
+3288
+1129
+2160
+4292
+1647
+1882
+1642
+4285
+2392
+3809
+4317
+4603
+
+8278
+13701
+8024
+11073
+9770
+11597
+
+5316
+3300
+2099
+1087
+4591
+3626
+4816
+1437
+2453
+5366
+3112
+2298
+6121
+4731
+
+2182
+5281
+2259
+2612
+1661
+1186
+1371
+6800
+5916
+2101
+5618
+
+6829
+5493
+4935
+4923
+1710
+7177
+3932
+2359
+3212
+6894
+6756
+5531
+
+9696
+6642
+7840
+3663
+10330
+6957
+1519
+6000
+
+4517
+3091
+5382
+1174
+3476
+2672
+4521
+2475
+1786
+2173
+3622
+5685
+2693
+3527
+
+10376
+6480
+4733
+5678
+6061
+6169
+7793
+5740
+
+1180
+5296
+6563
+7084
+4973
+5087
+3330
+7047
+2966
+4173
+2615
+5366
+
+2526
+6306
+2807
+5592
+1610
+5991
+7204
+5569
+3035
+2650
+6947
+
+4376
+4976
+4752
+1269
+8263
+2330
+3414
+3691
+7627
+3859
+
+4388
+16254
+12374
+13123
+15091
+
+4338
+2176
+6985
+4473
+4835
+6646
+3145
+7027
+5629
+1516
+5660
+
+15649
+1182
+4536
+4442
+15325
+
+1334
+8868
+1572
+7510
+6878
+1220
+6137
+7781
+
+1201
+1890
+1051
+4182
+2799
+5202
+3840
+3511
+1979
+2630
+6427
+1364
+1399
+
+1518
+10688
+4953
+7809
+1292
+4543
+6153
+
+2286
+5112
+14533
+3444
+
+8753
+7377
+8643
+6460
+5382
+4893
+1717
+6263
+
+11863
+1603
+6248
+4417
+5372
+10396
+8807
+
+5073
+5512
+2207
+3288
+1416
+7198
+4525
+3748
+5512
+7235
+
+3286
+10301
+8298
+6830
+9475
+3380
+11363
+
+35799
+15238
+
+2708
+13557
+15195
+8939
+12628
+
+5943
+5669
+1838
+4310
+3600
+1814
+3114
+5476
+2351
+1973
+3919
+
+2462
+1532
+5636
+5243
+3725
+2435
+5952
+3712
+5398
+3952
+4445
+2893
+1377
+3983
+
+4295
+3767
+9017
+7261
+7906
+9389
+9605
+3200
+5957
+
+3784
+4221
+1978
+6656
+3341
+2611
+6742
+2296
+3957
+1172
+5944
+3486
+5075
+
+22628
+
+7346
+10423
+6187
+10108
+2106
+5901
+5732
+1585
+
+5979
+2932
+11415
+5397
+10780
+
+24242
+2000
+2451
+
+5787
+4337
+6667
+3583
+4111
+3424
+6819
+5703
+4176
+5594
+2472
+3643
+2560
+
+10202
+12212
+12062
+11153
+15436
+
+16069
+8249
+
+1411
+
+6715
+1302
+2659
+5937
+5683
+6510
+6902
+5849
+4733
+3441
+3847
+2436
+5236
+
+6962
+7522
+2671
+2422
+4819
+1980
+3126
+7504
+7487
+
+6619
+2209
+4743
+1780
+2288
+3902
+4843
+2998
+1976
+3418
+1782
+1821
+2860
+
+8829
+15976
+8691
+15288
+
+46799
+
+6632
+4906
+2309
+3268
+4968
+1090
+2523
+4544
+1760
+5542
+5565
+6497
+6228
+
+8442
+12564
+7744
+16107
+10434
+
+5768
+
+9143
+1249
+1128
+9728
+8627
+10337
+5618
+3066
+
+7334
+4853
+2353
+4775
+2237
+3417
+5798
+4514
+4893
+5636
+7363
+4053
+
+1185
+6066
+6469
+8078
+3049
+5278
+1796
+7499
+3071
+8560
+
+16462
+11884
+3673
+10859
+
+10951
+18038
+5000
+
+5226
+
+5261
+5674
+3913
+1715
+3487
+2901
+1931
+5682
+3196
+4314
+3175
+1516
+3190
+
+9971
+11507
+1435
+9484
+11861
+10796
+5113
+
+4475
+2816
+1628
+5668
+5484
+2032
+5435
+4193
+3360
+3606
+3932
+2515
+
+8110
+9169
+7775
+3841
+11246
+5373
+
+8292
+1957
+2909
+1384
+8465
+3686
+6466
+5253
+8423
+
+9917
+4675
+4884
+7734
+8049
+7826
+7404
+
+1291
+3477
+2517
+6005
+5457
+2947
+3988
+4572
+2402
+3248
+5670
+3028
+4699
+3660
+
+36640
+
+4420
+5870
+3348
+6256
+2892
+4759
+3320
+3502
+5527
+3821
+6400
+2146
+4800
+1807
+
+10430
+
+2664
+1164
+5483
+
+1907
+10200
+10563
+12099
+
+2436
+11324
+8396
+2833
+13746
+
+61720
+
+10434
+2186
+5387
+10079
+1072
+11201
+12135
+
+9947
+14808
+14654
+17740
+
+28218
+30364
+
+17790
+1647
+2724
+13273
+
+21940
+21889
+20925
+
+3649
+5425
+4246
+2322
+3973
+8108
+6391
+5724
+1516
+1222
+
+7432
+3492
+2095
+
+5040
+1575
+6545
+2452
+4003
+4944
+7378
+4745
+6912
+4888
+4972
+3147
+
+18244
+4913
+9445
+12907
+
+2396
+5994
+2349
+4101
+1920
+7917
+8046
+6748
+4541
+2555
+6054
+
+64980
+
+13811
+4804
+4934
+12824
+12024
+1466
+
+10372
+14277
+1589
+16902
+
+10705
+10523
+11631
+7159
+12217
+5210
+
+7189
+16999
+
+2253
+1832
+8068
+2319
+8340
+5105
+5870
+1494
+7508
+6093
+
+13786
+8497
+6268
+11332
+12604
+
+4572
+9079
+6497
+5766
+9236
+7866
+8627
+1278
+
+5058
+1999
+7241
+6439
+6011
+4097
+1668
+5706
+2512
+6882
+3285
+2690
+
+7235
+2818
+13596
+12878
+16045
+
+9372
+9155
+6245
+2982
+3810
+1627
+
+18697
+24240
+9987
+
+6936
+18970
+5902
+18001
+
+9872
+3687
+1187
+8123
+8239
+9367
+6502
+1771
+
+2706
+14218
+5731
+3336
+6289
+
+5627
+11090
+1954
+3884
+7921
+8290
+3077
+
+10823
+10385
+4861
+
+18704
+12416
+
+4869
+3451
+3658
+1897
+3092
+1468
+3819
+4988
+3998
+2366
+2085
+4465
+6134
+
+3177
+7019
+8620
+4896
+8690
+5947
+5300
+1832
+7479
+4225
+
+11793
+9650
+2009
+10058
+9922
+11055
+
+61323
+
+1137
+2693
+7735
+11841
+1338
+3178
+9189
+
+9118
+2339
+9641
+5800
+1418
+6686
+1433
+6217
+5628
+
+1336
+10700
+10424
+4615
+3512
+1395
+9848
+
+5749
+4587
+3734
+3796
+5574
+4618
+4605
+6472
+3965
+6124
+3062
+2417
+6204
+3914
+
+1566
+6799
+11579
+9977
+7353
+9896
+6190
+
+8621
+2371
+1120
+1909
+3611
+3514
+3180
+3396
+7935
+4211
+
+2917
+6377
+2408
+6314
+6219
+2772
+1205
+1000
+4888
+2405
+2820
+2935
+
+5641
+4029
+1975
+3898
+6373
+1140
+6444
+4064
+1775
+4462
+3764
+2123
+6270
+
+28218
+
+4135
+14231
+9564
+
+8011
+15491
+
+5528
+4159
+8792
+1013
+8208
+3201
+3917
+4243
+2987
+6938
+
+4686
+1240
+5446
+1973
+2207
+1604
+1380
+1119
+4001
+3644
+5968
+4649
+2350
+5176
+3970
+
+12804
+13895
+2194
+10441
+7650
+13359
+
+16373
+
+7155
+3671
+1629
+4047
+1362
+5191
+5919
+1134
+6122
+2714
+6338
+
+14279
+13691
+18617
+
+4570
+3489
+3309
+1223
+1543
+4960
+3466
+3337
+2465
+1537
+3680
+5228
+2804
+3593
+4262
+
+4357
+2592
+11080
+14532
+
+30842
+
+4752
+5012
+2632
+3305
+1643
+2724
+2962
+2058
+1039
+5285
+6713
+7099
+
+4029
+8332
+5278
+6480
+2950
+1563
+1845
+8509
+1942
+6881
+
+9396
+9819
+2411
+8418
+7589
+1079
+1232
+2162
+
+3159
+3930
+7006
+9213
+10533
+
+3087
+2284
+2764
+4528
+5756
+5046
+3464
+1212
+5935
+4148
+5859
+2299
+3775
+5882
+
+4608
+1521
+8088
+4088
+1468
+11259
+
+48341
+
+5755
+3069
+5400
+2174
+3459
+1599
+4906
+6295
+4147
+6246
+2016
+1417
+6620
+
+8631
+2864
+4753
+6134
+3961
+10067
+3416
+
+22782
+15739
+24986
+
+3904
+1582
+2573
+3368
+5040
+5555
+5838
+5682
+3808
+5131
+6194
+5653
+3111
+3642
+
+1853
+2831
+5673
+5976
+2137
+1327
+5221
+5053
+5019
+1057
+3622
+4303
+6045
+5873
+4279
+
+6006
+12073
+9647
+6570
+2970
+5403
+5256
+
+5805
+2216
+4699
+2108
+8942
+6865
+1691
\ No newline at end of file
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..c9a6855
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,26 @@
+{
+  "nodes": {
+    "nixpkgs": {
+      "locked": {
+        "lastModified": 1669834992,
+        "narHash": "sha256-YnhZGHgb4C3Q7DSGisO/stc50jFb9F/MzHeKS4giotg=",
+        "owner": "NixOS",
+        "repo": "nixpkgs",
+        "rev": "596a8e828c5dfa504f91918d0fa4152db3ab5502",
+        "type": "github"
+      },
+      "original": {
+        "id": "nixpkgs",
+        "ref": "nixos-22.11",
+        "type": "indirect"
+      }
+    },
+    "root": {
+      "inputs": {
+        "nixpkgs": "nixpkgs"
+      }
+    }
+  },
+  "root": "root",
+  "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..c37f8a6
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,12 @@
+{
+  inputs.nixpkgs.url = "nixpkgs/nixos-22.11";
+
+  outputs = { self, nixpkgs }: let
+    system = "x86_64-linux";
+    pkgs = nixpkgs.legacyPackages.${system};
+  in {
+    packages.${system} = {
+      day01 = pkgs.callPackage ./day01 {};
+    };
+  };
+}
\ No newline at end of file