commit fcadfc6cfc37f420bf56443865be12e8f4800bf8 Author: Lyla Bravo Date: Sun Oct 18 10:16:40 2020 -0300 initial commit diff --git a/.config/nixpkgs/config.nix b/.config/nixpkgs/config.nix new file mode 100644 index 0000000..69baf10 --- /dev/null +++ b/.config/nixpkgs/config.nix @@ -0,0 +1 @@ +{ allowUnfree = true; } diff --git a/.config/nixpkgs/home.nix b/.config/nixpkgs/home.nix new file mode 100644 index 0000000..74d4276 --- /dev/null +++ b/.config/nixpkgs/home.nix @@ -0,0 +1,153 @@ +{ config, pkgs, ... }: +with builtins; +with import {}; + +let + kakoune-smarttab = stdenv.mkDerivation { + name = "kakoune-smarttab"; + src = fetchFromGitHub { + owner = "andreyorst"; + repo = "smarttab.kak"; + rev = "e7fe8efd0b91ab8dc1c99c131f138de9b38fd965"; + sha256 = "0x93mmxv9qi7vxsyqdhg4x5bvsl8sss9m2mq2qks6ghr5h9pmigk"; + }; + installPhase = '' + mkdir -p $out/share/kak/autoload/plugins + cp -r rc $out/share/kak/autoload/plugins/smarttab + ''; + }; + kakoune-joule = stdenv.mkDerivation { + name = "kakoune-joule"; + src = fetchFromGitHub { + owner = "katesuyu"; + repo = "joule.kak"; + rev = "17fb4a08c525b6a7e7899c29efafd55a94908cd4"; + sha256 = "1jpl9x7a07f7igwd60dn2y3sxakpnlh07cja06l9fsnfpb02jis3"; + }; + installPhase = '' + mkdir -p $out/share/kak/autoload + cp colors/joule.kak $out/share/kak/autoload + ''; + }; + zig-master = stdenv.mkDerivation { + name = "zig-master"; + src = fetchurl { + url = https://ziglang.org/builds/zig-linux-x86_64-0.6.0+0e4c3934a.tar.xz; + sha256 = "f51d45e0780af942f9128fa915ab96ec8afc7b11dde8b24c8c40ff46a12b8228"; + }; + installPhase = '' + mkdir -p $out/bin + cp -r . $out + mv $out/zig $out/bin/zig + ''; + }; +in { + home = { + username = "lyla"; + homeDirectory = "/home/lyla"; + stateVersion = "20.09"; + packages = with pkgs; [ + kak-lsp rnix-lsp + zig-master + ]; + }; + + programs = { + home-manager.enable = true; + fish.enable = true; + fzf.enable = true; + jq.enable = true; + git = { + enable = true; + package = pkgs.gitAndTools.gitFull; + userName = "Lyla Bravo"; + userEmail = "arqv@protonmail.com"; + delta.enable = true; + }; + kakoune = let + lspFiletypes = [ "zig" "c" "cpp" "rust" "nix" ]; + tabSettings = [ + { filetype = [ "zig" "rust" "nix" ]; tab = "expandtab"; } + { filetype = [ "c" "cpp" ]; tab = "smarttab"; } + ]; + in { + enable = true; + plugins = [ kakoune-joule kakoune-smarttab ]; + config = { + tabStop = 4; + numberLines = { + enable = true; + highlightCursor = true; + }; + wrapLines = { + enable = true; + indent = true; + word = true; + }; + ui = { + enableMouse = true; + assistant = "none"; + setTitle = true; + }; + 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' + ''; + } + ] ++ lib.lists.forEach + tabSettings + (v: { + name = "WinSetOption"; + commands = "${v.tab}"; + option = + if isList v.filetype then + let + flist = builtins.concatStringsSep "|" v.filetype; + in + "filetype=(${flist})" + else + "filetype=${v.filetype}"; + }); + }; + extraConfig = let ftypes = builtins.concatStringsSep "|" lspFiletypes; in '' + # kak-lsp initialization + eval %sh{kak-lsp --kakoune -s $kak_session} + hook global WinSetOption filetype=(${ftypes}) %{ + map buffer normal p ': enter-user-mode lsp' + lsp-enable-window + } + ''; + }; + }; + + xdg = { + dataFile = { + # not done here: compile ZLS and copy the binaries to ~/.local/share/zls + "zls/zls.json".text = '' + { + "zig_lib_path": "${zig-master}/lib/zig/", + "zig_exe_path": "${zig-master}/bin/zig", + "warn_style": true, + "enable_semantic_tokens": true, + "operator_completions": true + } + ''; + }; + 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"; + }; + }; +}