Commit 975ef55

HPCesia <me@hpcesia.com>
2026-08-27 10:05:48
helix: update config
1 parent 191465c
Changed files (5)
modules/dev/editor/helix/default.nix
@@ -1,43 +1,30 @@
-{
+{inputs, ...}: {
+  flake-file.inputs.helix-plugins-nix = {
+    url = "https://codeberg.org/maxschipper/helix-plugins-nix/archive/main.tar.gz";
+    inputs.nixpkgs.follows = "nixpkgs";
+  };
+
   den.aspects.dev.editor.helix = {
     cacheHome = {config, ...}: {
       directories = [
-        "${config.xdg.config.directory}/helix"
         "${config.xdg.data.directory}/helix" # Workspace trust data
-        "${config.xdg.data.directory}/steel" # Steel plugin system data
       ];
     };
 
+    nixos = {
+      nixpkgs.overlays = [inputs.helix-plugins-nix.overlays.default];
+    };
+
     hjem = {
       config,
       pkgs,
+      lib,
       ...
-    }: let
-      steel-wrapped = pkgs.symlinkJoin {
-        pname = "steel-wrapped";
-        inherit (pkgs.steel) version;
-        paths = [pkgs.steel];
-        nativeBuildInputs = [pkgs.makeBinaryWrapper];
-        postBuild = ''
-          wrapProgram $out/bin/forge \
-            --prefix PATH : ${pkgs.lib.makeBinPath (with pkgs; [gcc cargo])}
-        '';
-        meta = {
-          inherit
-            (pkgs.steel.meta)
-            description
-            homepage
-            changelog
-            license
-            mainProgram
-            ;
-        };
-      };
-    in {
+    }: {
       packages = [
         pkgs.nur.repos.hpcesia.steelix
 
-        steel-wrapped
+        pkgs.steel
         pkgs.schemat
       ];
 
@@ -51,7 +38,6 @@
         generator = (pkgs.formats.toml {}).generate "helix-config.toml";
         value = {
           editor = {
-            line-number = "relative";
             cursorline = true;
             bufferline = "multiple";
             statusline = {
@@ -59,6 +45,13 @@
               center = ["file-name" "read-only-indicator" "file-modification-indicator"];
               right = ["file-type" "file-encoding" "separator" "position" "total-line-numbers"];
             };
+            line-number = "relative";
+            indent-guides = {
+              render = true;
+              character = "┊";
+              skip-levels = 1;
+            };
+            rulers = [80];
             cursor-shape = {
               normal = "block";
               insert = "bar";
@@ -72,11 +65,6 @@
               display-inlay-hints = true;
               inlay-hints-length-limit = 16;
             };
-            indent-guides = {
-              render = true;
-              character = "┊";
-              skip-levels = 1;
-            };
             file-picker = {
               hidden = false;
             };
@@ -104,9 +92,39 @@
         type = "copy";
       };
 
-      xdg.data.files."steel/cogs/smith.hx" = {
-        source = "${pkgs.nur.repos.hpcesia.helixPlugins.smith}/cogs/smith.hx";
-      };
+      xdg.data.files = let
+        helixPluginsNixUtils =
+          (import "${inputs.helix-plugins-nix}/modules/utils.nix")
+          {inherit pkgs lib;};
+
+        allPlugins = helixPluginsNixUtils.flattenPlugins [
+          pkgs.helixPlugins.forest
+          pkgs.helixPlugins.wakatime
+          pkgs.helixPlugins.who
+        ];
+
+        nativePlugins = helixPluginsNixUtils.getNativePlugins allPlugins;
+        nativeLibDrv = helixPluginsNixUtils.mergeNativeLibs nativePlugins;
+
+        pluginLinks = builtins.listToAttrs (
+          map (drv: {
+            name = "steel/cogs/${drv.cogName}";
+            value = {
+              source = drv;
+              clobber = true;
+            };
+          })
+          allPlugins
+        );
+
+        nativeLibLink = lib.optionalAttrs (nativeLibDrv != null) {
+          "steel/native" = {
+            source = nativeLibDrv;
+            clobber = true;
+          };
+        };
+      in
+        pluginLinks // nativeLibLink;
     };
   };
 
modules/dev/editor/helix/helix.scm
@@ -1,15 +1,1 @@
 (require "helix/editor.scm")
-(require (prefix-in helix. "helix/commands.scm"))
-(require (prefix-in helix.static. "helix/static.scm"))
-
-(provide open-helix-scm open-init-scm)
-
-;;@doc
-;; Open the helix.scm file
-(define (open-helix-scm)
-  (helix.open (helix.static.get-helix-scm-path)))
-
-;;@doc
-;; Opens the init.scm file
-(define (open-init-scm)
-  (helix.open (helix.static.get-init-scm-path)))
modules/dev/editor/helix/init.scm
@@ -1,24 +1,20 @@
 (require "helix/configuration.scm")
+(require "helix/keymaps.scm")
 
 (define-lsp "steel-language-server" (command "steel-language-server") (args '()))
 (define-language "scheme"
   (language-servers '("steel-language-server"))
   (formatter (command "schemat")))
 
-(require (only-in "smith.hx/smith.scm"
-          smith-plugin
-          smith-prune
-          smith-init))
+(require "forest/forest.scm")
+;; (forest-configure! side)
+(forest-configure! 'left #:ignore (list ".git" ".jj" "result" "target" "__pycache__"))
+;; (forest-set-style! style)
+(forest-set-style! 'mini)
+(keymap (global)
+  (normal
+    (space
+      (e ":forest-open"))))
 
-(smith-plugin "https://github.com/mtul0729/helix-fcitx-focus.git")
-(smith-plugin "https://github.com/Xerxes-2/wakatime.hx.git")
-(smith-plugin "https://github.com/Ra77a3l3-jar/who.hx.git")
-
-(smith-plugin "https://github.com/Ra77a3l3-jar/forest.hx.git"
-  (config
-    (forest-configure! 'left #:ignore (list ".git" ".jj" "result" "target" "__pycache__"))
-    (forest-set-style! 'mini))
-  (bind
-    ("normal" ("space" "e") ":forest-open")))
-
-(smith-init)
+(require "wakatime/wakatime.scm")
+(require "who/who.scm")
flake.lock
@@ -164,6 +164,25 @@
         "type": "github"
       }
     },
+    "helix-plugins-nix": {
+      "inputs": {
+        "nixpkgs": [
+          "nixpkgs"
+        ],
+        "systems": "systems_2"
+      },
+      "locked": {
+        "lastModified": 1787958080,
+        "narHash": "sha256-Wq62h4qPsABKb0pJJDoXJvxVWSuBsShy3r4FioKqi2Y=",
+        "rev": "629a6b9489dbab75b8bff3daaf4843f66f97e35c",
+        "type": "tarball",
+        "url": "https://codeberg.org/api/v1/repos/maxschipper/helix-plugins-nix/archive/629a6b9489dbab75b8bff3daaf4843f66f97e35c.tar.gz"
+      },
+      "original": {
+        "type": "tarball",
+        "url": "https://codeberg.org/maxschipper/helix-plugins-nix/archive/main.tar.gz"
+      }
+    },
     "hjem": {
       "inputs": {
         "nixpkgs": [
@@ -340,6 +359,7 @@
         "flake-compat": "flake-compat",
         "flake-file": "flake-file",
         "flake-parts": "flake-parts",
+        "helix-plugins-nix": "helix-plugins-nix",
         "hjem": "hjem",
         "import-tree": "import-tree",
         "ncro": "ncro",
@@ -366,6 +386,21 @@
         "type": "github"
       }
     },
+    "systems_2": {
+      "locked": {
+        "lastModified": 1681028828,
+        "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+        "owner": "nix-systems",
+        "repo": "default",
+        "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nix-systems",
+        "repo": "default",
+        "type": "github"
+      }
+    },
     "utils": {
       "inputs": {
         "systems": "systems"
flake.nix
@@ -28,6 +28,10 @@
       url = "github:hercules-ci/flake-parts";
       inputs.nixpkgs-lib.follows = "nixpkgs";
     };
+    helix-plugins-nix = {
+      url = "https://codeberg.org/maxschipper/helix-plugins-nix/archive/main.tar.gz";
+      inputs.nixpkgs.follows = "nixpkgs";
+    };
     hjem = {
       url = "github:feel-co/hjem";
       inputs.nixpkgs.follows = "nixpkgs";