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" "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": { "nix-darwin": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -371,6 +394,7 @@
"home-manager": "home-manager", "home-manager": "home-manager",
"impermanence": "impermanence", "impermanence": "impermanence",
"lanzaboote": "lanzaboote", "lanzaboote": "lanzaboote",
"neovim": "neovim",
"nix-darwin": "nix-darwin", "nix-darwin": "nix-darwin",
"nix-gaming": "nix-gaming", "nix-gaming": "nix-gaming",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",

View file

@ -50,6 +50,11 @@
nixos-hardware = { nixos-hardware = {
url = "github:NixOS/nixos-hardware"; url = "github:NixOS/nixos-hardware";
}; };
neovim = {
url = "github:Guanran928/nvim";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
sops-nix = { sops-nix = {
url = "github:Mic92/sops-nix"; url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";

View file

@ -1,15 +1,23 @@
{pkgs, ...}: { {
#home.packages = [pkgs.lunarvim]; pkgs,
programs.neovim = { inputs,
enable = true; ...
#defaultEditor = true; }: {
viAlias = true; home.packages = [
vimAlias = true; inputs.neovim.packages.${pkgs.stdenv.hostPlatform.system}.default
}; #pkgs.lunarvim
xdg.configFile."nvim".source = pkgs.fetchFromGitHub {
owner = "Guanran928"; # stupid way to make {vi,vim}Alias work without a module
repo = "nvim"; (pkgs.writeShellScriptBin "vi" ''nvim "$@"'')
rev = "2a3a14de15d28f97dafea4be6e91df72d4a45e42"; (pkgs.writeShellScriptBin "vim" ''nvim "$@"'')
hash = "sha256-CFdRSYAC5FPPC45gc+vSYpSHfZL78Wf7IugA6pEASXE="; ];
};
# TODO: couldn't make it work
#programs.neovim = {
# enable = true;
# viAlias = true;
# vimAlias = true;
#
# package = inputs.neovim.packages.${pkgs.stdenv.hostPlatform.system}.default;
#};
} }