1
Fork 0

feat: haskell stuff

This commit is contained in:
Matei Adriel 2020-04-18 10:04:12 +03:00
parent cd21c88a5c
commit d6f460d390
6 changed files with 49 additions and 4 deletions

View file

@ -1 +1,3 @@
{ ... }: { imports = [ ./nix.nix ./purescript.nix ./javascript.nix ]; } { ... }: {
imports = [ ./nix.nix ./purescript.nix ./javascript.nix ./haskell ];
}

View file

@ -0,0 +1,12 @@
{ pkgs, ... }:
let hie = pkgs.all-hies.selection { selector = p: { inherit (p) ghc865; }; };
in {
home-manager.users.adrielus.home = {
file.".ghci".source = ./ghci;
# file.".stack/config.yaml".source = ./stack.yaml;
packages = with pkgs;
[ ghc ghcid hlint cabal-install snack stack hie ]
++ (with haskellPackages; [ brittany hoogle hpack pointfree pointful ]);
};
}

10
modules/dev/haskell/ghci Normal file
View file

@ -0,0 +1,10 @@
:def paste \_ -> do { paste <- System.Process.readProcess "pbpaste" [] ""; let cmd = if '\n' `elem` paste then ":{\ntype Ö = ()\n" ++ paste ++ "\n:}" else paste in putStrLn ("\SOH\ESC[33m\STX" ++ paste ++ "\SOH\ESC[0m\STX") >> return (":cmd return " ++ show cmd) }
:def paste-quiet \_ -> do { paste <- System.Process.readProcess "pbpaste" [] ""; let cmd = if '\n' `elem` paste then ":{\ntype Ö = ()\n" ++ paste ++ "\n:}" else paste in return (":cmd return " ++ show cmd) }
:def hoogle \str -> return $ ":! hoogle search --color --count=10 " ++ show str
:def hoogle-all \str -> return $ ":! hoogle search --color " ++ show str
:def doc \str -> return $ ":! hoogle search --color --info " ++ show str
:def pointfree \str -> return $ ":! pointfree " ++ show str
:def pf \str -> return $ ":! pointfree " ++ show str
:def pointful \str -> return $ ":! pointful " ++ show str

View file

@ -0,0 +1,5 @@
templates:
params:
author-name: "Matei Adriel"
author-email: "rafaeladriel11@gmail.com"
github-username: "Mateiadrielrafael"

View file

@ -9,13 +9,17 @@ in {
inherit imports; inherit imports;
inherit unstable; inherit unstable;
inherit (import imports.niv { }) niv;
cached-nix-shell = callPackage imports.cached-nix-shell { }; cached-nix-shell = callPackage imports.cached-nix-shell { };
easy-purescript-nix = callPackage imports.easy-purescript-nix { }; easy-purescript-nix = callPackage imports.easy-purescript-nix { };
brave = unstable.brave; all-hies = import imports.all-hies { };
snack = (import imports.snack).snack-exe;
inherit (import imports.niv { }) niv; # unstable stuff
inherit (import imports.all-hies { }) all-hies; brave = unstable.brave;
ghc = unstable.ghc;
}) })
]; ];

View file

@ -106,5 +106,17 @@
"type": "tarball", "type": "tarball",
"url": "https://github.com/nixos/nixpkgs-channels/archive/9b0d2f3fd153167b0c8ce84bb71e766a39ed4c9d.tar.gz", "url": "https://github.com/nixos/nixpkgs-channels/archive/9b0d2f3fd153167b0c8ce84bb71e766a39ed4c9d.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"snack": {
"branch": "master",
"description": "Nix-based incremental build tool for Haskell projects",
"homepage": "",
"owner": "nmattia",
"repo": "snack",
"rev": "b638463b9a7490867b44d0c33bb02e8f7ca82f29",
"sha256": "02h4f0nrjvhsm7hvmrnc4kfi5my48d7yvind0f1kq1lsrcch6iph",
"type": "tarball",
"url": "https://github.com/nmattia/snack/archive/b638463b9a7490867b44d0c33bb02e8f7ca82f29.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
} }
} }