From 9bf4aab609de79995ed5ab7633ca8b4b8b8c5f38 Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Fri, 20 Jan 2023 20:09:41 +0400 Subject: [PATCH] Some fixes for helix --- profiles/applications-setup.nix | 4 +-- profiles/applications/helix.nix | 35 +++++++++++++++++++++++++-- profiles/workspace/gnome3/default.nix | 3 +++ profiles/workspace/kde/qt.nix | 1 + profiles/workspace/mako.nix | 1 + 5 files changed, 40 insertions(+), 4 deletions(-) diff --git a/profiles/applications-setup.nix b/profiles/applications-setup.nix index 8ed522a..97930b4 100644 --- a/profiles/applications-setup.nix +++ b/profiles/applications-setup.nix @@ -41,8 +41,8 @@ "application/vnd.oasis.opendocument.text" = text_processor; "text/csv" = spreadsheet; "application/vnd.oasis.opendocument.spreadsheet" = spreadsheet; - "text/plain" = - editor; # This actually makes Emacs an editor for everything... XDG is wierd + "text/plain" = editor; + "text/*" = editor; }; }; }; diff --git a/profiles/applications/helix.nix b/profiles/applications/helix.nix index 731e500..b98597d 100644 --- a/profiles/applications/helix.nix +++ b/profiles/applications/helix.nix @@ -1,9 +1,40 @@ { config, pkgs, ... }: { defaultApplications.editor = { - cmd = "${pkgs.helix}/bin/helix"; + cmd = "${pkgs.helix}/bin/hx"; desktop = "helix"; }; home-manager.users.balsoft = { + home.packages = [ + (pkgs.makeDesktopItem { + name = "helix"; + desktopName = "Helix editor"; + terminal = true; + categories = [ "Utility" "TextEditor" "Development" "IDE" ]; + mimeTypes = [ + "inode/directory" + "text/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" + "application/json" + "application/xml" + "text/xml" + "text/x-c" + "text/x-c++" + ]; + exec = "${pkgs.helix}/bin/hx %F"; + icon = "helix"; + }) + ]; xdg.configFile."helix/languages.toml".text = '' [[language]] name = "nix" @@ -100,7 +131,7 @@ }; "ui.cursor.match" = { bg = base01; }; "string" = base0B; - "variable.other.member" = base0B; + # "variable.other.member" = base0B; "constant.character.escape" = base0E; "function" = base05; "constructor" = base0A; diff --git a/profiles/workspace/gnome3/default.nix b/profiles/workspace/gnome3/default.nix index 4b9dff4..54f7ff2 100644 --- a/profiles/workspace/gnome3/default.nix +++ b/profiles/workspace/gnome3/default.nix @@ -15,6 +15,9 @@ }; environment.systemPackages = [ pkgs.pass-secret-service ]; + + environment.gnome.excludePackages = [ pkgs.gnome-console ]; + services.dbus.packages = [ pkgs.pass-secret-service ]; xdg.portal.extraPortals = [ pkgs.pass-secret-service ]; diff --git a/profiles/workspace/kde/qt.nix b/profiles/workspace/kde/qt.nix index 94be0f5..296e971 100644 --- a/profiles/workspace/kde/qt.nix +++ b/profiles/workspace/kde/qt.nix @@ -116,6 +116,7 @@ with pkgs.my-lib; { smallestReadableFont = "${fonts.main.family},${toString fonts.main.size},-1,5,57,0,0,0,0,0,Medium"; toolBarFont = "${fonts.main.family},${toString fonts.main.size},-1,5,50,0,0,0,0,0"; + TerminalApplication = "alacritty"; }; KDE = { DoubleClickInterval = 400; diff --git a/profiles/workspace/mako.nix b/profiles/workspace/mako.nix index ce26a5d..b5d705d 100644 --- a/profiles/workspace/mako.nix +++ b/profiles/workspace/mako.nix @@ -23,6 +23,7 @@ maxIconSize = 24; extraConfig = let play = sound: + pkgs.writeShellScript "play-${sound}" "${pkgs.mpv}/bin/mpv ${pkgs.sound-theme-freedesktop}/share/sounds/freedesktop/stereo/${sound}.oga"; in '' on-notify=exec ${play "message"}