From 279b8d54f603519fc55879bec5104465af7abdb4 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Sun, 5 Jun 2022 15:46:48 +0200 Subject: [PATCH] lets try helix --- profiles/base/default.nix | 44 +++++++++++++++++++++++++++++++++-- profiles/xsession/default.nix | 1 + profiles/zsh/default.nix | 2 ++ 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/profiles/base/default.nix b/profiles/base/default.nix index a4e3c17..e4f7f52 100644 --- a/profiles/base/default.nix +++ b/profiles/base/default.nix @@ -2,6 +2,22 @@ let cfg = config.profiles.base; + + helixDesktop = pkgs.makeDesktopItem { + name = "Helix"; + type = "Application"; + desktopName = "Helix"; + genericName = "Text Editor"; + comment = "Edit text files"; + tryExec = "hx"; + exec = "kitty hx %F"; + terminal = false; # Until you can globally set a prefered terminal we hardcoding this + mimeTypes = [ "ext/english" "text/plain" "text/x-makefile" "text/x-c++hdr" "text/x-c++src" "text/x-chdr" "text/x-csrc" "text/x-java" "text/x-moc" "text/x-pascal" "text/x-tcl" "text/x-tex" "application/x-shellscript" "text/x-c" "text/x-c++" ]; + categories = [ "Utility" "TextEditor" ]; + keywords = [ "Text" "editor" ]; + startupNotify = false; + }; + in { options.machine = { @@ -23,13 +39,15 @@ in { }; config = lib.mkIf cfg.enable { - home.packages = with pkgs; [ nix-output-monitor nix-top nix-index unstable.comma + rnix-lsp + helixDesktop + ldns mtr @@ -117,6 +135,24 @@ in { programs.obs-studio.enable = (config.profiles.gui.enable && cfg.plus); + programs.helix = { + enable = true; + package = pkgs.unstable.helix; + settings = { + editor.line-number = "relative"; + editor.mouse = false; + keys.normal = { + # Empty keys: Ø, æ, Æ, å, Å, *, + "ø" = "collapse_selection"; # For ; + "minus" = "search"; # For / + "_" = "rsearch"; # for = + "plus" = "trim_selections"; # for _ + "å"."d" = "goto_prev_diag"; # for [d + "¨"."d" = "goto_next_diag"; + }; + }; + }; + programs.git = { enable = true; userEmail = "daniel.olsen99@gmail.com"; @@ -173,12 +209,16 @@ in { enableSshSupport = true; }; + home.sessionVariables = { + EDITOR = "hx"; + }; + xdg.mimeApps = { enable = true; defaultApplications = { "image/png" = [ "sxiv.desktop" "gimp.desktop" ]; "image/jpeg" = [ "sxiv.desktop" ]; - "text/plain" = [ "gedit.desktop" "kakoune.desktop" "code.desktop" ]; + "text/plain" = [ "Helix.desktop" "gedit.desktop" "code.desktop" ]; "video/x-matroska" = [ "mpv.desktop" ]; }; associations.removed = { diff --git a/profiles/xsession/default.nix b/profiles/xsession/default.nix index e61cdf0..ead8eff 100644 --- a/profiles/xsession/default.nix +++ b/profiles/xsession/default.nix @@ -18,6 +18,7 @@ in home.keyboard = { layout = "no"; + variant = "nodeadkeys"; }; services.random-background = { diff --git a/profiles/zsh/default.nix b/profiles/zsh/default.nix index 6a13bf0..91d2a45 100644 --- a/profiles/zsh/default.nix +++ b/profiles/zsh/default.nix @@ -37,6 +37,8 @@ in gne = "git n"; gds = "git diff --staged"; glg = "git log --oneline"; + + nano = "hx"; # Behavioral training }; initExtra = '' source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme