83 lines
3.1 KiB
Nix
83 lines
3.1 KiB
Nix
|
{
|
||
|
description = "choir Mail automatisation";
|
||
|
|
||
|
inputs = {
|
||
|
nixpkgs.url = github:NixOS/nixpkgs/nixpkgs-unstable;
|
||
|
flake-utils.url = github:numtide/flake-utils;
|
||
|
};
|
||
|
|
||
|
outputs = {self, nixpkgs, flake-utils} :
|
||
|
let
|
||
|
# name to be used as identifier for editor environments and such
|
||
|
name = "Application";
|
||
|
compiler = "ghc902";
|
||
|
|
||
|
in
|
||
|
flake-utils.lib.eachDefaultSystem ( system:
|
||
|
let
|
||
|
pkgs = import nixpkgs {inherit system;};
|
||
|
hpkgs = pkgs.haskell.packages.${compiler};
|
||
|
in {
|
||
|
packages = { default = (import ./default.nix) {inherit pkgs compiler;};};
|
||
|
|
||
|
|
||
|
devShells =
|
||
|
rec {
|
||
|
# This sets the default devShell
|
||
|
default = kakoune;
|
||
|
kakoune =
|
||
|
let
|
||
|
haskell-language-server = hpkgs.haskell-language-server;
|
||
|
myKakoune =
|
||
|
let
|
||
|
# this could also be done by generating toml with the
|
||
|
# nixpkgs lib, but I'm lazy
|
||
|
kak-lsp-config = pkgs.writeTextFile {
|
||
|
name = "kak-lsp-config.toml";
|
||
|
text = ''
|
||
|
[language.haskell]
|
||
|
filetypes = ["haskell"]
|
||
|
roots = ["Setup.hs", "stack.yaml", "*.cabal"]
|
||
|
command = "haskell-language-server-wrapper"
|
||
|
args = ["--lsp"]
|
||
|
'';
|
||
|
};
|
||
|
config = pkgs.writeTextFile (rec {
|
||
|
name = "kakrc.kak";
|
||
|
destination = "/share/kak/autoload/${name}";
|
||
|
text = ''
|
||
|
colorscheme solarized-dark
|
||
|
set global tabstop 2
|
||
|
set global indentwidth 2
|
||
|
# eval %sh{kak-lsp --kakoune --session $kak_session -c ${kak-lsp-config}}
|
||
|
eval %sh{kak-lsp --kakoune --session $kak_session -c ${kak-lsp-config} --log /tmp/kak-lpsLog -vvvv}
|
||
|
hook global WinSetOption filetype=(haskell|nix) %{
|
||
|
lsp-auto-hover-enable
|
||
|
lsp-enable-window
|
||
|
}
|
||
|
add-highlighter global/ number-lines
|
||
|
map global normal <c-p> ': fzf-mode<ret>'
|
||
|
'';
|
||
|
});
|
||
|
in
|
||
|
pkgs.kakoune.override {
|
||
|
plugins = with pkgs.kakounePlugins; [fzf-kak kak-lsp config];
|
||
|
};
|
||
|
in
|
||
|
pkgs.mkShell {
|
||
|
inputsFrom = [self.outputs.packages.${system}.default];
|
||
|
packages = [myKakoune haskell-language-server pkgs.git pkgs.fzf hpkgs.cabal2nix pkgs.cabal-install pkgs.zlib.dev];
|
||
|
# TODO only try to start the kakoune session if no session with that
|
||
|
# name exists
|
||
|
shellHook = ''
|
||
|
alias ..="cd .."
|
||
|
export KAKOUNE_CONFIG_DIR="/dev/null/"
|
||
|
kak -d -s ${name} &
|
||
|
alias vim="kak -c ${name}"
|
||
|
'';
|
||
|
};
|
||
|
};
|
||
|
}
|
||
|
);
|
||
|
}
|