Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @dotunwrap
102 changes: 102 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: CI

on:
pull_request:
types:
- opened
- synchronize
- reopened
push:
branches:
- main

jobs:
generate_matrix:
name: Generate matrix
runs-on: ubuntu-latest
outputs:
checks: ${{ steps.gen_checks.outputs.checks }}
steps:
- name: Clone repository
uses: actions/checkout@v5
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
auto-optimise-store = true
experimental-features = nix-command flakes
substituters = https://cache.nixos.org/ https://nix-community.cachix.org/
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
allow-import-from-derivation = true
install_url: https://releases.nixos.org/nix/nix-2.28.0/install
- name: Generate flake.json
run: |
nix flake show --json --allow-import-from-derivation > flake.json
- id: gen_checks
name: Generate checks
run: |
systems=("x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin")
declare -A runners=( ["x86_64-linux"]="ubuntu-latest" ["aarch64-linux"]="ubuntu-latest" ["x86_64-darwin"]="macos-13" ["aarch64-darwin"]="macos-14" )
matrix="[]"
for sys in "${systems[@]}"; do
checks=$(jq -c ".checks.\"$sys\" | keys[]" < flake.json 2>/dev/null || echo "[]")
for check in $(echo "$checks" | jq -r '.[]'); do
runner="${runners[$sys]}"
matrix=$(echo "$matrix" | jq ". + [{\"system\": \"$sys\", \"check\": \"$check\", \"runner\": \"$runner\"}]")
done
done
printf "checks=%s" "$matrix" >> $GITHUB_OUTPUT

build_checks:
name: Build checks
runs-on: ${{ matrix.check.runner }}
needs:
- generate_matrix
strategy:
fail-fast: false
max-parallel: 5
matrix:
check: ${{fromJson(needs.generate_matrix.outputs.checks)}}
steps:
- name: Clone repository
uses: actions/checkout@v5
- name: Install nix
uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
auto-optimise-store = true
experimental-features = nix-command flakes
substituters = https://cache.nixos.org/ https://nix-community.cachix.org
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
allow-import-from-derivation = true
install_url: https://releases.nixos.org/nix/nix-2.28.0/install
- name: Setup cachix
uses: cachix/cachix-action@v15
with:
name: your-cachix-name # Replace with your cachix name
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Build everything
run: nix build .#checks.${{ matrix.check.system }}.${{ matrix.check.check }} --no-link

check_flake:
name: Check flake
runs-on: ubuntu-latest
needs:
- generate_matrix
continue-on-error: true
steps:
- name: Clone repository
uses: actions/checkout@v5
- name: Install nix
uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
auto-optimise-store = true
experimental-features = nix-command flakes
substituters = https://cache.nixos.org/ https://nix-community.cachix.org
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
allow-import-from-derivation = true
install_url: https://releases.nixos.org/nix/nix-2.28.0/install
- name: Run checks
run: |
nix flake check --keep-going --allow-import-from-derivation
54 changes: 54 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Release init.lua
on:
workflow_dispatch:
inputs:
version:
description: Release version (semantic)
required: true
type: string
branch:
description: Branch to base the release on (e.g. main)
required: true
type: string
default: main
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v5
with:
ref: ${{ inputs.branch }}
- name: Install nix
uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
auto-optimise-store = true
experimental-features = nix-command flakes
substituters = https://cache.nixos.org/ https://nix-community.cachix.org/
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
install_url: https://releases.nixos.org/nix/nix-2.28.0/install
- name: Build init.lua
run: nix build .#initLua
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: determinvim-${{ inputs.version }}
path: ./result
- name: Create and push tag
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git checkout ${{ inputs.branch }}
git tag ${{ inputs.version }}
git push origin ${{ inputs.version }}
- name: Create release
run: |
gh release create ${{ inputs.version }} \
--title "v${{ inputs.version }}" \
--generate-notes \
./result
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
result

.direnv/
13 changes: 13 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (C) 2025 Gabriella Simpson <gabby@dotunwrap.dev>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# .unwrap's nvf config
<div align = center>

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

nvf is a framework for structuring your Neovim configuration using Nix.
[![Badge CI]][CI]
![Badge Nix]
![Badge X]

</div>

This is a WIP Neovim configuration using [Nixvim](https://github.com/nix-community/nixvim). It's in a barely usable state at the moment.

[CI]: https://github.com/dotunwrap/determinvim/actions/workflows/ci.yml

[Badge CI]: https://github.com/dotunwrap/determinvim/actions/workflows/ci.yml/badge.svg
[Badge Nix]: https://img.shields.io/badge/-nix_btw-75afd7?logo=nixos&logoColor=CAD3F5&labelColor=24273A
[Badge X]: https://img.shields.io/twitter/follow/dotunwrap
6 changes: 0 additions & 6 deletions binds/default.nix

This file was deleted.

11 changes: 11 additions & 0 deletions checks/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
inputs,
system,
}:
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
callPackage = pkgs.lib.callPackageWith (pkgs // { inherit (inputs) self; });
in
{
nixfmt = callPackage ./nixfmt.nix { };
}
8 changes: 8 additions & 0 deletions checks/nixfmt.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
runCommand,
nixfmt,
self,
}:
runCommand "check-nixfmt-${self.rev or "dirty"}" { } ''
${nixfmt}/bin/nixfmt --check ${self} < /dev/null | tee $out
''
3 changes: 0 additions & 3 deletions clipboard.nix

This file was deleted.

17 changes: 17 additions & 0 deletions config/autocmd.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ lib, ... }:
let
inherit (lib.nixvim) mkRaw;
in
{
autoCmd = [
{
desc = "Highlight on yank";
event = [ "TextYankPost" ];
callback = mkRaw ''
function()
vim.highlight.on_yank()
end
'';
}
];
}
14 changes: 14 additions & 0 deletions config/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
imports = [
./globals.nix
./options.nix
./keymaps.nix
./autocmd.nix
./plugins
./langs
];

luaLoader.enable = true;
viAlias = true;
vimAlias = true;
}
2 changes: 1 addition & 1 deletion globals.nix → config/globals.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
config.vim.globals = {
globals = {
mapleader = " ";
maplocalleader = " ";
have_nerd_font = true;
Expand Down
10 changes: 10 additions & 0 deletions config/keymaps.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{ utils, ... }:
let
inherit (utils.keymaps) mkKeymap;
in
{
keymaps = [
(mkKeymap "v" "<Tab>" ">gv" "Indent selection right")
(mkKeymap "v" "<S-Tab>" "<gv" "Indent selection left")
];
}
6 changes: 6 additions & 0 deletions config/langs/astro.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
plugins = {
lsp.servers.astro.enable = true;
treesitter.settings.ensure_installed = [ "astro" ];
};
}
6 changes: 6 additions & 0 deletions config/langs/bash.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
plugins = {
lsp.servers.bashls.enable = true;
treesitter.settings.ensure_installed = [ "bash" ];
};
}
6 changes: 6 additions & 0 deletions config/langs/css.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
plugins = {
lsp.servers.cssls.enable = true;
treesitter.settings.ensure_installed = [ "css" ];
};
}
9 changes: 9 additions & 0 deletions config/langs/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{ lib, ... }:
{
imports =
with builtins;
with lib;
map (fn: ./${fn}) (
filter (fn: (fn != "default.nix" && hasSuffix ".nix" "${fn}")) (attrNames (readDir ./.))
);
}
6 changes: 6 additions & 0 deletions config/langs/go.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
plugins = {
lsp.servers.gopls.enable = true;
treesitter.settings.ensure_installed = [ "go" ];
};
}
6 changes: 6 additions & 0 deletions config/langs/html.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
plugins = {
lsp.servers.html.enable = true;
treesitter.settings.ensure_installed = [ "html" ];
};
}
9 changes: 9 additions & 0 deletions config/langs/json.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
plugins = {
lsp.servers.jsonls.enable = true;
treesitter.settings.ensure_installed = [
"json"
"jsonc"
];
};
}
6 changes: 6 additions & 0 deletions config/langs/just.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
plugins = {
lsp.servers.just.enable = true;
treesitter.settings.ensure_installed = [ "just" ];
};
}
6 changes: 6 additions & 0 deletions config/langs/lua.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
plugins = {
lsp.servers.lua_ls.enable = true;
treesitter.settings.ensure_installed = [ "lua" ];
};
}
6 changes: 6 additions & 0 deletions config/langs/markdown.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
plugins = {
lsp.servers.marksman.enable = true;
treesitter.settings.ensure_installed = [ "markdown" ];
};
}
11 changes: 11 additions & 0 deletions config/langs/nix.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
plugins = {
lsp.servers = {
nil_ls = {
enable = true;
};
statix.enable = true;
};
treesitter.settings.ensure_installed = [ "nix" ];
};
}
15 changes: 15 additions & 0 deletions config/langs/python.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
plugins = {
lsp.servers = {
ruff.enable = true;
pyright = {
enable = true;
settings = {
pyright.disableOrganizeImports = true;
python.analysis.ignore = [ "*" ];
};
};
};
treesitter.settings.ensure_installed = [ "python" ];
};
}
7 changes: 7 additions & 0 deletions config/langs/rust.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
plugins = {
rustaceanvim.enable = true;
crates.enable = true;
treesitter.settings.ensure_installed = [ "rust" ];
};
}
Loading