migrated all languages to devshell
This commit is contained in:
@@ -4,23 +4,45 @@
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
packages = builtins.attrValues {
|
||||
inherit (pkgs)
|
||||
haskell-language-server # LSP server for Haskell
|
||||
cabal-install # Standard Haskell build tool
|
||||
hlint # Linter for Haskell source code
|
||||
;
|
||||
inherit (pkgs.haskellPackages)
|
||||
hoogle # Haskell API search engine
|
||||
;
|
||||
};
|
||||
in
|
||||
{
|
||||
options.my.dev.haskell.enable = lib.mkEnableOption "enable";
|
||||
config = lib.mkIf config.my.dev.haskell.enable {
|
||||
users.users.jawz.packages = builtins.attrValues {
|
||||
inherit (pkgs)
|
||||
haskell-language-server # LSP server for Haskell
|
||||
cabal-install # Standard Haskell build tool
|
||||
hlint # Linter for Haskell source code
|
||||
;
|
||||
inherit (pkgs.haskellPackages)
|
||||
hoogle # Haskell API search engine
|
||||
;
|
||||
};
|
||||
environment.variables = {
|
||||
CABAL_DIR = "\${XDG_CACHE_HOME}/cabal";
|
||||
STACK_ROOT = "\${XDG_DATA_HOME}/stack";
|
||||
GHCUP_USE_XDG_DIRS = "true";
|
||||
options = {
|
||||
my.dev.haskell.enable = lib.mkEnableOption "Install Haskell tooling globally";
|
||||
devShells.haskell = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.mkShell {
|
||||
inherit packages;
|
||||
name = "haskell-dev-shell";
|
||||
shellHook = ''
|
||||
echo "λ Haskell dev environment"
|
||||
'';
|
||||
};
|
||||
description = "Haskell development shell";
|
||||
};
|
||||
};
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf config.my.dev.haskell.enable {
|
||||
users.users.jawz = {
|
||||
inherit packages;
|
||||
};
|
||||
})
|
||||
{
|
||||
environment.variables = {
|
||||
CABAL_DIR = "\${XDG_CACHE_HOME}/cabal";
|
||||
STACK_ROOT = "\${XDG_DATA_HOME}/stack";
|
||||
GHCUP_USE_XDG_DIRS = "true";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user