Skip to content

Commit

Permalink
Merge branch 'main' into feat/bump-ibl
Browse files Browse the repository at this point in the history
  • Loading branch information
NotAShelf authored Nov 7, 2023
2 parents 5f6e092 + 84fc8eb commit 0a8d67b
Show file tree
Hide file tree
Showing 77 changed files with 1,348 additions and 332 deletions.
28 changes: 28 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = tab
indent_size = 4
insert_final_newline = true
tab_width = 4
trim_trailing_whitespace = true

[*.md]
indent_style = space
indent_size = 2
trim_trailing_whitespace = false

[*.{nix,yml,yaml}]
indent_style = space
indent_size = 2
tab_width = 2

[*.{diff,patch}]
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset

[*.lock]
indent_size = unset
64 changes: 48 additions & 16 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,51 +62,79 @@

### Using `nix` CLI

If you would like to try out the configuration before even thinking about installing it, you can run:
If you would like to try out the configuration before even thinking about installing it, you can run the following command

```console
nix run github:notashelf/neovim-flake
```

to get a feel for the base configuration. The package exposes `.#nix` as the default package. You may use `.#nix`, `.#tidal` or `.#maximal` to get different configurations.
This will get you a feel for the base configuration and UI design. The flake exposes `#nix` as the default package, providing minimal language support and various
utilities.You may also use `#nix`, `#tidal` or `#maximal` to get try out different configurations.

It is as simple as changing the target output to get a different configuration. For example, to get a configuration with `tidal` support, run:

```console
nix run github:notashelf/neovim-flake#tidal
```

Similar instructions will apply for `nix profile install`.
Similar instructions will apply for `nix profile install`. However, you are recommended to instead use the module system as described in the manual.

P.S. The `maximal` configuration is _massive_ and will take a while to build. To get a feel for the configuration, use the default `nix` or `tidal` configurations.
> [!NOTE]
> The `maximal` configuration is _massive_ and will take a while to build. To get a feel for the configuration, use the default `nix` or `tidal` configurations.
> Should you choose to try out the `maximal` configuration, using the binary cache as described in the manual is _strongly_ recommended.
### Docker

As of version 0.5, an image for the `nix` output is published to Dockerhub and GitHub packages with each tagged release. If you do not have Nix installed
on your system, you may run neovim within a container using your favorite tool.
The following command will open the current directory in neovim with necessary tools bootstrapped.

```console
docker run -v `pwd`:/home/neovim/demo --rm -it notashelf/neovim-flake:latest
```

The available registeres are `ghcr.io` and `dockerhub` for the time being. Adjust to your liking.

## Documentation

See the [neovim-flake Manual](https://notashelf.github.io/neovim-flake/) for detailed installation guide(s), configuration, available options, and release notes.
See the [neovim-flake Manual](https://notashelf.github.io/neovim-flake/) for detailed installation guides, configurations, available options, release notes
and more.

If you want to dive right into trying **neovim-flake** you can get a fully featured configuration with `nix` language support by running:
If you want to dive right into trying **neovim-flake** you can get a fully featured configuration with `nix`
language support by running:

```console
nix run github:notashelf/neovim-flake
```

Please create an issue on the [issue tracker](../../../issues) if you find the documentation lacking or confusing. I also appreciate any contributions to the documentation.
Please create an issue on the [issue tracker](../../../issues) if you find the documentation lacking or confusing.
I also appreciate any contributions to the documentation.

## Help

You can create an issue on the [issue tracker](../../../issues) to ask questions or report bugs. I am not yet on spaces like matrix or IRC, so please use the issue tracker for now.
You can create an issue on the [issue tracker](../../../issues) to ask questions or report bugs.
I am not yet on spaces like matrix or IRC, so please use the issue tracker for now.

## Contributing

I am always looking for new ways to help improve this flake. If you would like to contribute, please read the [contributing guide](CONTRIBUTING.md) before submitting a pull request. You can also create an issue on the [issue tracker](../../../issues) before submitting a pull request if you would like to discuss a feature or bug fix.
I am always looking for new ways to help improve this flake. If you would like to contribute, please read
the [contributing guide](CONTRIBUTING.md) before submitting a pull request. You can also create an
issue on the [issue tracker](../../../issues) before submitting a pull request if you would like to discuss
a feature or bug fix.

## Philosophy

The philosophy behind this flake configuration is to create an easily configurable and reproducible Neovim environment. While it does sacrifice in size
(which I know some users will find _disagreeable_), it offers a lot of flexibility and customizability in exchange for the large size of the flake inputs.
The KISS (Keep it simple, stupid) principle has been abandoned here, however, you _can_ ultimately leverage the flexibility of this flake to declare a configuration that follows KISS principles, it is very easy to bring your own plugins and configurations from non-nix. What this flake is meant to be does eventually fall into your hands. Whether you are a developer, writer, or live coder, you can quickly craft a config that suits every project's need. Think of it like a distributionof Neovim that takes advantage of pinning vim plugins and third party dependencies (such as tree-sitter grammars, language servers, and more).
The philosophy behind this flake configuration is to create an easily configurable and reproducible Neovim environment.
While it does sacrifice in size (which I know some users will find _disagreeable_), it offers a lot of flexibility and customizability in
exchange for the large size of the flake inputs. The "KISS" (Keep it simple, stupid) principle has mostly been abandoned here, however, you _can_
ultimately leverage the flexibility of this flake to declare a configuration that follows KISS principles, as it is very easy to bring your
own plugins and configurations from non-nix. What this flake is meant to be does eventually fall into your hands. Whether you are a
developer, writer, or live coder, you can quickly craft a config that suits every project's need. Think of it like a distribution of Neovim that you have
full control over. A distribution that takes advantage of pinning vim plugins and third party dependencies (such as tree-sitter grammars, language servers, and more).

One should never get a broken config when setting options. If setting multiple options results in a broken Neovim, file an issue! Each plugin knows when another plugin which allows for smart configuration of keybindings and automatic setup of things like completion sources and languages.
One should never get a broken config when setting options. If setting multiple options results in a broken Neovim, file an issue!
Each plugin knows when another plugin which allows for smart configuration of keybindings and automatic setup of things
like completion sources and languages.

## FAQ

Expand All @@ -119,17 +147,21 @@ instead of the `maximal` output. This will reduce size by a lot, but you will lo

**Q**: Will you try to make this flake smaller?
<br/>
**A**: Yes. As a matter of fact, I am actively working on making this flake smaller. Unfortunately the process of providing everything possible by itself makes the flake large. Best I can do is to optimize the flake as much as possible by selecting plugins that are small and fast. And the binary cache, so at least you don't have to build it from source.
**A**: Yes. As a matter of fact, I am actively working on making this flake smaller. Unfortunately the process of providing everything
possible by itself makes the flake large. Best I can do is to optimize the flake as much as possible by selecting plugins that
are small and fast. And the binary cache, so at least you don't have to build it from source.
<br/><br/>

**Q**: Will you use a plugin manager/language server installer?
<br/>
**A**: No. If you feel the need to ask that question, then you have missed the whole point of using nix and ultimately this flake. The whole reason we use nix is to be able to handle EVERYTHING declaratively, well including the LSP and plugin installations.
**A**: No. If you feel the need to ask that question, then you have missed the whole point of using nix and ultimately this flake.
The whole reason we use nix is to be able to handle EVERYTHING declaratively, well including the LSP and plugin installations.
<br/><br/>

**Q**: Can you add _X_?
<br/>
**A**: Maybe. Open an issue using the appropriate template and I will consider it. I do not intend to add _every plugin that is in existence_, but I will consider it, should it offer something useful to the flake.
**A**: Maybe. Open an issue using the appropriate template and I will consider it. I do not intend to
add _every plugin that is in existence_, but I will consider it, should it offer something useful to the flake.

## Credits

Expand Down
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 15
reviewers:
- NotAShelf
assignees:
- NotAShelf
14 changes: 5 additions & 9 deletions .github/workflows/cachix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- tidal
- maximal
steps:
- uses: easimon/maximize-build-space@v6
- uses: easimon/maximize-build-space@v8
name: Maximize build space
with:
overprovision-lvm: true
Expand All @@ -31,16 +31,12 @@ jobs:
remove-haskell: true
remove-codeql: true

- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: Checkout

- uses: cachix/install-nix-action@v20
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
auto-optimise-store = true
experimental-features = nix-command flakes
nix_path: nixpkgs=channel:nixos-unstable
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main

- uses: cachix/cachix-action@v12
with:
Expand Down
19 changes: 6 additions & 13 deletions .github/workflows/check-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,24 @@ jobs:
- docs-manpages
- docs-json
steps:
- uses: easimon/maximize-build-space@v6
- uses: easimon/maximize-build-space@v8
with:
overprovision-lvm: true
remove-android: true
remove-dotnet: true
remove-haskell: true

- uses: cachix/install-nix-action@v20
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
auto-optimise-store = true
experimental-features = nix-command flakes
nix_path: nixpkgs=channel:nixos-unstable
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main

- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: Checkout

- name: Set default git branch (to reduce log spam)
run: git config --global init.defaultBranch main

- name: Validate Flake
run: nix flake check

- name: Build neovim-flake with default settings
- name: Build documentation packages
run: nix build .#${{ matrix.package }} --print-build-logs

- name: Upload doc artifacts
Expand Down
29 changes: 16 additions & 13 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,25 @@ jobs:
name: Validate Flake
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- run: nix flake check
- name: Checkout
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main

- name: Check Flake
run: nix flake check

format-with-alejandra:
name: Formatting via Alejandra
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
with:
install_url: https://nixos.org/nix/install
extra_nix_config: |
auto-optimise-store = true
experimental-features = nix-command flakes
- name: Checkout
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main

- run: nix run nixpkgs#alejandra -- -c .
50 changes: 50 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "Publish Docker Image"
on:
workflow_dispatch:
push:
tags: ["v*"]

jobs:
build-docker-image:
name: "Build Docker Image"
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@main

- name: Build Docker Image
run: nix build .#docker-nix --print-build-logs

- name: Load & Tag Built Docker Image
run: |
docker load -i result &&
docker tag neovim-flake:latest notashelf/neovim-flake:latest
- name: Log into DockerHub
uses: docker/login-action@master
with:
username: notashelf
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}

- name: Push to DockerHub
run: docker push notashelf/neovim-flake:latest

- name: Log into ghcr
uses: docker/login-action@master
with:
registry: "ghcr.io"
username: "${{ github.actor }}"
password: "${{ secrets.GITHUB_TOKEN }}"

- name: Publish Docker Image (Github Packages)
run: docker push notashelf/neovim-flake:latest
47 changes: 47 additions & 0 deletions .github/workflows/editorconfig.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "Check validity of .editorconfig"

permissions: read-all

on:
pull_request:

jobs:
check-editorconfig:
runs-on: ubuntu-latest
if: "!contains(github.event.pull_request.title, '[skip ci]')"
steps:
- name: Get list of changed files from PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api \
repos/notashelf/neovim-flake/pulls/${{github.event.number}}/files --paginate \
| jq '.[] | select(.status != "removed") | .filename' \
> "$HOME/changed_files"
- name: Print list of changed files
run: |
cat "$HOME/changed_files"
- name: Checkout
uses: actions/checkout@v4
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main

- name: Checking EditorConfig
shell: bash
run: |
cat "$HOME/changed_files" | nix-shell -p editorconfig-checker.out --run 'xargs -r editorconfig-checker -disable-indentation -exclude flake.lock --verbose'
echo -n "Check status: $?"
- name: Fail Gracefully
if: ${{ failure() }}
shell: bash
run: |
echo "::error:: Current formatting does not fit convention provided by .editorconfig located in the project root."
echo "Please make sure your editor properly integrates editorconfig. See https://editorconfig.org/#download for more."
exit 1
5 changes: 3 additions & 2 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Nix
uses: cachix/install-nix-action@v18
uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main

- name: Build
run: |
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,3 @@ result/
# Ignore log files generated by my debuggers
*.log
*.log.*

#
Loading

0 comments on commit 0a8d67b

Please sign in to comment.