From ca1aae61126154b737ba4b5589ace10288adc0e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Thu, 22 Jun 2023 09:34:38 +0100 Subject: [PATCH] defualt helix settings to facilitate learning keybindings --- nixos/boxes/foryog/default.nix | 40 +++++++++++-------- nixos/home-manager/programs/helix.nix | 55 ++++++--------------------- 2 files changed, 35 insertions(+), 60 deletions(-) diff --git a/nixos/boxes/foryog/default.nix b/nixos/boxes/foryog/default.nix index 489ad817..5cdbbee7 100644 --- a/nixos/boxes/foryog/default.nix +++ b/nixos/boxes/foryog/default.nix @@ -1,4 +1,11 @@ -{ config, pkgs, inputs, lib, nixpkgs-nixos-unstable-and-unfree, ... }: { +{ + config, + pkgs, + inputs, + lib, + nixpkgs-nixos-unstable-and-unfree, + ... +}: { networking.hostName = "foryog"; imports = [ @@ -15,12 +22,11 @@ ../../zsh ]; - fileSystems."/" = { options = [ "compress=zstd" ]; }; + fileSystems."/" = {options = ["compress=zstd"];}; - boot.kernelParams = - [ "initcall_debug" ''dyndbg="file suspend.c +p"'' "no_console_suspend" ]; + boot.kernelParams = ["initcall_debug" ''dyndbg="file suspend.c +p"'' "no_console_suspend"]; boot.tmp.cleanOnBoot = true; - boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; + boot.binfmt.emulatedSystems = ["aarch64-linux"]; boot.plymouth = { enable = true; logo = ./boot.png; @@ -47,9 +53,9 @@ }; }; }; - services.fprintd = { enable = true; }; + services.fprintd = {enable = true;}; programs.ccache.enable = true; - hardware.opengl.extraPackages = with pkgs; [ libva ]; + hardware.opengl.extraPackages = with pkgs; [libva]; programs.steam.enable = true; nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ @@ -57,18 +63,20 @@ "steam-original" "steam-runtime" "steam-run" + "vscode-extension-ms-vscode-cpptools" "vscode-with-extensions" "vscode" ]; - home-manager.users.cyryl = { ... }: { - imports = [ ../../home-manager/programs/kitty.nix ../../gui/vscode.nix ]; - home.packages = - with inputs.nixpkgs-nixos-unstable.legacyPackages."x86_64-linux"; - [ bisq-desktop ] ++ - - (with pkgs; [ lutris ]) - ++ (with inputs.endless-sky.legacyPackages."x86_64-linux"; - [ endless-sky ]); + home-manager.users.cyryl = {...}: { + imports = [ + ../../home-manager/programs/kitty.nix + ../../home-manager/programs/helix.nix + ../../gui/vscode.nix + ]; + home.packages = with inputs.nixpkgs-nixos-unstable.legacyPackages."x86_64-linux"; + [bisq-desktop] + ++ (with pkgs; [lutris]) + ++ (with inputs.endless-sky.legacyPackages."x86_64-linux"; [endless-sky]); }; } diff --git a/nixos/home-manager/programs/helix.nix b/nixos/home-manager/programs/helix.nix index 09c01f56..fe2c368e 100644 --- a/nixos/home-manager/programs/helix.nix +++ b/nixos/home-manager/programs/helix.nix @@ -11,7 +11,17 @@ in { programs.helix = { enable = true; - package = inputs.helix.packages."${system}".helix; + languages = { + nix = { + name = "nix"; + auto-format = true; + language-server = {command = nil;}; + formatter = { + command = alejandra; + args = ["-q"]; + }; + }; + }; settings = { theme = "solarized_peninsula"; editor = { @@ -20,38 +30,6 @@ in { lsp.display-messages = true; line-number = "relative"; }; - keys = { - normal = { - ";" = "command_mode"; - C-p = "file_picker"; - C-b = "buffer_picker"; - "{" = ["goto_prev_paragraph" "collapse_selection"]; - "}" = ["goto_next_paragraph" "collapse_selection"]; - "0" = "goto_line_start"; - "$" = "goto_line_end"; - "^" = "goto_first_nonwhitespace"; - G = "goto_file_end"; - V = ["select_mode" "extend_to_line_bounds"]; - }; - select = { - "{" = ["extend_to_line_bounds" "goto_prev_paragraph"]; - "}" = ["extend_to_line_bounds" "goto_next_paragraph"]; - "0" = "goto_line_start"; - "$" = "goto_line_end"; - "^" = "goto_first_nonwhitespace"; - G = "goto_file_end"; - D = ["extend_to_line_bounds" "delete_selection" "normal_mode"]; - C = ["goto_line_start" "extend_to_line_bounds" "change_selection"]; - "%" = "match_brackets"; - V = ["extend_to_line_bounds"]; - - i = "select_textobject_inner"; - a = "select_textobject_around"; - - k = ["extend_line_up" "extend_to_line_bounds"]; - j = ["extend_line_down" "extend_to_line_bounds"]; - }; - }; }; themes = { solarized_peninsula = { @@ -143,16 +121,5 @@ in { "error" = "red"; }; }; - languages = [ - { - name = "nix"; - auto-format = true; - language-server = {command = nil;}; - formatter = { - command = alejandra; - args = ["-q"]; - }; - } - ]; }; }