Skip to content

Commit d7cfc0c

Browse files
committed
refactor!: Convert to nixvim
1 parent 7058c8c commit d7cfc0c

85 files changed

Lines changed: 892 additions & 332 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @dotunwrap

.github/workflows/ci.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
9+
push:
10+
branches:
11+
- main
12+
13+
jobs:
14+
generate_matrix:
15+
name: Generate matrix
16+
runs-on: ubuntu-latest
17+
outputs:
18+
checks: ${{ steps.gen_checks.outputs.checks }}
19+
steps:
20+
- name: Clone repository
21+
uses: actions/checkout@v5
22+
- name: Install Nix
23+
uses: cachix/install-nix-action@v31
24+
with:
25+
extra_nix_config: |
26+
auto-optimise-store = true
27+
experimental-features = nix-command flakes
28+
substituters = https://cache.nixos.org/ https://nix-community.cachix.org/
29+
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
30+
allow-import-from-derivation = true
31+
install_url: https://releases.nixos.org/nix/nix-2.28.0/install
32+
- name: Generate flake.json
33+
run: |
34+
nix flake show --json --allow-import-from-derivation > flake.json
35+
- id: gen_checks
36+
name: Generate checks
37+
run: |
38+
systems=("x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin")
39+
declare -A runners=( ["x86_64-linux"]="ubuntu-latest" ["aarch64-linux"]="ubuntu-latest" ["x86_64-darwin"]="macos-13" ["aarch64-darwin"]="macos-14" )
40+
matrix="[]"
41+
for sys in "${systems[@]}"; do
42+
checks=$(jq -c ".checks.\"$sys\" | keys[]" < flake.json 2>/dev/null || echo "[]")
43+
for check in $(echo "$checks" | jq -r '.[]'); do
44+
runner="${runners[$sys]}"
45+
matrix=$(echo "$matrix" | jq ". + [{\"system\": \"$sys\", \"check\": \"$check\", \"runner\": \"$runner\"}]")
46+
done
47+
done
48+
printf "checks=%s" "$matrix" >> $GITHUB_OUTPUT
49+
50+
build_checks:
51+
name: Build checks
52+
runs-on: ${{ matrix.check.runner }}
53+
needs:
54+
- generate_matrix
55+
strategy:
56+
fail-fast: false
57+
max-parallel: 5
58+
matrix:
59+
check: ${{fromJson(needs.generate_matrix.outputs.checks)}}
60+
steps:
61+
- name: Clone repository
62+
uses: actions/checkout@v5
63+
- name: Install nix
64+
uses: cachix/install-nix-action@v31
65+
with:
66+
extra_nix_config: |
67+
auto-optimise-store = true
68+
experimental-features = nix-command flakes
69+
substituters = https://cache.nixos.org/ https://nix-community.cachix.org
70+
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
71+
allow-import-from-derivation = true
72+
install_url: https://releases.nixos.org/nix/nix-2.28.0/install
73+
- name: Setup cachix
74+
uses: cachix/cachix-action@v15
75+
with:
76+
name: your-cachix-name # Replace with your cachix name
77+
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
78+
- name: Build everything
79+
run: nix build .#checks.${{ matrix.check.system }}.${{ matrix.check.check }} --no-link
80+
81+
check_flake:
82+
name: Check flake
83+
runs-on: ubuntu-latest
84+
needs:
85+
- generate_matrix
86+
continue-on-error: true
87+
steps:
88+
- name: Clone repository
89+
uses: actions/checkout@v5
90+
- name: Install nix
91+
uses: cachix/install-nix-action@v31
92+
with:
93+
extra_nix_config: |
94+
auto-optimise-store = true
95+
experimental-features = nix-command flakes
96+
substituters = https://cache.nixos.org/ https://nix-community.cachix.org
97+
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
98+
allow-import-from-derivation = true
99+
install_url: https://releases.nixos.org/nix/nix-2.28.0/install
100+
- name: Run checks
101+
run: |
102+
nix flake check --keep-going --allow-import-from-derivation

.github/workflows/release.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Release init.lua
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: Release version (semantic)
7+
required: true
8+
type: string
9+
branch:
10+
description: Branch to base the release on (e.g. main)
11+
required: true
12+
type: string
13+
default: main
14+
permissions:
15+
contents: write
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout repo
21+
uses: actions/checkout@v5
22+
with:
23+
ref: ${{ inputs.branch }}
24+
- name: Install nix
25+
uses: cachix/install-nix-action@v31
26+
with:
27+
extra_nix_config: |
28+
auto-optimise-store = true
29+
experimental-features = nix-command flakes
30+
substituters = https://cache.nixos.org/ https://nix-community.cachix.org/
31+
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
32+
install_url: https://releases.nixos.org/nix/nix-2.28.0/install
33+
- name: Build init.lua
34+
run: nix build .#initLua
35+
- name: Upload artifact
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: determinvim-${{ inputs.version }}
39+
path: ./result
40+
- name: Create and push tag
41+
run: |
42+
git config --global user.name 'github-actions[bot]'
43+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
44+
git checkout ${{ inputs.branch }}
45+
git tag ${{ inputs.version }}
46+
git push origin ${{ inputs.version }}
47+
- name: Create release
48+
run: |
49+
gh release create ${{ inputs.version }} \
50+
--title "v${{ inputs.version }}" \
51+
--generate-notes \
52+
./result
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
result
2+
3+
.direnv/

LICENSE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2+
Version 2, December 2004
3+
4+
Copyright (C) 2025 Gabriella Simpson <gabby@dotunwrap.dev>
5+
6+
Everyone is permitted to copy and distribute verbatim or modified
7+
copies of this license document, and changing it is allowed as long
8+
as the name is changed.
9+
10+
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12+
13+
0. You just DO WHAT THE FUCK YOU WANT TO.

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
1-
# .unwrap's nvf config
1+
<div align = center>
22

3-
This is a WIP [nvf](https://github.com/notashelf/nvf) configuration.
3+
# determinvim
44

5-
nvf is a framework for structuring your Neovim configuration using Nix.
5+
[![Badge CI]][CI]
6+
![Badge Nix]
7+
![Badge X]
8+
9+
</div>
10+
11+
This is a WIP Neovim configuration using [Nixvim](https://github.com/nix-community/nixvim). It's in a barely usable state at the moment.
12+
13+
[CI]: https://github.com/dotunwrap/determinvim/actions/workflows/ci.yml
14+
15+
[Badge CI]: https://github.com/dotunwrap/determinvim/actions/workflows/ci.yml/badge.svg
16+
[Badge Nix]: https://img.shields.io/badge/-nix_btw-75afd7?logo=nixos&logoColor=CAD3F5&labelColor=24273A
17+
[Badge X]: https://img.shields.io/twitter/follow/dotunwrap

binds/default.nix

Lines changed: 0 additions & 6 deletions
This file was deleted.

checks/default.nix

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
inputs,
3+
system,
4+
nixvimModule,
5+
}:
6+
let
7+
pkgs = inputs.nixpkgs.legacyPackages.${system};
8+
callPackage = pkgs.lib.callPackageWith (pkgs // { inherit (inputs) self; });
9+
in
10+
{
11+
nixfmt = callPackage ./nixfmt.nix { };
12+
nixvim = callPackage ./nixvim.nix {
13+
inherit (inputs) nixvim;
14+
inherit nixvimModule system;
15+
};
16+
}

checks/nixfmt.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
runCommand,
3+
nixfmt,
4+
self,
5+
}:
6+
runCommand "check-nixfmt-${self.rev or "dirty"}" { } ''
7+
${nixfmt}/bin/nixfmt --check ${self} < /dev/null | tee $out
8+
''

0 commit comments

Comments
 (0)