srid / srid/haskell-flake

Detect globally installed GHC and related tools

Open
#183 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

documentation question
Dominant language
Nix
Stars
240
Forks
27
PR merge metrics
No merged PRs in 30d

Description

The following shellHook will warn if the user accidentally ends up using a non-nix-shell haskell tools (such as that of ghcup). Perhaps haskell-flake can provide this as an opt-in module to import (like #160).

        haskellProjects.default = { config, ... }: {
          devShell = {
            mkShellArgs.shellHook = ''
              function samePath {
                [[ "$1" == "$2" ]] || (
                  echo "\n!!! WARNING: Found $1, but expected $2"
                )
              }
              function inNixStore {
                [[ "$1" == $NIX_STORE/* ]] || (
                  echo "\n!!! WARNING: $1 is not in the Nix store"
                )
              }
              inNixStore "$(which ghc)"
              # samePath "$(which ghc)" "${lib.getExe config.outputs.finalPackages.ghc}"
              samePath "$(which cabal)" "${lib.getExe config.outputs.finalPackages.cabal-install}"
              samePath "$(which haskell-language-server)" "${lib.getExe config.outputs.finalPackages.haskell-language-server}"
            '';
          };
        }

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the proposed shellHook and the opt-in module pattern referenced by #160. Inspect how haskell-flake development-shell configuration exposes GHC, cabal-install, and haskell-language-server; done means an opt-in check warns when these tools resolve outside the expected Nix outputs.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell, shell
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.