readme: fix & simplify simple flake example

This commit is contained in:
elyth 2025-04-06 16:59:04 +02:00 committed by Gaétan Lepage
parent 99a2f96cf0
commit 797c075db2

View file

@ -203,38 +203,39 @@ can use the following:
{ {
description = "A very basic flake"; description = "A very basic flake";
inputs.nixvim.url = "github:nix-community/nixvim"; inputs = {
nixpkgs.follows = "nixvim/nixpkgs";
nixvim.url = "github:nix-community/nixvim";
};
outputs = { outputs =
self, { nixpkgs, nixvim, ... }:
nixvim, let
flake-parts,
} @ inputs: let
config = { config = {
colorschemes.gruvbox.enable = true; colorschemes.gruvbox.enable = true;
}; };
in
flake-parts.lib.mkFlake {inherit inputs;} {
systems = [ systems = [
"aarch64-darwin" "x86_64-linux"
"aarch64-linux" "aarch64-linux"
"x86_64-darwin" "x86_64-darwin"
"x86_64-linux" "aarch64-darwin"
]; ];
perSystem = { forAllSystems = nixpkgs.lib.genAttrs systems;
pkgs, in
system, {
... packages = forAllSystems (
}: let system:
nixvim' = nixvim.legacyPackages."${system}"; let
nixvim' = nixvim.legacyPackages.${system};
nvim = nixvim'.makeNixvim config; nvim = nixvim'.makeNixvim config;
in { in
packages = { {
inherit nvim; inherit nvim;
default = nvim; default = nvim;
}; }
}; );
}; };
} }
``` ```