From efe37836bd4261471d4ab87aea13da6bb97c3b9e Mon Sep 17 00:00:00 2001 From: "Alexandre Cavalheiro S. Tiago da Silva" Date: Thu, 16 Jan 2025 20:25:32 -0300 Subject: [PATCH 1/3] fix(neovim): better default for ollama and disable neovim in the module Of course, enable neovim in the desktop and laptop configs --- modules/home-manager/programs/neovim/default.nix | 8 ++++++-- specific/desktop/home-manager.nix | 4 ++++ specific/laptop/home-manager.nix | 9 +++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/modules/home-manager/programs/neovim/default.nix b/modules/home-manager/programs/neovim/default.nix index 224c365..c3488e3 100644 --- a/modules/home-manager/programs/neovim/default.nix +++ b/modules/home-manager/programs/neovim/default.nix @@ -8,7 +8,12 @@ let inherit (lib) types mkOption; ollamaPackage = - if config.programs.neovim.ollama.type == "amd" then pkgs.ollama-rocm else pkgs.ollama-cuda; + if config.programs.neovim.ollama.type == "amd" then + pkgs.ollama-rocm + else if config.programs.neovim.ollama.type == "nvidia" then + pkgs.ollama-cuda + else + pkgs.ollama; in { options.programs.neovim = { @@ -41,7 +46,6 @@ in config = { programs.neovim = { - enable = true; withNodeJs = true; withPython3 = true; diff --git a/specific/desktop/home-manager.nix b/specific/desktop/home-manager.nix index 18201c4..3cd7a67 100644 --- a/specific/desktop/home-manager.nix +++ b/specific/desktop/home-manager.nix @@ -117,6 +117,10 @@ # MODULES # # + programs.neovim = { + enable = true; + }; + modules.hyprland = { # Enable scripts scripts = { diff --git a/specific/laptop/home-manager.nix b/specific/laptop/home-manager.nix index dd25a51..ae2073f 100644 --- a/specific/laptop/home-manager.nix +++ b/specific/laptop/home-manager.nix @@ -106,8 +106,13 @@ # MODULES # # - # Set the hostname for nixd in neovim - programs.neovim.nixd.hostname = "wizlap"; + # Enable neovim + programs.neovim = { + enable = true; + + # Set the hostname for nixd in neovim + nixd.hostname = "wizlap"; + }; # Add monitor configuration to hyprland modules.hyprland = { From 925551ec26f40515e62133ba70b441a29ccd5fb3 Mon Sep 17 00:00:00 2001 From: "Alexandre Cavalheiro S. Tiago da Silva" Date: Thu, 16 Jan 2025 20:26:42 -0300 Subject: [PATCH 2/3] feat(desktop): new wallpaper --- specific/desktop/home-manager.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specific/desktop/home-manager.nix b/specific/desktop/home-manager.nix index 3cd7a67..1a44a7a 100644 --- a/specific/desktop/home-manager.nix +++ b/specific/desktop/home-manager.nix @@ -42,10 +42,10 @@ ## Start wallpaper daemon and set one. # OUTPUT_1="DP-2" - IMAGE_1="/mnt/internal/personal/wallpapers/wallhaven-vqlvm8.jpg" + IMAGE_1="/mnt/internal/personal/wallpapers/edited/1440-bicycle.jpg" OUTPUT_2="DP-3" - IMAGE_2="/mnt/internal/personal/wallpapers/wallhaven-2yl6px.jpg" + IMAGE_2="/mnt/internal/personal/wallpapers/edited/1080-bycicle.jpg" function load_wallpapers() { swww img -t any --transition-bezier 0.0,0.0,1.0,1.0 --transition-duration .8 --transition-step 255 --transition-fps 60 -o $OUTPUT_1 $IMAGE_1; From 0ad475e6bfda3cee1fc29aa02ea51765c3096068 Mon Sep 17 00:00:00 2001 From: "Alexandre Cavalheiro S. Tiago da Silva" Date: Thu, 16 Jan 2025 21:03:29 -0300 Subject: [PATCH 3/3] fix(neovim): make ollama optional --- flake.nix | 6 +++- .../home-manager/programs/neovim/default.nix | 32 ++++++++++++------- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/flake.nix b/flake.nix index caaf3d0..cea4163 100644 --- a/flake.nix +++ b/flake.nix @@ -25,7 +25,11 @@ }; outputs = - { home-manager, nixpkgs, ... }@inputs: + { + home-manager, + nixpkgs, + ... + }@inputs: let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; diff --git a/modules/home-manager/programs/neovim/default.nix b/modules/home-manager/programs/neovim/default.nix index c3488e3..45132f7 100644 --- a/modules/home-manager/programs/neovim/default.nix +++ b/modules/home-manager/programs/neovim/default.nix @@ -6,14 +6,21 @@ }: let - inherit (lib) types mkOption; - ollamaPackage = + inherit (lib) + types + mkOption + mkIf + mkEnableOption + ; + + ollamaPackage = mkIf config.programs.neovim.ollama.enable ( if config.programs.neovim.ollama.type == "amd" then pkgs.ollama-rocm else if config.programs.neovim.ollama.type == "nvidia" then pkgs.ollama-cuda else - pkgs.ollama; + pkgs.ollama + ); in { options.programs.neovim = { @@ -33,14 +40,17 @@ in }; }; - ollama.type = mkOption { - default = "amd"; - description = "The type of ollama package to install, AMD GPU accelerated or NVIDIA GPU accelerated."; - example = "amd"; - type = types.enum [ - "amd" - "nvidia" - ]; + ollama = { + enable = mkEnableOption "enable"; + type = mkOption { + default = "amd"; + description = "The type of ollama package to install, AMD GPU accelerated or NVIDIA GPU accelerated."; + example = "amd"; + type = types.enum [ + "amd" + "nvidia" + ]; + }; }; };