diff --git a/keys.nix b/keys.nix new file mode 100644 index 0000000..96146ef --- /dev/null +++ b/keys.nix @@ -0,0 +1,16 @@ +{ lib, ... }: let + inherit (lib) mkOption; + inherit (lib.types) attrsOf str; +in { + options = { + keys = mkOption { + type = attrsOf str; + default = { + up = "t"; + down = "n"; + left = "h"; + right = "s"; + }; + }; + }; +} diff --git a/modules/user/default.nix b/modules/user/default.nix index 21b924b..b81fa54 100644 --- a/modules/user/default.nix +++ b/modules/user/default.nix @@ -1,6 +1,7 @@ { lib, config, pkgs, ... }: { imports = [ ./media.nix + ./notes.nix ./programs.nix ./themes.nix ]; diff --git a/modules/user/notes.nix b/modules/user/notes.nix new file mode 100644 index 0000000..3d13682 --- /dev/null +++ b/modules/user/notes.nix @@ -0,0 +1,16 @@ +{ lib, config, pkgs, ... }: lib.mkIf config.full { + home-manager.user.${config.username} = { + home.packages = [ + ]; + + programs.sioyek = { + enable = true; + bindings = { + "move_up" = "k"; + "move_down" = "k"; + "move_left" = "k"; + "move_right" = "k"; + }; + }; + }; +} diff --git a/modules/utils/default.nix b/modules/utils/default.nix index c1c46d8..ed781fc 100644 --- a/modules/utils/default.nix +++ b/modules/utils/default.nix @@ -52,8 +52,8 @@ enable = true; defaultEditor = true; extraPackages = with pkgs; [ nil marksman ]; - settings = import ./helix.conf.nix; - languages = import ./helix-languages.conf.nix; + settings = import ./helix.conf.nix { config = config; }; + languages = import ./helix-languages.conf.nix { }; }; programs.direnv = { diff --git a/modules/utils/helix-languages.conf.nix b/modules/utils/helix-languages.conf.nix index e1e9ac0..07a7ff7 100644 --- a/modules/utils/helix-languages.conf.nix +++ b/modules/utils/helix-languages.conf.nix @@ -1,4 +1,4 @@ -{ +{...}: { language-server = { asm-lsp = { command = "asm-lsp"; diff --git a/modules/utils/helix.conf.nix b/modules/utils/helix.conf.nix index c1d88c9..d9d09ef 100644 --- a/modules/utils/helix.conf.nix +++ b/modules/utils/helix.conf.nix @@ -1,4 +1,4 @@ -{ +{ config, ... }: { theme = "rose_pine"; editor = { @@ -30,19 +30,19 @@ }; keys.normal = { - h = "move_char_left"; - t = "move_line_up"; - n = "move_line_down"; - s = "move_char_right"; + ${config.keys.up} = "move_line_up"; + ${config.keys.down} = "move_line_down"; + ${config.keys.left} = "move_char_left"; + ${config.keys.right} = "move_char_right"; C-n = "search_next"; C-t = "search_prev"; }; keys.select = { - h = "extend_char_left"; - t = "extend_line_up"; - n = "extend_line_down"; - s = "extend_char_right"; + ${config.keys.up} = "extend_line_up"; + ${config.keys.down} = "extend_line_down"; + ${config.keys.left} = "extend_char_left"; + ${config.keys.right} = "extend_char_right"; }; } diff --git a/outputs.nix b/outputs.nix index c678d54..7aa6800 100644 --- a/outputs.nix +++ b/outputs.nix @@ -3,6 +3,7 @@ ./modules ./options.nix ./colors.nix + ./keys.nix niri.nixosModules.niri home-manager.nixosModules.home-manager lix.nixosModules.default