From 5869e4a6b4d9e612d928ccd5750f783a6ac391f8 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Mon, 31 Mar 2025 11:19:52 -0400 Subject: [PATCH] use flakes to update helix and yazi to fix integration issues --- flake.lock | 172 +++++++++++++++++- flake.nix | 12 ++ lib/default.nix | 2 + .../modules/nmasur/presets/programs/helix.nix | 14 +- 4 files changed, 184 insertions(+), 16 deletions(-) diff --git a/flake.lock b/flake.lock index 69728b0..4200807 100644 --- a/flake.lock +++ b/flake.lock @@ -111,6 +111,24 @@ } }, "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { "inputs": { "systems": [ "mac-app-util", @@ -130,9 +148,9 @@ "type": "indirect" } }, - "flake-utils_2": { + "flake-utils_3": { "inputs": { - "systems": "systems_2" + "systems": "systems_3" }, "locked": { "lastModified": 1705309234, @@ -148,6 +166,46 @@ "type": "github" } }, + "flake-utils_4": { + "inputs": { + "systems": "systems_4" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "helix": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ], + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1743346877, + "narHash": "sha256-WczB9koq4xvdBZoMLW8VFT16RGaDrJXyA0rDTg2GFVU=", + "owner": "helix-editor", + "repo": "helix", + "rev": "e148d8b3110ace99505c0871714cd64391cc4ba3", + "type": "github" + }, + "original": { + "owner": "helix-editor", + "repo": "helix", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -173,11 +231,11 @@ "inputs": { "cl-nix-lite": "cl-nix-lite", "flake-compat": "flake-compat", - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_2", "nixpkgs": [ "nixpkgs" ], - "systems": "systems" + "systems": "systems_2" }, "locked": { "lastModified": 1742156590, @@ -195,7 +253,7 @@ }, "nix2vim": { "inputs": { - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils_3", "nixpkgs": [ "nixpkgs" ] @@ -324,6 +382,7 @@ "inputs": { "darwin": "darwin", "disko": "disko", + "helix": "helix", "home-manager": "home-manager", "mac-app-util": "mac-app-util", "nix2vim": "nix2vim", @@ -332,11 +391,54 @@ "nixpkgs-stable": "nixpkgs-stable", "nur": "nur", "wsl": "wsl", + "yazi": "yazi", "zellij-switch": "zellij-switch", "zenyd-mpv-scripts": "zenyd-mpv-scripts" } }, "rust-overlay": { + "inputs": { + "nixpkgs": [ + "helix", + "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" + } + }, + "rust-overlay_2": { + "inputs": { + "nixpkgs": [ + "yazi", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1737080704, + "narHash": "sha256-n+J2h9GM9ZpFOQUmtZoCr1+DFF/iO5UlmLJeHIxbZGY=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "f9953fe89f8b65401fc4d4a288940bc2cb072949", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "rust-overlay_3": { "inputs": { "nixpkgs": "nixpkgs_2" }, @@ -355,6 +457,21 @@ } }, "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { "locked": { "lastModified": 1689347925, "narHash": "sha256-ozenz5bFe1UUqOn7f60HRmgc01BgTGIKZ4Xl+HbocGQ=", @@ -369,7 +486,7 @@ "type": "github" } }, - "systems_2": { + "systems_3": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -384,7 +501,22 @@ "type": "github" } }, - "systems_3": { + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_5": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -441,13 +573,35 @@ "type": "github" } }, + "yazi": { + "inputs": { + "flake-utils": "flake-utils_4", + "nixpkgs": [ + "nixpkgs" + ], + "rust-overlay": "rust-overlay_2" + }, + "locked": { + "lastModified": 1743344227, + "narHash": "sha256-Lp1JUMrhvAmCzftOSQ2Sr0+svemxSxcLeZ4HkmdLXbE=", + "owner": "sxyazi", + "repo": "yazi", + "rev": "1765aba68440f73c590cedac14ece6778fe88ff5", + "type": "github" + }, + "original": { + "owner": "sxyazi", + "repo": "yazi", + "type": "github" + } + }, "zellij-switch": { "inputs": { "nixpkgs": [ "nixpkgs" ], - "rust-overlay": "rust-overlay", - "systems": "systems_3" + "rust-overlay": "rust-overlay_3", + "systems": "systems_5" }, "locked": { "lastModified": 1742588229, diff --git a/flake.nix b/flake.nix index 93dfef2..492736f 100644 --- a/flake.nix +++ b/flake.nix @@ -70,6 +70,18 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + # Text editor + helix = { + url = "github:helix-editor/helix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + # Terminal file manager + yazi = { + url = "github:sxyazi/yazi"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + # # Nextcloud Apps # nextcloud-news = { # # https://github.com/nextcloud/news/releases diff --git a/lib/default.nix b/lib/default.nix index bd4f86d..ae0f586 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -67,6 +67,8 @@ lib inputs.nur.overlays.default inputs.nix2vim.overlay inputs.zellij-switch.overlays.default + inputs.helix.overlays.default + inputs.yazi.overlays.default ] ++ (importOverlays ../overlays); # System types to support. diff --git a/platforms/home-manager/modules/nmasur/presets/programs/helix.nix b/platforms/home-manager/modules/nmasur/presets/programs/helix.nix index e7fc31b..3c7dfb3 100644 --- a/platforms/home-manager/modules/nmasur/presets/programs/helix.nix +++ b/platforms/home-manager/modules/nmasur/presets/programs/helix.nix @@ -150,13 +150,13 @@ in # Open yazi # https://github.com/sxyazi/yazi/pull/2461 # Won't work until next Helix release - # C-y = [ - # ":sh rm -f /tmp/unique-file" - # ":insert-output ${lib.getExe pkgs.yazi} %{buffer_name} --chooser-file=/tmp/unique-file" - # ":insert-output echo \\x1b[?1049h\\x1b[?2004h > /dev/tty" - # ":open %sh{cat /tmp/unique-file}" - # ":redraw" - # ]; + C-y = [ + ":sh rm -f /tmp/unique-file" + ":insert-output ${lib.getExe pkgs.yazi} %{buffer_name} --chooser-file=/tmp/unique-file" + ":insert-output echo \\x1b[?1049h\\x1b[?2004h > /dev/tty" + ":open %sh{cat /tmp/unique-file}" + ":redraw" + ]; # Extend selection above X = "select_line_above";