Skip to content

Commit c24333c

Browse files
committed
add simplest possible shell.nix to get ghc-9.10, cabal anc z3
1 parent 954555b commit c24333c

File tree

2 files changed

+36
-20
lines changed

2 files changed

+36
-20
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Test shell.nix
2+
3+
# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency.
4+
concurrency:
5+
group: ${{ github.ref }}-${{ github.workflow }}
6+
cancel-in-progress: true
7+
8+
on:
9+
push:
10+
paths-ignore:
11+
- "**/README.md"
12+
branches:
13+
- main
14+
pull_request:
15+
paths-ignore:
16+
- "**/README.md"
17+
workflow_dispatch:
18+
19+
jobs:
20+
test-nix-shell:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: cachix/install-nix-action@v25
25+
with:
26+
nix_path: nixpkgs=channel:nixos-unstable
27+
- run: nix-shell --run "cabal build --dry-run lh-array-sort benchrunner"

shell.nix

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
1-
let
2-
pkgs = import (builtins.fetchGit {
3-
name = "nixos-git";
4-
url = "https://github.com/nixos/nixpkgs/";
5-
ref = "refs/heads/master";
6-
# Commit hash for nixos-unstable as of 2021-12-01
7-
# # rev = "8b01281b66cba818abea8dbbdb3614b1b38961e3";
8-
rev = "c610be58c0b6484c18728dc3ed60310cdbfbd456";
9-
}) {};
10-
ghc = pkgs.haskell.compiler.ghc8107;
11-
ghc901 = pkgs.haskell.compiler.ghc901;
12-
stdenv = pkgs.overrideCC pkgs.stdenv pkgs.gcc7;
13-
gcc = pkgs.gcc7;
14-
in
15-
with pkgs;
16-
stdenv.mkDerivation {
17-
name = "lh-array-sort";
18-
buildInputs = [ ghc ghc901 cabal-install stack ghcid z3 numactl
19-
stdenv gcc gdb uthash ];
20-
}
1+
{ compiler ? "ghc910", pkgs ? import <nixpkgs> {}, ... }:
2+
pkgs.mkShell {
3+
name = "haskell-shell";
4+
buildInputs = [
5+
pkgs.haskell.compiler.${compiler}
6+
pkgs.haskell.packages.${compiler}.cabal-install
7+
pkgs.z3
8+
];
9+
}

0 commit comments

Comments
 (0)