From 1f800c20918184ddb61ff29276862a23051c23fe Mon Sep 17 00:00:00 2001 From: Charlie Root Date: Thu, 12 Sep 2024 14:59:39 +0200 Subject: [PATCH] helix: wrapped helix, added helix cachix --- modules/programs/editors/helix/module.nix | 25 +++----------- modules/system/nix/module.nix | 2 ++ parts/pkgs/default.nix | 4 ++- parts/pkgs/extraPackages/helix-wrapped.nix | 35 ++++++++++++++++++++ parts/pkgs/extraPackages/nushell-wrapped.nix | 2 +- 5 files changed, 45 insertions(+), 23 deletions(-) create mode 100644 parts/pkgs/extraPackages/helix-wrapped.nix diff --git a/modules/programs/editors/helix/module.nix b/modules/programs/editors/helix/module.nix index 7cfc7eb..0bfc9dc 100644 --- a/modules/programs/editors/helix/module.nix +++ b/modules/programs/editors/helix/module.nix @@ -1,37 +1,20 @@ { config, - inputs', lib, - pkgs, + self', ... }: let cfg = config.modules.system.programs.editors.helix; inherit (config.modules.other.system) username; - inherit (lib) mkIf makeBinPath; + inherit (lib) mkIf; in { imports = [./languages.nix]; config = mkIf cfg.enable { home-manager.users.${username} = { programs.helix = { enable = true; - # thanks fufexan, this is great! - package = inputs'.helix.packages.default.overrideAttrs (previousAttrs: { - makeWrapperArgs = with pkgs; - previousAttrs.makeWrapperArgs - or [] - ++ [ - "--suffix" - "PATH" - ":" - (makeBinPath [ - clang-tools - marksman - nil - bash-language-server - shellcheck - ]) - ]; - }); + package = self'.packages.helix; + settings = { theme = "catppuccin_mocha"; editor = { diff --git a/modules/system/nix/module.nix b/modules/system/nix/module.nix index 559275a..44904f4 100644 --- a/modules/system/nix/module.nix +++ b/modules/system/nix/module.nix @@ -127,12 +127,14 @@ "https://hyprland.cachix.org" # hyprland "https://nixpkgs-unfree.cachix.org" # unfree-package cache "https://neovim-flake.cachix.org" # a cache for nvf + "https://helix.cachix.org" # a chache for helix ]; trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ3m4myogDm4OgU2ru6lIwPvuCVs=" ]; }; }; diff --git a/parts/pkgs/default.nix b/parts/pkgs/default.nix index b61a878..0c4cc6d 100644 --- a/parts/pkgs/default.nix +++ b/parts/pkgs/default.nix @@ -1,10 +1,11 @@ -{inputs, ...}: { +{inputs, inputs', ...}: { # NOTE: We use flake-parts' easyOverlay module to extend our default packages with some extra packages I want to have. # imports = [inputs.flake-parts.flakeModules.easyOverlay]; perSystem = { config, lib, + inputs', pkgs, ... }: { @@ -20,6 +21,7 @@ packages = { nushell = import ./extraPackages/nushell-wrapped.nix {inherit inputs lib pkgs;}; + helix = import ./extraPackages/helix-wrapped.nix {inherit inputs inputs' lib pkgs;}; }; }; } diff --git a/parts/pkgs/extraPackages/helix-wrapped.nix b/parts/pkgs/extraPackages/helix-wrapped.nix new file mode 100644 index 0000000..d8a7340 --- /dev/null +++ b/parts/pkgs/extraPackages/helix-wrapped.nix @@ -0,0 +1,35 @@ +{ + inputs', + inputs, + lib, + pkgs, + ... +}: let + helix-wrapped = inputs.wrapper-manager.lib.build { + inherit pkgs; + modules = [ + { + wrappers.nushell-wrapped = { + basePackage = inputs'.helix.packages.default; + pathAdd = with pkgs; [ + # C/C++ + clang-tools + + # Markdown + marksman + + # Nix + nil + + # Bash + bash-language-server + + # Shell + shellcheck + ]; + }; + } + ]; + }; +in + helix-wrapped diff --git a/parts/pkgs/extraPackages/nushell-wrapped.nix b/parts/pkgs/extraPackages/nushell-wrapped.nix index 920cc6e..0fc793a 100644 --- a/parts/pkgs/extraPackages/nushell-wrapped.nix +++ b/parts/pkgs/extraPackages/nushell-wrapped.nix @@ -34,7 +34,7 @@ iputils asciinema inetutils scc - oefetch + onefetch wget cpufetch yt-dlp