{ config, pkgs, ... }: let cargo2nix = (import (builtins.fetchGit { url = https://github.com/tenx-tech/cargo2nix; ref = "master"; }) {}).package; in { nixpkgs.config.allowUnfree = true; news.display = "silent"; home = { username = "lyla"; homeDirectory = "/home/lyla"; stateVersion = "20.09"; sessionVariables = { EDITOR = "kak"; }; extraOutputsToInstall = [ "doc" ]; packages = with pkgs; [ # CLI tools neofetch mosh exa fd ripgrep pandoc signify # editor kak-lsp parinfer-rust rnix-lsp # nix tools nixfmt niv cargo2nix cachix # gui zoom-us libreoffice transmission-gtk luakit ]; file = { ".tmux.conf".source = ~/etc/tmux.conf; }; }; programs = { home-manager.enable = true; firefox = { enable = true; }; fish = { enable = true; shellAliases = { "ls" = "exa -FsName --group-directories-first"; "ll" = "exa -FlsName --group-directories-first"; "l" = "exa -FlasName --group-directories-first"; "la" = "exa -FlasName --group-directories-first"; }; }; fzf.enable = true; jq.enable = true; direnv.enable = true; git = { enable = true; package = pkgs.gitAndTools.gitFull; userName = "Lyla Bravo"; userEmail = "arqv@protonmail.com"; delta.enable = true; }; kakoune = let lspFiletypes = [ "zig" "rust" "c" "cpp" "nix" ]; tabSettings = [ { filetype = [ "zig" "rust" "nix" ]; tab = "expandtab"; } { filetype = [ "c" "cpp" ]; tab = "smarttab"; } ]; in { enable = true; plugins = with pkgs.kakounePlugins; [ kak-fzf parinfer-rust kakboard joule smarttab ]; config = { tabStop = 4; numberLines = { enable = true; highlightCursor = true; }; wrapLines = { enable = true; indent = true; word = true; }; ui = { enableMouse = true; assistant = "none"; setTitle = true; }; keyMappings = [{ docstring = "fzf mode"; mode = "user"; effect = ": fzf-mode"; key = "d"; }]; hooks = [ { name = "ModuleLoaded"; option = "smarttab"; commands = '' set-option global softtabstop 4 set-option global smarttab_expandtab_mode_name 'exp' set-option global smarttab_noexpandtab_mode_name 'noexp' set-option global smarttab_smarttab_mode_name 'smart' ''; } { name = "WinCreate"; option = ".*"; commands = "kakboard-enable"; } { name = "WinSetOption"; option = "filetype=(lisp|scheme)"; commands = "parinfer-enable-window -smart"; } ] ++ pkgs.lib.lists.forEach tabSettings (v: { name = "WinSetOption"; commands = "${v.tab}"; option = if builtins.isList v.filetype then "filetype=(${builtins.concatStringsSep "|" v.filetype})" else "filetype=${v.filetype}"; }); }; extraConfig = '' add-highlighter global/ regex \b(TODO|FIXME|XXX|NOTE)\b 0:default+rb eval %sh{kak-lsp --kakoune -s $kak_session} hook global WinSetOption filetype=(${builtins.concatStringsSep "|" lspFiletypes}) %{ map buffer user l ': enter-user-mode lsp' -docstring 'LSP mode' lsp-enable-window } ''; }; }; services = { lorri.enable = true; }; xdg = { configFile = { "kak-lsp/kak-lsp.toml".source = ~/etc/kak-lsp.toml; "luakit/userconf.lua".source = ~/etc/luakit/userconf.lua; }; userDirs = { enable = true; desktop = "$HOME/usr"; documents = "$HOME/usr/doc"; download = "$HOME/usr/dl"; music = "$HOME/usr/mus"; pictures = "$HOME/usr/vis"; videos = "$HOME/usr/vis"; publicShare = "$HOME/.etc"; templates = "$HOME/.etc"; }; }; }