Skip to content

Instantly share code, notes, and snippets.

@niklasdewally
Last active February 22, 2023 09:30
Show Gist options
  • Select an option

  • Save niklasdewally/42c9862ff72fa2f0aa0e8271b2698f3e to your computer and use it in GitHub Desktop.

Select an option

Save niklasdewally/42c9862ff72fa2f0aa0e8271b2698f3e to your computer and use it in GitHub Desktop.
Symlinking ghcup and cabal

This profile script makes ghcup and cabal packages persist across different lab clients, by symlinking the necessary haskell directories.


  1. Put the above script inside your "profile" directory to be run on startup:

    On the school server:

    cd /cs/home/${USER}/.profile.d
    curl "https://gist.githubusercontent.com/niklasdewally/42c9862ff72fa2f0aa0e8271b2698f3e/raw/fb5c64f1a8ba68de181d933a39d0d2a39987f993/hs-links.sh" > hs-links.sh
    chmod +x hs-links.sh
    

    This will now run on startup on any CS machine, setting up the links to local home.

  2. Run this script to setup the symlinks on your current session

    ./hs-links.sh
    
  3. Install ghcup to the default location

    curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
    

    Ensure to select Yes to installing Haskell Language Server

  4. Restart your terminal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment