Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/test-nix-shell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Test shell.nix

# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency.
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

on:
push:
paths-ignore:
- "**/README.md"
branches:
- main
pull_request:
paths-ignore:
- "**/README.md"
workflow_dispatch:

jobs:
test-nix-shell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
with:
nix_path: nixpkgs=channel:nixos-25.05
- run: nix-shell --run "cabal update && cabal build --dry-run lh-array-sort"
29 changes: 9 additions & 20 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
let
pkgs = import (builtins.fetchGit {
name = "nixos-git";
url = "https://github.com/nixos/nixpkgs/";
ref = "refs/heads/master";
# Commit hash for nixos-unstable as of 2021-12-01
# # rev = "8b01281b66cba818abea8dbbdb3614b1b38961e3";
rev = "c610be58c0b6484c18728dc3ed60310cdbfbd456";
}) {};
ghc = pkgs.haskell.compiler.ghc8107;
ghc901 = pkgs.haskell.compiler.ghc901;
stdenv = pkgs.overrideCC pkgs.stdenv pkgs.gcc7;
gcc = pkgs.gcc7;
in
with pkgs;
stdenv.mkDerivation {
name = "lh-array-sort";
buildInputs = [ ghc ghc901 cabal-install stack ghcid z3 numactl
stdenv gcc gdb uthash ];
}
{ compiler ? "ghc910", pkgs ? import <nixpkgs> {}, ... }: # don't pint nixpkgs for now as this is a trivial shell file
pkgs.mkShell {
name = "haskell-shell";
buildInputs = [
pkgs.haskell.compiler.${compiler}
pkgs.haskellPackages.cabal-install # have to use default cabal instead of ${compiler}'s one to hit nix cache
pkgs.z3
];
}