Compare commits

..

1 Commits

Author SHA1 Message Date
Dave Gallant
61e6743c8c Migrate to nixvim 2024-02-18 18:08:15 -05:00
12 changed files with 132 additions and 67 deletions

4
.git-crypt/.gitattributes vendored Normal file
View File

@@ -0,0 +1,4 @@
# Do not edit this file. To specify the files to encrypt, create your own
# .gitattributes file in the directory where your files are.
* !filter !diff
*.gpg binary

1
.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
**/.aws/** filter=git-crypt diff=git-crypt

10
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
reviewers:
- davegallant
assignees:
- davegallant

View File

@@ -25,10 +25,6 @@ rollback:
update:
nix flake update
make
git add .
git commit -S -m "nix flake update: $$(TZ=UTC date +%Y-%m-%d_%H-%M-%S)"
git push
fmt:
alejandra .

View File

@@ -36,3 +36,7 @@ make rollback
## Pre-commit hooks
Pre-commit hooks are automatically activated when [direnv](https://github.com/direnv/direnv) is installed.
## Encryption
Overly sensitive configuration is encrypted with [git-crypt](https://www.agwa.name/projects/git-crypt/).

18
flake.lock generated
View File

@@ -30,11 +30,11 @@
]
},
"locked": {
"lastModified": 1708231718,
"narHash": "sha256-IZdieFWvhBkxoOFMDejqLUYqD94WN6k0YSpw0DFy+4g=",
"lastModified": 1707707289,
"narHash": "sha256-YuDt/eSTXMEHv8jS8BEZJgqCcG8Tr3cyqaZjJFXZHsw=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "0e6857fa1d632637488666c08e7b02c08e3178f8",
"rev": "44f50a5ecaab72a61d5fd8e5c5717bc4bf9c25dd",
"type": "github"
},
"original": {
@@ -204,11 +204,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1708247094,
"narHash": "sha256-H2VS7VwesetGDtIaaz4AMsRkPoSLEVzL/Ika8gnbUnE=",
"lastModified": 1708151420,
"narHash": "sha256-MGT/4aGCWQPQiu6COqJdCj9kSpLPiShgbwpbC38YXC8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "045b51a3ae66f673ed44b5bbd1f4a341d96703bf",
"rev": "6e2f00c83911461438301db0dba5281197fe4b3a",
"type": "github"
},
"original": {
@@ -220,11 +220,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1708161998,
"narHash": "sha256-6KnemmUorCvlcAvGziFosAVkrlWZGIc6UNT9GUYr0jQ=",
"lastModified": 1708105575,
"narHash": "sha256-sS4AItZeUnAei6v8FqxNlm+/27MPlfoGym/TZP0rmH0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "84d981bae8b5e783b3b548de505b22880559515f",
"rev": "1d1817869c47682a6bee85b5b0a6537b6c0fba26",
"type": "github"
},
"original": {

BIN
home/.aws/config Executable file

Binary file not shown.

View File

@@ -4,6 +4,16 @@
unstable,
...
}: let
hound-nvim = pkgs.vimUtils.buildVimPlugin {
name = "hound-nvim";
nativeBuildInputs = with pkgs; [lua53Packages.luacheck stylua];
src = pkgs.fetchFromGitHub {
owner = "davegallant";
repo = "hound.nvim";
rev = "e85ba4f65ece79fe6332d8a0ccc594a0d367f4ed";
sha256 = "sha256-fxPtixVB6dVjrxpJ1oP+eA00JSiKxWuii8pMxVeuyMY=";
};
};
inherit (pkgs) stdenv;
in {
home.stateVersion = "23.11";
@@ -370,38 +380,6 @@ in {
nixvim = {
enable = true;
colorschemes.gruvbox.enable = true;
keymaps = [
{
key = "<C-n>";
mode = ["n"];
action = "<cmd>tabnew<cr>";
options = {
silent = true;
};
}
# copy to OS clipboard
{
key = "<leader>y";
mode = ["v"];
action = "\"+y";
}
{
key = "gD";
mode = ["n"];
action = "<cmd>lua vim.lsp.buf.declaration()<CR>";
}
{
key = "gd";
mode = ["n"];
action = "<cmd>lua vim.lsp.buf.definition()<CR>";
}
{
key = "gr";
mode = ["n"];
action = "<cmd>lua vim.lsp.buf.references()<CR>";
}
];
plugins = {
cmp-path.enable = true;
cmp-treesitter.enable = true;
@@ -410,19 +388,6 @@ in {
gitblame.enable = true;
gitsigns.enable = true;
lualine.enable = true;
lsp.enable = true;
lsp.servers = {
#ansiblels.enable = true;
bashls.enable = true;
#dockerls.enable = true;
gopls.enable = true;
#helm-ls.enable = true;
jsonls.enable = true;
pyright.enable = true;
rnix-lsp.enable = true;
terraformls.enable = true;
yamlls.enable = true;
};
nvim-cmp.enable = true;
rainbow-delimiters.enable = true;
treesitter.enable = true;
@@ -496,6 +461,15 @@ in {
-- Format JSON
vim.cmd([[command! JsonFormat execute "::%!jq '.'"]])
-- Tab shortcuts
vim.api.nvim_set_keymap("n", "<C-n>", "<cmd>tabnew<cr>", { noremap = true })
-- Copy to OS clipboard
vim.api.nvim_set_keymap("v", "<leader>y", '"+y', { noremap = true })
-- Folding
vim.api.nvim_set_keymap("n", "<space>", "za", { silent = true, noremap = true })
-- Remember line number
vim.cmd([[au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif]])
@@ -512,6 +486,18 @@ in {
vim.cmd([[highlight ExtraWhitespace ctermbg=red guibg=red]])
vim.cmd([[match ExtraWhitespace /\s\+$/]])
-------------------------------------------------------------------------------
-- LSP {{{1 -------------------------------------------------------------------
-------------------------------------------------------------------------------
-- See `:help vim.lsp.*` for documentation on any of the below functions
local opts = { noremap=true, silent=true }
vim.api.nvim_set_keymap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
vim.api.nvim_set_keymap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
vim.api.nvim_set_keymap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
vim.api.nvim_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
vim.api.nvim_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
-------------------------------------------------------------------------------
-- completion {{{1 -------------------------------------------------------------------
-------------------------------------------------------------------------------
@@ -523,6 +509,66 @@ in {
local cmp = require("cmp")
-------------------------------------------------------------------------------
-- lsp {{{1 -------------------------------------------------------------------
-------------------------------------------------------------------------------
local lspconfig = require "lspconfig"
lspconfig.ansiblels.setup({
capabilities = capabilities,
cmd = {os.getenv("HOME") .. "/.npm-packages/bin/ansible-language-server", "--stdio"};
})
lspconfig.bashls.setup({
capabilities = capabilities,
})
lspconfig.gopls.setup({
capabilities = capabilities,
})
lspconfig.pyright.setup({
capabilities = capabilities,
})
lspconfig.rls.setup({
capabilities = capabilities,
})
lspconfig.rnix.setup({
capabilities = capabilities,
})
lspconfig.solargraph.setup({
capabilities = capabilities,
})
lspconfig.terraformls.setup({
filetypes={"terraform","tf","hcl"},
capabilities = capabilities,
})
lspconfig.tflint.setup({
capabilities = capabilities,
})
lspconfig.yamlls.setup({
capabilities = capabilities,
})
-------------------------------------------------------------------------------
-- Plugins {{{1 ---------------------------------------------------------------
-------------------------------------------------------------------------------
-- status line
require("lualine").setup({
options = {
theme = "gruvbox",
},
})
-- folding
vim.api.nvim_exec(
[[
@@ -533,6 +579,12 @@ in {
]],
true
)
-- vim-prettier
vim.g["prettier#autoformat"] = 1
-- git-blame
vim.g.gitblame_enabled = 1
'';
};
@@ -578,4 +630,9 @@ in {
};
};
};
home.file = {
# ".config/nvim/lua".source = ./nvim/lua;
".aws/config".source = ./.aws/config;
};
}

View File

@@ -21,8 +21,6 @@
};
};
systemd.services.NetworkManager-wait-online.enable = false;
services = {
sshd.enable = true;
tailscale.enable = true;

View File

@@ -12,6 +12,7 @@ in {
# essentials
curl
gcc
git-crypt
gnumake
gnupg
imagemagick
@@ -57,7 +58,7 @@ in {
unstable.google-cloud-sdk
unstable.awscli2
# LSP
# language servers
nodePackages.bash-language-server
nodePackages.pyright
nodePackages.yaml-language-server

View File

@@ -1,6 +0,0 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
]
}