Commit b6b078f

HPCesia <me@hpcesia.com>
2025-07-30 15:11:59
feat(app): helix with steel event system
1 parent 7e1976f
Changed files (6)
home
base
tui
editors
helix
options
home/base/tui/editors/helix/languages/steel.nix
@@ -0,0 +1,19 @@
+{...}: {
+  programs.helix.languages = {
+    language = [
+      {
+        name = "scheme";
+        auto-format = true;
+        indent = {
+          tab-width = 2;
+          unit = "  ";
+        };
+        language-servers = ["steel-language-server"];
+      }
+    ];
+    language-server.steel-language-server = {
+      command = "steel-language-server";
+      args = [];
+    };
+  };
+}
home/base/tui/editors/helix/steel-config/default.nix
@@ -0,0 +1,7 @@
+{pkgs-unstable, ...}: {
+  # Refer: /options/home/helixSteelEventSystem.nix
+  programs.helix.steelEventSystem = {
+    enable = true;
+    steelPackage = pkgs-unstable.steel;
+  };
+}
home/base/tui/editors/helix/default.nix
@@ -1,5 +1,6 @@
 {...}: {
-  imports = [./languages];
+  imports = [./languages ./steel-config];
+
   programs.helix = {
     settings = {
       editor = {
options/home/helixSteelEventSystem.nix
@@ -0,0 +1,44 @@
+{
+  lib,
+  pkgs,
+  config,
+  helix-steel,
+  ...
+}: let
+  inherit (lib) mkOption types;
+
+  cfg = config.programs.helix.steelEventSystem;
+in {
+  options.programs.helix.steelEventSystem = {
+    enable = lib.mkEnableOption "Enable Helix Steel event system.";
+    steelPackage = lib.mkPackageOption pkgs "steel" {};
+    initScm = mkOption {
+      type = types.either types.lines types.path;
+      default = "";
+    };
+    helixScm = mkOption {
+      type = types.either types.lines types.path;
+      default = "";
+    };
+  };
+
+  config = lib.mkIf cfg.enable {
+    home.packages = [cfg.steelPackage];
+    programs.helix.package = lib.mkDefault helix-steel.packages.${pkgs.system}.default;
+
+    xdg.configFile."helix/init.scm" = let
+      scm = cfg.initScm;
+    in
+      lib.mkIf (lib.stringLength scm != 0) {
+        source = lib.mkIf (lib.isPath scm) scm;
+        text = lib.mkIf (!(lib.isPath scm)) scm;
+      };
+    xdg.configFile."helix/helix.scm" = let
+      scm = cfg.helixScm;
+    in
+      lib.mkIf (lib.stringLength scm != 0) {
+        source = lib.mkIf (lib.isPath scm) scm;
+        text = lib.mkIf (!(lib.isPath scm)) scm;
+      };
+  };
+}
flake.lock
@@ -136,6 +136,28 @@
         "type": "github"
       }
     },
+    "helix-steel": {
+      "inputs": {
+        "nixpkgs": [
+          "nixpkgs"
+        ],
+        "rust-overlay": "rust-overlay"
+      },
+      "locked": {
+        "lastModified": 1753848867,
+        "narHash": "sha256-AkZoumnw7+mgNQLyvbfgDN9S1sU4SEM+PdDgbflXOks=",
+        "owner": "mattwparas",
+        "repo": "helix",
+        "rev": "d0c49393072979a45eacbf765594a9ad03ecefb1",
+        "type": "github"
+      },
+      "original": {
+        "owner": "mattwparas",
+        "ref": "steel-event-system",
+        "repo": "helix",
+        "type": "github"
+      }
+    },
     "home-manager": {
       "inputs": {
         "nixpkgs": [
@@ -365,6 +387,7 @@
         "colmena": "colmena",
         "disko": "disko",
         "haumea": "haumea",
+        "helix-steel": "helix-steel",
         "home-manager": "home-manager",
         "nixos-hardware": "nixos-hardware",
         "nixos-logo": "nixos-logo",
@@ -379,6 +402,27 @@
         "wallpapers": "wallpapers"
       }
     },
+    "rust-overlay": {
+      "inputs": {
+        "nixpkgs": [
+          "helix-steel",
+          "nixpkgs"
+        ]
+      },
+      "locked": {
+        "lastModified": 1740623427,
+        "narHash": "sha256-3SdPQrZoa4odlScFDUHd4CUPQ/R1gtH4Mq9u8CBiK8M=",
+        "owner": "oxalica",
+        "repo": "rust-overlay",
+        "rev": "d342e8b5fd88421ff982f383c853f0fc78a847ab",
+        "type": "github"
+      },
+      "original": {
+        "owner": "oxalica",
+        "repo": "rust-overlay",
+        "type": "github"
+      }
+    },
     "sops-nix": {
       "inputs": {
         "nixpkgs": [
flake.nix
@@ -52,6 +52,12 @@
       url = "github:wamserma/flake-programs-sqlite";
       inputs.nixpkgs.follows = "nixpkgs";
     };
+
+    helix-steel = {
+      url = "github:mattwparas/helix/steel-event-system";
+      inputs.nixpkgs.follows = "nixpkgs";
+    };
+
     # === Follows are myself repos === #
     nur-hpcesia = {
       url = "github:HPCesia/nur-packages";