aoc/2022/d6/flake.nix

68 lines
2.1 KiB
Nix
Raw Permalink Normal View History

2022-12-06 04:57:59 +00:00
{
description = "D4 AOC with Lua!";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
2022-12-21 00:07:33 +00:00
clj-nix = {
url = "github:jlesquembre/clj-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
2022-12-06 04:57:59 +00:00
};
2022-12-21 00:07:33 +00:00
outputs = { nixpkgs, flake-utils, clj-nix, ... } @ inputs:
2022-12-06 04:57:59 +00:00
flake-utils.lib.eachSystem flake-utils.lib.defaultSystems (sys:
let
overlays = [ ];
pkgs = import nixpkgs { system = sys; overlays = overlays; };
shellHookAfter = ''
echo "The input files should be placed under ./data/{submission,example}.txt"
echo "This problem shares one input between two parts"
'';
2022-12-21 00:07:33 +00:00
clj_pkgs = import clj-nix { system = sys; };
2022-12-06 04:57:59 +00:00
py_pkgs = [ pkgs.python310 ];
2022-12-21 00:07:33 +00:00
clojure_pkgs = [ ];
2022-12-06 04:57:59 +00:00
in
{
# Jack of all trades
2022-12-21 00:07:33 +00:00
devShell = pkgs.mkShell
{
nativeBuildInputs = py_pkgs ++ fennel_pkgs;
shellHook = ''
echo "> Default runtime. This contains both fennel and python3 env"
echo "Run ./run-py.sh for Python's output and ./run-fnl.sh for Fennel's output"
'' + shellHookAfter;
};
2022-12-06 04:57:59 +00:00
devShells = {
# nix develop ./#lua
# lua = pkgs.mkShell {
# nativeBuildInputs = lua_pkgs;
# shellHook = ''
# echo "> Lua runtime"
# echo "Run ./run-lua.sh to see the output of the solution"
# '' + shellHookAfter;
# };
# nix develop ./#fennel
fennel = pkgs.mkShell
{
nativeBuildInputs = fennel_pkgs;
shellHook = ''
echo "> Fennel runtime"
echo "Run ./run-fnl.sh to see output of Fennel solution"
'' + shellHookAfter;
};
# nix develop ./#python
python = pkgs.mkShell {
nativeBuildInputs = py_pkgs;
shellHook = ''
echo "> Python3 runtime"
echo "Run ./run-py.sh to see the output of the solution"
'' + shellHookAfter;
};
};
}
);
}