feat(tweaks,grip): use go-grip instead of grip

This commit is contained in:
Guz
2024-12-08 21:16:07 -03:00
parent 240244f812
commit 2e81154a99
4 changed files with 64 additions and 27 deletions

55
flake.lock generated
View File

@@ -74,6 +74,24 @@
"type": "indirect"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat_2",
@@ -123,6 +141,27 @@
"type": "github"
}
},
"go-grip": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1733702535,
"narHash": "sha256-PHv+pxgdJE8MgM5AS2Yu9+vdD0I4kpRekgHMN5uRIHg=",
"owner": "guz013",
"repo": "go-grip",
"rev": "d67368388939be8513cd52a9e1d86d71543dbcde",
"type": "github"
},
"original": {
"owner": "guz013",
"repo": "go-grip",
"type": "github"
}
},
"hercules-ci-effects": {
"inputs": {
"flake-parts": "flake-parts_2",
@@ -218,9 +257,25 @@
},
"root": {
"inputs": {
"go-grip": "go-grip",
"neovim-nightly-overlay": "neovim-nightly-overlay",
"nixpkgs": "nixpkgs_2"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",

View File

@@ -3,6 +3,11 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
go-grip = {
url = "github:guz013/go-grip";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
@@ -23,32 +28,9 @@
pkgs = import nixpkgs {inherit system overlays;};
in
f system pkgs);
grip = {
pkgs,
lib,
}: let
gripConf = pkgs.writeText "settings.py" ''
HOST = "0.0.0.0"
'';
gripHome = pkgs.stdenv.mkDerivation {
name = "grip-conf";
src = gripConf;
phases = ["installPhase"];
installPhase = ''
mkdir -p $out
cp $src $out/settings.py
'';
};
in
pkgs.writeShellScriptBin "grip" ''
export GRIPHOME="${gripHome}"
${lib.getExe pkgs.python312Packages.grip} "$@"
'';
in {
packages = forAllSystems (system: pkgs: {
grip = pkgs.callPackage grip {};
neovim = pkgs.callPackage ./neovim.nix {inherit self;};
neovim = pkgs.callPackage ./neovim.nix {inherit inputs;};
default = self.packages.${system}.neovim;
});

View File

@@ -16,7 +16,7 @@ vim.api.nvim_create_user_command("GripStart", function()
local file = vim.api.nvim_buf_get_name(0)
local cmd = "grip " .. file
local cmd = "go-grip -b false -H 0.0.0.0 " .. file
grip_channel = vim.fn.jobstart(cmd, {
stderr_buffered = true,

View File

@@ -1,5 +1,5 @@
{
self,
inputs,
symlinkJoin,
makeWrapper,
runCommandLocal,
@@ -87,7 +87,7 @@
lf
ripgrep
self.packages.${pkgs.system}.grip
inputs.go-grip.packages.${pkgs.system}.default
];
foldPlugins = builtins.foldl' (acc: next: acc ++ [next] ++ (foldPlugins (next.dependencies or []))) [];