mirror of
https://git.nerfingen.de/nerf/choirMail.git
synced 2025-05-15 17:50:31 +00:00
first working commit
This commit is contained in:
parent
2e2bbcd0d6
commit
0447d72e71
13 changed files with 465 additions and 0 deletions
82
flake.nix
Normal file
82
flake.nix
Normal file
|
@ -0,0 +1,82 @@
|
|||
{
|
||||
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}"
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue