Skip to content

Commit e6c1027

Browse files
committed
chore: Add flake.nix
1 parent 311d2b8 commit e6c1027

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

flake.nix

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
description = "Development shell for Common Lisp with Qob";
3+
4+
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
5+
6+
outputs = { self, nixpkgs }:
7+
let
8+
# Define the systems you want to support
9+
systems = [
10+
"x86_64-linux"
11+
"i686-linux"
12+
"x86_64-darwin"
13+
"aarch64-linux"
14+
"aarch64-darwin"
15+
];
16+
in
17+
{
18+
# Generate devShells for each system
19+
devShells = nixpkgs.lib.genAttrs systems (system:
20+
let
21+
# Get the nixpkgs set for the current system
22+
pkgs = nixpkgs.legacyPackages.${system};
23+
in
24+
{
25+
# Define the default development shell for the system
26+
default = pkgs.mkShell {
27+
buildInputs = [
28+
pkgs.sbcl
29+
pkgs.gnumake
30+
];
31+
32+
shellHook = ''
33+
echo "Welcome to the Common Lisp development shell with Qob!"
34+
35+
# Export `bin` to PATH.
36+
export PATH="$PATH:$PWD/bin"
37+
38+
# Install if `bin/qob` is missing
39+
if [ ! -e bin/qob ]; then
40+
make install-ql-no-network
41+
make build
42+
fi
43+
'';
44+
};
45+
}
46+
);
47+
};
48+
}

0 commit comments

Comments
 (0)