diff --git a/flake.lock b/flake.lock index b602299..97ee63a 100755 --- a/flake.lock +++ b/flake.lock @@ -211,6 +211,29 @@ "type": "github" } }, + "neovim": { + "inputs": { + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1708372533, + "narHash": "sha256-r6L+hXIzg+EGH9CHQ+nPMVAmvkMFIoeZBkg0zn+LuWk=", + "owner": "Guanran928", + "repo": "nvim", + "rev": "0bdb35d845bad9af4160ca04fe71b6a5e3c4723e", + "type": "github" + }, + "original": { + "owner": "Guanran928", + "repo": "nvim", + "type": "github" + } + }, "nix-darwin": { "inputs": { "nixpkgs": [ @@ -371,6 +394,7 @@ "home-manager": "home-manager", "impermanence": "impermanence", "lanzaboote": "lanzaboote", + "neovim": "neovim", "nix-darwin": "nix-darwin", "nix-gaming": "nix-gaming", "nixos-hardware": "nixos-hardware", diff --git a/flake.nix b/flake.nix index 9b14666..0905dd9 100755 --- a/flake.nix +++ b/flake.nix @@ -50,6 +50,11 @@ nixos-hardware = { url = "github:NixOS/nixos-hardware"; }; + neovim = { + url = "github:Guanran928/nvim"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-utils.follows = "flake-utils"; + }; sops-nix = { url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/home/applications/neovim/default.nix b/home/applications/neovim/default.nix index 8ac29a5..77b3165 100644 --- a/home/applications/neovim/default.nix +++ b/home/applications/neovim/default.nix @@ -1,15 +1,23 @@ -{pkgs, ...}: { - #home.packages = [pkgs.lunarvim]; - programs.neovim = { - enable = true; - #defaultEditor = true; - viAlias = true; - vimAlias = true; - }; - xdg.configFile."nvim".source = pkgs.fetchFromGitHub { - owner = "Guanran928"; - repo = "nvim"; - rev = "2a3a14de15d28f97dafea4be6e91df72d4a45e42"; - hash = "sha256-CFdRSYAC5FPPC45gc+vSYpSHfZL78Wf7IugA6pEASXE="; - }; +{ + pkgs, + inputs, + ... +}: { + home.packages = [ + inputs.neovim.packages.${pkgs.stdenv.hostPlatform.system}.default + #pkgs.lunarvim + + # stupid way to make {vi,vim}Alias work without a module + (pkgs.writeShellScriptBin "vi" ''nvim "$@"'') + (pkgs.writeShellScriptBin "vim" ''nvim "$@"'') + ]; + + # TODO: couldn't make it work + #programs.neovim = { + # enable = true; + # viAlias = true; + # vimAlias = true; + # + # package = inputs.neovim.packages.${pkgs.stdenv.hostPlatform.system}.default; + #}; }