Compare commits
No commits in common. "main" and "testing" have entirely different histories.
8 changed files with 124 additions and 176 deletions
24
.github/workflows/check.yml
vendored
24
.github/workflows/check.yml
vendored
|
@ -11,9 +11,13 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install nix
|
||||
uses: https://github.com/DeterminateSystems/nix-installer-action@main
|
||||
uses: DeterminateSystems/nix-installer-action@main
|
||||
- name: Setup Action cache for nix
|
||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
with:
|
||||
fail-mode: true
|
||||
- name: Check Nix flake inputs
|
||||
uses: https://github.com/DeterminateSystems/flake-checker-action@v4 # This action
|
||||
uses: DeterminateSystems/flake-checker-action@v4 # This action
|
||||
- name: Run nix fmt
|
||||
run: nix fmt -- --check .
|
||||
|
||||
|
@ -22,9 +26,13 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install nix
|
||||
uses: https://github.com/DeterminateSystems/nix-installer-action@main
|
||||
uses: DeterminateSystems/nix-installer-action@main
|
||||
- name: Setup Action cache for nix
|
||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
with:
|
||||
fail-mode: true
|
||||
- name: Check Nix flake inputs
|
||||
uses: https://github.com/DeterminateSystems/flake-checker-action@v4 # This action
|
||||
uses: DeterminateSystems/flake-checker-action@v4 # This action
|
||||
- name: Run nix flake check
|
||||
run: nix flake check
|
||||
|
||||
|
@ -33,8 +41,12 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install nix
|
||||
uses: https://github.com/DeterminateSystems/nix-installer-action@main
|
||||
uses: DeterminateSystems/nix-installer-action@main
|
||||
- name: Setup Action cache for nix
|
||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
with:
|
||||
fail-mode: true
|
||||
- name: Check Nix flake inputs
|
||||
uses: https://github.com/DeterminateSystems/flake-checker-action@v4 # This action
|
||||
uses: DeterminateSystems/flake-checker-action@v4 # This action
|
||||
- name: Build nvim
|
||||
run: nix build .\#default
|
||||
|
|
82
.github/workflows/update.yml
vendored
82
.github/workflows/update.yml
vendored
|
@ -2,7 +2,7 @@ name: Update `flake.lock`
|
|||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 0 * * 6' # runs weekly on Saturday at 00:00
|
||||
- cron: '0 0 * * 0' # runs weekly on Sunday at 00:00
|
||||
|
||||
jobs:
|
||||
update_lockfile:
|
||||
|
@ -11,72 +11,20 @@ jobs:
|
|||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Install nix
|
||||
uses: https://github.com/DeterminateSystems/nix-installer-action@main
|
||||
|
||||
uses: DeterminateSystems/nix-installer-action@main
|
||||
- name: Setup Action cache for nix
|
||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
with:
|
||||
fail-mode: true
|
||||
- name: Update flake.lock
|
||||
id: update
|
||||
run: |
|
||||
nix flake update 2> >(tee /dev/stderr) | awk '
|
||||
/^• Updated input/ {in_update = 1; print; next}
|
||||
in_update && !/^warning:/ {print}
|
||||
/^$/ {in_update = 0}
|
||||
' > update.log
|
||||
|
||||
echo "UPDATE_LOG<<EOF" >> $GITHUB_ENV
|
||||
cat update.log >> $GITHUB_ENV
|
||||
echo "EOF" >> $GITHUB_ENV
|
||||
|
||||
rm update.log
|
||||
|
||||
- name: Write PR body template
|
||||
uses: https://github.com/DamianReeves/write-file-action@v1.3
|
||||
uses: DeterminateSystems/update-flake-lock@main
|
||||
with:
|
||||
path: pr_body.template
|
||||
contents: |
|
||||
- The following Nix Flake inputs were updated:
|
||||
|
||||
```
|
||||
${{ env.UPDATE_LOG }}
|
||||
```
|
||||
|
||||
Auto-generated by [update.yml][1] with the help of
|
||||
[create-pull-request][2].
|
||||
|
||||
[1]: https://forgejo.stefka.eu/jiriks74/nix.nvim/src/branch/main/.github/workflows/update.yml
|
||||
[2]: https://forgejo.stefka.eu/jiriks74/create-pull-request
|
||||
|
||||
- name: Generate PR body
|
||||
uses: pedrolamas/handlebars-action@v2.4.0 # v2.4.0
|
||||
with:
|
||||
files: "pr_body.template"
|
||||
output-filename: "pr_body.md"
|
||||
- name: Save PR body
|
||||
id: pr_body
|
||||
uses: juliangruber/read-file-action@v1
|
||||
with:
|
||||
path: "pr_body.md"
|
||||
|
||||
- name: Remove temporary files
|
||||
run: |
|
||||
rm pr_body.template
|
||||
rm pr_body.md
|
||||
|
||||
- name: Create Pull Request
|
||||
id: create-pull-request
|
||||
uses: https://forgejo.stefka.eu/jiriks74/create-pull-request@7174d368c2e4450dea17b297819eb28ae93ee645
|
||||
with:
|
||||
token: ${{ secrets.FORGEJO_TOKEN_FOR_UPDATES }}
|
||||
body: ${{ steps.pr_body.outputs.content }}
|
||||
author: '"github-actions[bot]" <github-actions[bot]@users.noreply.github.com>'
|
||||
title: 'automated: Update `flake.lock`'
|
||||
commit-message: |
|
||||
automated: Update `flake.lock`
|
||||
|
||||
${{ steps.pr_body.outputs.content }}
|
||||
|
||||
branch: update-flake-lock
|
||||
delete-branch: true
|
||||
# inputs: dzgui dzgui-testing # We'll see whether I want to limit the updates to dzgui
|
||||
token: ${{ secrets.GH_TOKEN_FOR_UPDATES }}
|
||||
pr-title: "Update flake.lock"
|
||||
pr-assignees: jiriks74
|
||||
pr-labels: |
|
||||
flake.lock
|
||||
automated
|
||||
- name: Print PR number
|
||||
run: |
|
||||
echo "Pull request number is ${{ steps.create-pull-request.outputs.pull-request-number }}."
|
||||
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
|
||||
run: echo Pull request number is ${{ steps.update.outputs.pull-request-number }}.
|
||||
|
|
50
flake.lock
generated
50
flake.lock
generated
|
@ -34,6 +34,24 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gen-luarc": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts",
|
||||
|
@ -163,11 +181,11 @@
|
|||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1749285348,
|
||||
"narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=",
|
||||
"lastModified": 1732521221,
|
||||
"narHash": "sha256-2ThgXBUXAE1oFsVATK1ZX9IjPcS4nKFOAjhPNKuiMn0=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "3e3afe5174c561dee0df6f2c2b2236990146329f",
|
||||
"rev": "4633a7c72337ea8fd23a4f2ba3972865e3ec685d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -180,11 +198,11 @@
|
|||
"presence-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1734057239,
|
||||
"lastModified": 1728312592,
|
||||
"narHash": "sha256-NuoXsCOA5Uz7XOtC5B1pIXLytLaod6wUzrE+m5uEHcs=",
|
||||
"owner": "jiriks74",
|
||||
"repo": "presence.nvim",
|
||||
"rev": "c850b9e245f310e040478ab54808c7ce098919ed",
|
||||
"rev": "df0a0b52cd0799e99d1b76805d1357ae9c0d017d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -195,20 +213,36 @@
|
|||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"gen-luarc": "gen-luarc",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"presence-nvim": "presence-nvim",
|
||||
"workspace-diagnostics-nvim": "workspace-diagnostics-nvim"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"workspace-diagnostics-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1748191681,
|
||||
"narHash": "sha256-jSpKaKnGyip/nzqU52ypWLgoCtvccYN+qb5jzlwAnd4=",
|
||||
"lastModified": 1723294887,
|
||||
"narHash": "sha256-lBj4KUPmmhtpffYky/HpaTwY++d/Q9socp/Ys+4VeX0=",
|
||||
"owner": "artemave",
|
||||
"repo": "workspace-diagnostics.nvim",
|
||||
"rev": "60f9175b2501ae3f8b1aba9719c0df8827610c8e",
|
||||
"rev": "573ff93c47898967efdfbc6587a1a39e3c2d365e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
92
flake.nix
92
flake.nix
|
@ -3,6 +3,7 @@
|
|||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
gen-luarc.url = "github:mrcjkb/nix-gen-luarc-json";
|
||||
|
||||
# Add bleeding-edge plugins here.
|
||||
|
@ -24,6 +25,7 @@
|
|||
outputs = inputs @ {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
gen-luarc,
|
||||
...
|
||||
}: let
|
||||
|
@ -34,59 +36,51 @@
|
|||
"aarch64-darwin"
|
||||
];
|
||||
|
||||
# This is where the Neovim derivation is built.
|
||||
neovim-overlay = import ./nix/neovim-overlay.nix {inherit inputs;};
|
||||
inherit (self) outputs;
|
||||
# This is a function that generates an attribute by calling a function you
|
||||
# pass to it, with each system as an argument
|
||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||
in
|
||||
{
|
||||
formatter = forAllSystems(system: nixpkgs.legacyPackages.${system}.alejandra);
|
||||
|
||||
overlays = {
|
||||
neovim-overlay = import ./nix/neovim-overlay.nix {inherit inputs;};
|
||||
# You can add this overlay to your NixOS configuration
|
||||
default = self.outputs.overlays.neovim-overlay;
|
||||
flake-utils.lib.eachSystem supportedSystems (system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [
|
||||
# Import the overlay, so that the final Neovim derivation(s) can be accessed via pkgs.<nvim-pkg>
|
||||
neovim-overlay
|
||||
# This adds a function can be used to generate a .luarc.json
|
||||
# containing the Neovim API all plugins in the workspace directory.
|
||||
# The generated file can be symlinked in the devShell's shellHook.
|
||||
gen-luarc.overlays.default
|
||||
];
|
||||
};
|
||||
|
||||
packages = forAllSystems (system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ self.outputs.overlays.neovim-overlay ];
|
||||
};
|
||||
in {
|
||||
nvim-pkg = pkgs.nvim-pkg;
|
||||
default = self.outputs.packages.${system}.nvim-pkg;
|
||||
}
|
||||
);
|
||||
|
||||
devShells = forAllSystems (system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [
|
||||
self.outputs.overlays.neovim-overlay
|
||||
gen-luarc.overlays.default
|
||||
];
|
||||
};
|
||||
in {
|
||||
default = pkgs.mkShell {
|
||||
name = "nvim-devShell";
|
||||
buildInputs = with pkgs; [
|
||||
# Tools for Lua and Nix development, useful for editing files in this repo
|
||||
lua-language-server
|
||||
nil
|
||||
stylua
|
||||
luajitPackages.luacheck
|
||||
];
|
||||
shellHook = ''
|
||||
# symlink the .luarc.json generated in the overlay
|
||||
ln -fs ${pkgs.nvim-luarc-json} .luarc.json
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
# templates = {
|
||||
# };
|
||||
shell = pkgs.mkShell {
|
||||
name = "nvim-devShell";
|
||||
buildInputs = with pkgs; [
|
||||
# Tools for Lua and Nix development, useful for editing files in this repo
|
||||
lua-language-server
|
||||
nil
|
||||
stylua
|
||||
luajitPackages.luacheck
|
||||
];
|
||||
shellHook = ''
|
||||
# symlink the .luarc.json generated in the overlay
|
||||
ln -fs ${pkgs.nvim-luarc-json} .luarc.json
|
||||
'';
|
||||
};
|
||||
in {
|
||||
formatter = nixpkgs.legacyPackages.${system}.alejandra;
|
||||
packages = rec {
|
||||
default = nvim;
|
||||
nvim = pkgs.nvim-pkg;
|
||||
};
|
||||
devShells = {
|
||||
default = shell;
|
||||
};
|
||||
})
|
||||
// {
|
||||
# You can add this overlay to your NixOS configuration
|
||||
overlays.default = neovim-overlay;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -128,11 +128,9 @@ with final.pkgs.lib; let
|
|||
asm-lsp # Assembly language server
|
||||
clang-tools # C/C++ language server
|
||||
(callPackage ./cpptools.nix {}) # C/C++ debugger from VSCode | https://github.com/microsoft/vscode-cpptools
|
||||
nil # nix LSP
|
||||
nodePackages.bash-language-server # Bash language server
|
||||
lua-language-server
|
||||
# (pkgs.python312.withPackages (python-pkgs: [ python-pkgs.python-lsp-server python-pkgs.python-lsp-ruff python-pkgs.pylsp-rope python-pkgs.pylsp-mypy ]))
|
||||
jsonnet-language-server
|
||||
nil # nix LSP
|
||||
];
|
||||
in {
|
||||
# This is the neovim derivation
|
||||
|
|
|
@ -11,12 +11,10 @@ local root_files = {
|
|||
'.git',
|
||||
}
|
||||
|
||||
local root = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1])
|
||||
|
||||
vim.lsp.start {
|
||||
name = 'clangd',
|
||||
cmd = { 'clangd' },
|
||||
root_dir = root,
|
||||
root_dir = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]),
|
||||
capabilities = require('user.lsp').make_client_capabilities(),
|
||||
filetypes = { "c" },
|
||||
on_attach = function(client, bufnr)
|
||||
|
@ -41,7 +39,7 @@ if vim.fn.executable('gdb') == 1 then
|
|||
end
|
||||
|
||||
-- DAP loads this automatically as of now. May be needed to load the debugger for asm?
|
||||
-- if require('user.file_exists').file_exists(root .. "/.vscode/launch.json") then
|
||||
-- if require('user.file_exists').file_exists(vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]) .. "/.vscode/launch.json") then
|
||||
-- require("dap.ext.vscode").load_launchjs(nil, { cppdbg = { "c", "cpp", "asm" } })
|
||||
-- require("dap.ext.vscode").load_launchjs(nil, { gdb = { "c", "cpp", "asm" } })
|
||||
-- end
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
-- Exit if the language server isn't available
|
||||
if vim.fn.executable('pylsp') ~= 1 and vim.fn.executable('mypy') ~= 1 and vim.fn.executable('ruff') then
|
||||
return
|
||||
end
|
||||
|
||||
local root_files = {
|
||||
'pyproject.toml',
|
||||
'setup.py',
|
||||
'setup.cfg',
|
||||
'requirements.txt',
|
||||
'Pipfile',
|
||||
'pyrightconfig.json',
|
||||
'.git',
|
||||
}
|
||||
|
||||
vim.lsp.start({
|
||||
name = 'python-lsp-server',
|
||||
cmd = { "pylsp" },
|
||||
root_dir = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]),
|
||||
capabilities = require('user.lsp').make_client_capabilities(),
|
||||
filetypes = { 'python' },
|
||||
on_attach = function(client, bufnr)
|
||||
require("nvim-navic").attach(client, bufnr)
|
||||
require("workspace-diagnostics").populate_workspace_diagnostics(client, bufnr)
|
||||
end,
|
||||
settings = {
|
||||
pylsp = {
|
||||
plugins = {
|
||||
mypy = { enabled = true, },
|
||||
rope = { enabled = true, },
|
||||
ruff = { enabled = true, },
|
||||
},
|
||||
},
|
||||
},
|
||||
single_file_support = true
|
||||
})
|
|
@ -8,7 +8,7 @@ local file_exists = require("user.file_exists").file_exists
|
|||
require("which-key").add({
|
||||
{ "<leader>o", group = "[o]verseer", icon = "" },
|
||||
{ "<leader>ot", "<Cmd>OverseerToggle<CR>", desc = "[o]verseer: [t]oggle " },
|
||||
{ "<leader>oc", "<Cmd>OverseerRunCmd<CR>", desc = "[o]verseer: run [c]ommand" },
|
||||
{ "<leader>oc", "<Cmd>OverseerRunCmd<CR>", desc = "[o]verseer: run [c]ommand" },
|
||||
{ "<leader>or", "<Cmd>OverseerRun<CR>", desc = "[o]verseer: [r]un task" },
|
||||
{ "<leader>oq", "<Cmd>OverseerQuickAction<CR>", desc = "[o]verseer: [q]uick action" },
|
||||
{ "<leader>oa", "<Cmd>OverseerTaskAction<CR>", desc = "[o]verseer: task [a]ction" },
|
||||
|
@ -20,10 +20,10 @@ local root_files = {
|
|||
'.git',
|
||||
}
|
||||
|
||||
local root = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1])
|
||||
local root = vim.fs.find(root_files, { upward = true })[1]
|
||||
|
||||
if root then
|
||||
if file_exists(root .. "/.vscode/tasks.json") then
|
||||
if file_exists(root .. ".vscode/tasks.json") then
|
||||
require('overseer').setup({
|
||||
strategy = {
|
||||
"toggleterm",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue