From c9bd4c00a062c3cd2789f4fd31b9833e3eb64c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Gro=C3=9Fmann?= Date: Tue, 28 Nov 2023 12:37:58 +0100 Subject: [PATCH] fix: errors in nixvim config --- modules/config/system.nix | 16 ++++++++++++++ modules/optional/steam.nix | 1 - modules/optional/wayland.nix | 5 ----- users/common/programs/nvim/default.nix | 2 ++ .../common/programs/nvim/nixvim/keybinds.nix | 21 +++++++++++++++++-- users/common/programs/nvim/nixvim/options.nix | 1 - users/common/programs/nvim/nixvim/plugins.nix | 5 +++-- 7 files changed, 40 insertions(+), 11 deletions(-) diff --git a/modules/config/system.nix b/modules/config/system.nix index 23b4931..8d7d596 100644 --- a/modules/config/system.nix +++ b/modules/config/system.nix @@ -26,6 +26,22 @@ enable = true; pkcs11.enable = true; }; + xdg.portal = { + enable = true; + xdgOpenUsePortal = true; + extraPortals = with pkgs; [ + xdg-desktop-portal-wlr + xdg-desktop-portal-gtk + ]; + config = { + common.default = [ + "gtk" + ]; + sway.default = [ + "wlr" + ]; + }; + }; # Just before switching, remove the agenix directory if it exists. # This can happen when a secret is used in the initrd because it will # then be copied to the initramfs under the same path. This materializes diff --git a/modules/optional/steam.nix b/modules/optional/steam.nix index 409a00a..02818f3 100644 --- a/modules/optional/steam.nix +++ b/modules/optional/steam.nix @@ -12,7 +12,6 @@ lib.optionalAttrs (!minimal) { with pkgs; [ # vampir überlebende braucht diese pkgs libgdiplus - xdg-desktop-portal cups ]; }; diff --git a/modules/optional/wayland.nix b/modules/optional/wayland.nix index a663dc4..38b0b97 100644 --- a/modules/optional/wayland.nix +++ b/modules/optional/wayland.nix @@ -6,11 +6,6 @@ }: lib.optionalAttrs (!minimal) { services.dbus.enable = true; - xdg.portal = { - enable = true; - wlr.enable = true; - extraPortals = with pkgs; [xdg-desktop-portal-wlr]; - }; environment.systemPackages = with pkgs; [ xdg-utils wdisplays diff --git a/users/common/programs/nvim/default.nix b/users/common/programs/nvim/default.nix index beafef3..69f51d3 100644 --- a/users/common/programs/nvim/default.nix +++ b/users/common/programs/nvim/default.nix @@ -29,6 +29,8 @@ ''; }; home.sessionVariables.EDITOR = "nvim"; + home.sessionVariables.vim = "nvim"; + home.sessionVariables.vi = "nvim"; home.shellAliases.vimdiff = "nvim -d"; home.persistence."/state".directories = [ ".local/share/nvim" diff --git a/users/common/programs/nvim/nixvim/keybinds.nix b/users/common/programs/nvim/nixvim/keybinds.nix index 3952a07..49bfa4c 100644 --- a/users/common/programs/nvim/nixvim/keybinds.nix +++ b/users/common/programs/nvim/nixvim/keybinds.nix @@ -9,42 +9,50 @@ in { key = ""; action = ""; inherit options; + mode = ["n" "v" "s"]; } { key = ""; action = ""; inherit options; + mode = ["n" "v" "s"]; } { key = ""; action = ""; inherit options; + mode = ["n" "v" "s"]; } { key = ""; action = ""; inherit options; + mode = ["n" "v" "s"]; } { key = ""; action = ""; inherit options; + mode = ["n" "v" "s"]; } { key = ""; action = ""; inherit options; + mode = ["n" "v" "s"]; } { key = ""; action = ""; inherit options; + mode = ["n" "v" "s"]; } { key = ""; action = ""; inherit options; + mode = ["n" "v" "s"]; } # scroll with cursor lock @@ -52,21 +60,23 @@ in { key = ""; action = ""; inherit options; + mode = ["n" "v" "s"]; } { key = ""; action = ""; inherit options; + mode = ["n" "v" "s"]; } { key = ""; - action = "a"; + action = "a"; inherit options; mode = "i"; } { key = ""; - action = "a"; + action = "a"; inherit options; mode = "i"; } @@ -74,6 +84,13 @@ in { key = "u"; action = "UndotreeToggle"; inherit options; + mode = ["n" "v" "s"]; + } + { + key = "t"; + action = "Neotree toggle"; + inherit options; + mode = ["n" "v" "s"]; } ]; } diff --git a/users/common/programs/nvim/nixvim/options.nix b/users/common/programs/nvim/nixvim/options.nix index bdae29d..0bd2b30 100644 --- a/users/common/programs/nvim/nixvim/options.nix +++ b/users/common/programs/nvim/nixvim/options.nix @@ -4,7 +4,6 @@ undolevels = 1000000; # Persistent Undo undofile = true; - undodir = "~/.cache/nvim/undo"; # swap file save interval updatetime = 300; diff --git a/users/common/programs/nvim/nixvim/plugins.nix b/users/common/programs/nvim/nixvim/plugins.nix index 5cb261d..8f97cff 100644 --- a/users/common/programs/nvim/nixvim/plugins.nix +++ b/users/common/programs/nvim/nixvim/plugins.nix @@ -35,8 +35,9 @@ # Fzf picker for arbitrary stuff telescope = { enable = true; - enabledExtensions = ["fzf" "notify" "ui-select"]; - extensions.fzf-native.enable = true; + extensions = { + fzf-native.enable = true; + }; }; # Undo tree