From 574855e0f2f9e975d7e42918429318d99c799e0b Mon Sep 17 00:00:00 2001 From: elythh <gwenchlan@tuta.io> Date: Wed, 19 Mar 2025 17:18:30 +0100 Subject: [PATCH] doc: fix simple flake example --- README.md | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 85fe08c27d..2dd862a1c9 100644 --- a/README.md +++ b/README.md @@ -201,40 +201,41 @@ can use the following: ```nix { - description = "A very basic flake"; + description = "A nixvim configuration"; - inputs.nixvim.url = "github:nix-community/nixvim"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + nixvim.url = "github:nix-community/nixvim"; + }; + + outputs = + { nixpkgs, nixvim, ... }: + let + config = { + colorschemes.gruvbox.enable = true; + }; - outputs = { - self, - nixvim, - flake-parts, - } @ inputs: let - config = { - colorschemes.gruvbox.enable = true; - }; - in - flake-parts.lib.mkFlake {inherit inputs;} { systems = [ - "aarch64-darwin" + "x86_64-linux" "aarch64-linux" "x86_64-darwin" - "x86_64-linux" + "aarch64-darwin" ]; - perSystem = { - pkgs, - system, - ... - }: let - nixvim' = nixvim.legacyPackages."${system}"; - nvim = nixvim'.makeNixvim config; - in { - packages = { + forAllSystems = fn: nixpkgs.lib.genAttrs systems fn; + in + { + packages = forAllSystems ( + system: + let + nixvim' = nixvim.legacyPackages.${system}; + nvim = nixvim'.makeNixvim config; + in + { inherit nvim; default = nvim; - }; - }; + } + ); }; } ```