Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

doc: fix simple flake example #3083

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 26 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be better for us to suggest users use nixpkgs.follows = "nixvim/nixpkgs", at least for a flake that is just outputting nixvim packages and not also nixos configurations (etc):

Suggested change
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixpkgs.follows = "nixvim/nixpkgs";

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
forAllSystems = fn: nixpkgs.lib.genAttrs systems fn;
forAllSystems = nixpkgs.lib.genAttrs systems;

in
{
packages = forAllSystems (
system:
let
nixvim' = nixvim.legacyPackages.${system};
nvim = nixvim'.makeNixvim config;
in
{
inherit nvim;
default = nvim;
};
};
}
);
};
}
```
Expand Down