Add nix stuff

This commit is contained in:
eriedaberrie 2023-12-06 23:31:00 -08:00
parent c3c5068e62
commit 36dba1e373
5 changed files with 82 additions and 1 deletions

2
.clangd Normal file
View file

@ -0,0 +1,2 @@
CompileFlags:
Add: [-std=c++20, -Wall]

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

4
.gitignore vendored
View file

@ -4,3 +4,7 @@
*data*.txt *data*.txt
main main
main-[0-9] main-[0-9]
# Nix stuff
result*
/.direnv/

26
flake.lock Normal file
View file

@ -0,0 +1,26 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1701718080,
"narHash": "sha256-6ovz0pG76dE0P170pmmZex1wWcQoeiomUZGggfH9XPs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2c7f3c0fb7c08a0814627611d9d7d45ab6d75335",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

48
flake.nix Normal file
View file

@ -0,0 +1,48 @@
{
description = "It's Adventing Time";
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
outputs = {
self,
nixpkgs,
}: let
inherit (nixpkgs) lib;
genSystems = lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
];
pkgsFor = system: import nixpkgs {inherit system;};
in {
devShells = genSystems (
system: let
pkgs = pkgsFor system;
in {
default = pkgs.mkShell {
nativeBuildInputs = [
pkgs.clang-tools
(pkgs.sbcl.withPackages (p:
with p; [
alexandria
cl-ppcre
iterate
split-sequence
str
]))
(pkgs.ghc.withPackages (p:
with p; [
containers
regex-compat
split
unordered-containers
vector
]))
];
CXXFLAGS = "-std=c++20 -Wall";
};
}
);
formatter = genSystems (system: (pkgsFor system).alejandra);
};
}