home/neovim: use flake interface

This commit is contained in:
Guanran Wang 2024-02-20 04:15:22 +08:00
parent 4bab4950a9
commit 01b2d106a0
Signed by: nyancat
SSH key fingerprint: SHA256:8oWGKciPALWut/6WA27oFKofX+6Wtc0gQnsefXLQx/8
3 changed files with 51 additions and 14 deletions

View file

@ -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",

View file

@ -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";

View file

@ -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;
#};
}