ghc: Init
This only adds the configuration, not the packages, because they are massive.
This commit is contained in:
parent
d621e84a00
commit
aceeb7c35a
|
@ -3,6 +3,7 @@
|
|||
./alacritty.nix
|
||||
./anki
|
||||
./games.nix
|
||||
./ghci.nix
|
||||
./git.nix
|
||||
./gpg.nix
|
||||
./gtk.nix
|
||||
|
|
32
users/simon/modules/ghci.nix
Normal file
32
users/simon/modules/ghci.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
home.file.".ghc/ghci.conf".text = /* haskell */ ''
|
||||
:seti -XOverloadedStrings
|
||||
|
||||
-- Lambdabot (from https://wiki.haskell.org/GHC/GHCi#Lambdabot_Commands)
|
||||
dotGHCI_escapeShellArg arg = "'" ++ concatMap (\c -> if c == '\''' then "'\\'''" else [c]) arg ++ "'"
|
||||
lb s1 s2 = return $ ":!lambdabot -n -e " ++ dotGHCI_escapeShellArg s1 ++ "\\ " ++ dotGHCI_escapeShellArg s2
|
||||
:def! lb lb "" -- runs arbitrary lambdabot commands
|
||||
:def! pl lb "pl" -- converts code to point-free (aka pointless) form
|
||||
:def! unpl lb "unpl" -- converts back from point-free (aka pointless) form
|
||||
:def! do lb "do" -- converts binds to do notation
|
||||
:def! undo lb "undo" -- converts do blocks to bind notation
|
||||
:def! index lb "index" -- finds the module that defines the given identifier
|
||||
:def! instances lb "instances" -- finds all instances of a given type class
|
||||
:def! src lb "src" -- tries to find the source code for the given identifier
|
||||
:def! oeis lb "oeis" -- looks up the On-Line Encyclopedia of Integer Sequences (https://oeis.org/)
|
||||
'';
|
||||
|
||||
home.file.".haskeline".text = ''
|
||||
completionType: MenuCompletion
|
||||
maxHistorySize: Just 10000
|
||||
historyDuplicates: IgnoreAll
|
||||
'';
|
||||
|
||||
home.packages = with pkgs; [
|
||||
# GHC has a huge closure size, instead use nix-shell (ad-hoc or per-project)
|
||||
#ghc
|
||||
#lambdabot
|
||||
];
|
||||
}
|
Loading…
Reference in a new issue