Skip to content

Commit 5ef4700

Browse files
committed
chore: add devbox nix-flake for customising stack, ghc, and more
1 parent 94ab4ca commit 5ef4700

File tree

2 files changed

+102
-0
lines changed

2 files changed

+102
-0
lines changed

nix/devbox/flake.lock

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

nix/devbox/flake.nix

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
description = "Stack and GHC for Devbox";
3+
4+
inputs = {
5+
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-24.11";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
};
8+
9+
outputs = { self, nixpkgs, flake-utils }:
10+
let
11+
in
12+
flake-utils.lib.eachDefaultSystem (system:
13+
let
14+
pkgs = import nixpkgs {
15+
system = system;
16+
};
17+
18+
stack-wrapped = pkgs.symlinkJoin {
19+
name = "stack";
20+
paths = [ pkgs.stack ];
21+
buildInputs = [ pkgs.makeWrapper ];
22+
postBuild = ''
23+
wrapProgram $out/bin/stack \
24+
--add-flags "\
25+
--no-nix \
26+
--system-ghc \
27+
--no-install-ghc \
28+
"
29+
'';
30+
};
31+
in
32+
{
33+
packages.stack = stack-wrapped;
34+
packages.ghc = pkgs.haskell.compiler.ghc928;
35+
packages.cc = pkgs.stdenv.cc;
36+
packages.hls = pkgs.haskell.packages.ghc928.haskell-language-server;
37+
packages.apple_sdk_CoreServices = pkgs.darwin.apple_sdk.frameworks.CoreServices;
38+
packages.apple_sdk_CoreFoundation = pkgs.darwin.apple_sdk.frameworks.CoreFoundation;
39+
packages.apple_sdk_Cocoa = pkgs.darwin.apple_sdk.frameworks.Cocoa;
40+
});
41+
}

0 commit comments

Comments
 (0)