Compare commits

..

84 commits

Author SHA1 Message Date
d0f2a1d5b6
chore: update 2025-06-25 14:42:58 +02:00
a0f53489fa
feat(zsh): attach to or create tmux session in interactive shells 2025-06-18 16:09:46 +02:00
b437553ce3
feat(nvim): remove snippet plugins 2025-06-18 16:08:39 +02:00
6f46dcbb2c
feat(nvim): auto-complete with tab 2025-06-18 16:07:57 +02:00
9d43b837ff
feat(shell): add tmux 2025-06-18 09:30:08 +02:00
32e96d011a
feat(nvim): disable general auto-completion sources in codecompanion chat 2025-06-18 09:00:45 +02:00
bf447bdce1
feat(nvim): don't require configmation before stripping whitespaces 2025-06-18 08:59:26 +02:00
972c0aee45
feat(devenv): add watchexec to devenv 2025-06-18 08:58:56 +02:00
8a1e736f09
feat(nvim): set wrap on 2025-06-17 15:09:44 +02:00
28d2284c10
chore: update 2025-06-17 14:35:34 +02:00
fb5546ca3e
feat: enable codecompanion agent mode with claude-4-sonnet 2025-06-17 14:34:00 +02:00
3a14881e94
fix: remove broken bitbake_language_server 2025-06-17 14:33:38 +02:00
eeb8173a90
feat: replace nvim-cmp with blink-cmp 2025-06-17 14:32:48 +02:00
022abfffc5
feat: use delta instead of difftastic 2025-05-23 08:43:24 +02:00
41fc5bb328
chore: update 2025-05-20 12:59:48 +02:00
306e8aa54f
chore: switch to fusion-wifi as default 2025-05-20 12:59:27 +02:00
22d09d236e
fix: use update imx image name 2025-05-20 12:58:45 +02:00
9b1e3b6bc9
feat: add preview to swu selector 2025-05-20 12:58:15 +02:00
dfec21163a
refactor: configure difftastic 2025-05-20 12:56:52 +02:00
759bda1d77
style: enable nix formatter and linter 2025-05-13 08:56:31 +02:00
a9a6888958
chore: rebuild devenv 2025-05-13 08:52:38 +02:00
7e8901c7bf
chore: devenv update 2025-05-13 08:39:59 +02:00
58489e40e4
chore: update 2025-05-12 08:59:37 +02:00
4bbca6a646
feat: configure copilot 2025-05-12 08:56:58 +02:00
52fb50b13c
feat: extract and configure code-companion 2025-05-12 08:56:26 +02:00
599be55422
feat: add llm 2025-05-02 07:01:55 +02:00
636b7b79bc
chore: update deprecated key 2025-05-02 07:01:38 +02:00
de9ae1f3a2
chore: devenv update 2025-05-02 07:01:03 +02:00
36f1b0fe94
chore: update 2025-04-30 06:42:18 +02:00
efd67c580b
refactor: replace deprecated initExtra with initContent 2025-04-28 08:09:25 +02:00
e125a6197b
feat: remove unused jj/kk escape mapping 2025-04-25 08:28:03 +02:00
994d1b28a1
feat: keep windows layout when closing buffers 2025-04-25 08:27:40 +02:00
100f65c951
feat(nvim): enabled c++ debugging 2025-04-24 08:49:14 +02:00
bd20a50379
chore: devenv update 2025-04-23 11:08:36 +02:00
821a8aee39
feat(shell): add hb-roots function to list hawkBit rootfs ids 2025-04-23 11:07:48 +02:00
e3e1fe4d8d
chore: nix flake update 2025-04-22 09:41:48 +02:00
1dce1ddcf2
feat: add CodeCompanion 2025-04-22 09:41:07 +02:00
000823f879
fix: remove deprecated dressing-nvim 2025-04-22 09:32:29 +02:00
179a04b331
feat: remove undotree 2025-04-22 09:31:47 +02:00
a1ebbba5b9
fix: remove deprecated lsp-inlayhints 2025-04-22 09:31:12 +02:00
b862a05887
feat: remove project-nvim 2025-04-22 09:30:21 +02:00
4cbdafc642
fix: replace deprecated neodev with lazydev 2025-04-22 09:21:38 +02:00
bd1a25fd95
fix: remove deprecated tabline-nvim 2025-04-22 09:20:23 +02:00
4f336803ab
feat(git): enable relative worktrees 2025-04-11 10:26:22 +02:00
bb8ac5db06
feat(nvim): map leader-F to git file log 2025-04-11 07:52:05 +02:00
642709d33d
feat: add private ssh host config 2025-04-08 22:15:50 +02:00
532200060b
feat: configure gh-dash layout 2025-04-04 13:20:20 +02:00
9056c04c00
feat: add git-worktree-switcher 2025-04-04 13:19:13 +02:00
73c1ab8d56
feat(shell): add gfg shell alias (git fetch graph) 2025-03-25 08:49:12 +01:00
49dda752cb
feat(gh): add gh-dash 2025-03-25 08:40:22 +01:00
ada1a9448a
feat(gh): add gh-copilot 2025-03-25 08:39:50 +01:00
dc6a6c95ff
chore: update 2025-03-20 07:09:16 +01:00
69aca65778
chore: devenv update 2025-03-20 07:06:35 +01:00
84e376943d
feat: silence direnv 2025-03-20 07:05:35 +01:00
9a5a39d210
feat(nvim): strip trailing whitespaces on save 2025-03-17 13:59:54 +01:00
c6af7586ce
chore: nix flake update 2025-03-06 20:00:26 +01:00
501be7a1ce
fix: use plain element-desktop package 2025-03-06 20:00:26 +01:00
24acf9c23d
feat: add zoom 2025-03-06 20:00:26 +01:00
95edaae633
chore: nix flake update 2025-03-04 15:30:23 +01:00
c61a8e3b1e
chore: replace manual dev-shell with devenv 2025-03-04 15:28:44 +01:00
5cb4656a71
feat(shell): add sshfs 2025-03-04 15:18:37 +01:00
a7e6655006
feat(nvim): add render-markdown plugin 2025-03-04 14:34:42 +01:00
d1637e46fc
feat(nvim): open copilot chat on leader-cc in floating window 2025-03-04 14:31:08 +01:00
621a555c25
feat(git): push only current branch, and only if upstream matches 2025-02-26 08:45:13 +01:00
88c22f7b6a
feat(git): automatically push tags 2025-02-26 08:44:51 +01:00
dc22952892
feat(git): automatically set-upstream on push 2025-02-26 08:44:09 +01:00
5bcecad8b6
feat(git): update dependent branches on rebase 2025-02-26 08:37:03 +01:00
325ddabe3c
feat(git): sort tags by version number 2025-02-26 08:36:36 +01:00
ca135b4935
feat(git): auto-stage rerere results 2025-02-26 08:34:30 +01:00
bc21047420
feat(git): show merge conflicts in 3-way style 2025-02-26 08:23:04 +01:00
f73891c335
feat(git): always fetch all and prune 2025-02-26 08:22:41 +01:00
555d229cf1
feat(git): use improved diff algos 2025-02-26 08:20:45 +01:00
7a23d06079
feat(git): show diff in commit-message editor 2025-02-26 08:19:58 +01:00
3b959ee112
feat(git): use multi-column output for branches and tags 2025-02-26 08:19:13 +01:00
c74cd97351
feat(git): speed-up large repo handling 2025-02-26 08:18:22 +01:00
a131d538c8
feat(git): sort branches by commit date 2025-02-26 08:17:31 +01:00
d229371421
feat(nvim): add pyright language server 2025-02-26 08:08:40 +01:00
45472e0722
chore: nix flake update 2025-02-20 10:09:57 +01:00
9533f9c169
feat(shell): add devenv 2025-02-20 10:09:26 +01:00
fd14195ccd
feat(nvim): use diffview-nvim for diffs and merges 2025-02-12 16:23:34 +01:00
2cca40f5e8
feat(nvim): enable CopilotChat 2025-02-11 14:15:27 +01:00
cc92efac9a
chore: nix flake update 2025-01-07 09:32:40 +01:00
f217b7af5e
feat(nvim): add copilot 2025-01-07 09:32:13 +01:00
8e45e1e0a0
feat(nvim): add firenvim 2025-01-07 09:32:13 +01:00
36 changed files with 605 additions and 346 deletions

13
.envrc
View file

@ -1,8 +1,7 @@
use flake .nix
export DIRENV_WARN_TIMEOUT=20s
if on_git_branch; then
echo
git status --short --branch
echo
git fetch
fi
eval "$(devenv direnvrc)"
# The use_devenv function supports passing flags to the devenv command
# For example: use devenv --impure --option services.postgres.enable:bool true
use devenv

10
.gitignore vendored
View file

@ -2,3 +2,13 @@
# Ignore build outputs from performing a nix-build or `nix build` command
result
result-*
# Devenv
.devenv*
devenv.local.nix
# direnv
.direnv
# pre-commit
.pre-commit-config.yaml

25
.nix/flake.lock generated
View file

@ -1,25 +0,0 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1729665710,
"narHash": "sha256-AlcmCXJZPIlO5dmFzV3V2XF6x/OpNWUV8Y/FMPGd8Z4=",
"rev": "2768c7d042a37de65bb1b5b3268fc987e534c49d",
"revCount": 696158,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.696158%2Brev-2768c7d042a37de65bb1b5b3268fc987e534c49d/0192bd28-d6c0-735c-ab86-8ab9d12f7d62/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.%2A.tar.gz"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

View file

@ -1,32 +0,0 @@
{
description = "A flake editing flake";
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz";
outputs = { nixpkgs, ... }:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit system; };
});
in
{
devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell.override
{
# Override stdenv in order to change compiler:
# stdenv = pkgs.clangStdenv;
}
{
packages = with pkgs; [
pre-commit
commitizen
];
shellHook = ''
pre-commit install --allow-missing-config --hook-type pre-commit --hook-type commit-msg
'';
};
});
};
}

View file

@ -1,27 +0,0 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: detect-private-key
- id: mixed-line-ending
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.27.0
hooks:
- id: commitizen
stages: [commit-msg]
- repo: local
hooks:
- id: home-manager-check
name: Home Manager Config Check
entry: home-manager switch --dry-run
language: system
pass_filenames: false
exclude: ^docs/

103
devenv.lock Normal file
View file

@ -0,0 +1,103 @@
{
"nodes": {
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1747116279,
"owner": "cachix",
"repo": "devenv",
"rev": "79e442e0b24f0f45db0d853d88d3d27dff422b3b",
"type": "github"
},
"original": {
"dir": "src/modules",
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1747046372,
"owner": "edolstra",
"repo": "flake-compat",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1746537231,
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "fa466640195d38ec97cf0493d6d6882bc4d14969",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1746807397,
"owner": "cachix",
"repo": "devenv-nixpkgs",
"rev": "c5208b594838ea8e6cca5997fbf784b7cca1ca90",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "rolling",
"repo": "devenv-nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"devenv": "devenv",
"git-hooks": "git-hooks",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": [
"git-hooks"
]
}
}
},
"root": "root",
"version": 7
}

27
devenv.nix Normal file
View file

@ -0,0 +1,27 @@
{pkgs, ...}: {
packages = with pkgs; [
watchexec
];
git-hooks = {
hooks = {
alejandra.enable = true;
check-case-conflicts.enable = true;
check-merge-conflicts.enable = true;
commitizen.enable = true;
deadnix.enable = true;
detect-private-keys.enable = true;
end-of-file-fixer.enable = true;
markdownlint.enable = true;
mdformat.enable = true;
};
hooks.home-manager-check = {
enable = true;
name = "Home Manager Config Check";
entry = "home-manager switch --dry-run";
pass_filenames = false;
excludes = ["^docs/"];
};
};
}

15
devenv.yaml Normal file
View file

@ -0,0 +1,15 @@
# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json
inputs:
nixpkgs:
url: github:cachix/devenv-nixpkgs/rolling
# If you're using non-OSS software, you can set allowUnfree to true.
# allowUnfree: true
# If you're willing to use a package that's vulnerable
# permittedInsecurePackages:
# - "openssl-1.1.1w"
# If you have more than one devenv you can merge them
#imports:
# - ./backend

12
flake.lock generated
View file

@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1734093295,
"narHash": "sha256-hSwgGpcZtdDsk1dnzA0xj5cNaHgN9A99hRF/mxMtwS4=",
"lastModified": 1750730235,
"narHash": "sha256-rZErlxiV7ssvI8t7sPrKU+fRigNc2KvoKZG3gtUtK50=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "66c5d8b62818ec4c1edb3e941f55ef78df8141a8",
"rev": "d07e9cceb4994ed64a22b9b36f8b76923e87ac38",
"type": "github"
},
"original": {
@ -22,11 +22,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1734119587,
"narHash": "sha256-AKU6qqskl0yf2+JdRdD0cfxX4b9x3KKV5RqA6wijmPM=",
"lastModified": 1750506804,
"narHash": "sha256-VLFNc4egNjovYVxDGyBYTrvVCgDYgENp5bVi9fPTDYc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "3566ab7246670a43abd2ffa913cc62dad9cdf7d5",
"rev": "4206c4cb56751df534751b058295ea61357bbbaa",
"type": "github"
},
"original": {

View file

@ -59,27 +59,6 @@
vimwikiPath = "~/vimwiki";
};
};
"ubuntu" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./shell
./git
./gpg
./neovim
./horsch.nix
];
extraSpecialArgs = {
user = "ubuntu";
userName = "Michael Mandl";
userEmail = "michael.mandl@horsch.com";
gpgSigningKey = "088ED38F036C7AF2";
gpgSSHKeys = [ "AEB2BF3FF9CF9529E9A3C6F1A202D21686FF9278" ];
theme = "dark";
vimwikiPath = "~/vimwiki";
};
};
};
};
}

View file

@ -1,9 +1,17 @@
{ pkgs, userName, userEmail, gpgSigningKey, ... }:
{
pkgs,
userName,
userEmail,
gpgSigningKey,
...
}: {
programs = {
less.enable = true;
git-credential-oauth.enable = true;
git-worktree-switcher = {
enable = true;
enableZshIntegration = true;
};
git = {
enable = true;
@ -16,9 +24,24 @@
signByDefault = true;
};
difftastic = {
delta = {
enable = true;
options = {
dark = true;
theme = "Solarized (dark)";
side-by-side = true;
line-numbers = true;
true-color = "always";
plus-style = "syntax \"#003800\"";
minus-style = "syntax \"#380000\"";
};
};
difftastic = {
enable = false;
background = "light";
display = "side-by-side-show-both";
enableAsDifftool = true;
};
lfs = {
@ -26,14 +49,34 @@
};
extraConfig = {
core.editor = "nvim";
core.pager = "less -FX";
branch.sort = "-committerdate";
diff.ignoreSubmodules = "none";
core = {
editor = "nvim";
fsmonitor = true;
untrackedCache = true;
};
fetch.parallel = 8;
fetch.writeCommitGraph = true;
fetch.recurseSubmodules = true;
column.ui = "auto";
commit.verbose = true;
diff = {
algorithm = "histogram";
colorMoved = "plain";
ignoreSubmodules = "none";
mnemonicPrefix = true;
renames = true;
};
fetch = {
all = true;
parallel = 8;
prune = true;
pruneTags = true;
recurseSubmodules = true;
writeCommitGraph = true;
};
format.pretty = "format:%C(yellow)%h %Cblue%>(12)%ad %C(red)%G? %Cgreen%<(7,trunc)%aN%Cred%d %Creset%s";
@ -41,28 +84,49 @@
log.date = "relative";
merge.ff = false;
merge.tool = "nvim";
merge = {
conflictstyle = "zdiff3";
ff = false;
tool = "nvim";
};
mergetool.nvim.cmd = "nvim -f -c \"Gdiffsplit!\" \"$MERGED\"";
mergetool.nvim.cmd = "nvim -d $BASE $LOCAL $REMOTE $MERGED -c 'DiffviewOpen'";
mergetool.nvim.trustExitCode = false;
mergetool.prompt = false;
pager.difftool = true;
pull.rebase = true;
push.recurseSubmodules = "on-demand";
push = {
autoSetupRemote = true;
default = "simple";
followTags = true;
recurseSubmodules = "on-demand";
};
rebase.autostash = true;
rebase = {
qutoSquash = true;
autoStash = true;
updateRefs = true;
};
rerere.enabled = true;
rerere = {
autoupdate = true;
enabled = true;
};
status.submoduleSummary = true;
submodule.fetchJobs = 8;
submodule.recurse = true;
worktree.guessRemote = true;
tag.sort = "version:refname";
worktree = {
guessRemote = true;
useRelativePaths = true;
};
};
aliases = {
@ -101,26 +165,5 @@
git -C ''${dir}/.base checkout --detach HEAD
git -C ''${dir}/.base worktree add ../''${branch}
'')
(writeShellScriptBin "git-make-relative" ''
gitfile=''${1}
if [[ -z ''${gitfile} ]]; then
gitfile=".git"
fi
if [[ ! -f ''${gitfile} ]]; then
echo "file ''${gitfile} does not exist"
exit 1
fi
gitdir=$(grep "gitdir:" ''${gitfile} | cut -d: -f2 | xargs)
rel_gitdir=$(realpath -s --relative-to=. ''${gitdir})
echo "relative path: ''${rel_gitdir}"
sed -i -e "s,gitdir:.*,gitdir: ''${rel_gitdir}," ''${gitfile}
'')
];
}

View file

@ -4,7 +4,7 @@
services.gpg-agent = {
enable = true;
enableZshIntegration = true;
pinentryPackage = pkgs.pinentry-curses;
pinentry.package = pkgs.pinentry-curses;
enableSshSupport = true;
sshKeys = gpgSSHKeys;
defaultCacheTtl = 3600 * 12;

View file

@ -1,11 +1,43 @@
{ ... }:
{
programs.gh = {
pkgs,
lib,
...
}: {
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
"gh-copilot"
];
home.packages = with pkgs; [
delta
];
programs = {
gh = {
enable = true;
settings = {
git_protocol = "ssh";
};
extensions = with pkgs; [
gh-copilot
gh-dash
];
};
gh-dash = {
enable = true;
settings = {
defaults = {
preview = {
open = true;
width = 64;
};
};
pager.diff = "delta";
};
};
};
}

View file

@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
programs = {
ssh = {
enable = true;
@ -17,7 +15,7 @@
};
};
Fusion-USB = {
host = "fusion-usb fusion 172.16.0.1";
host = "fusion-usb 172.16.0.1";
user = "root";
hostname = "172.16.0.1";
checkHostIP = false;
@ -28,7 +26,7 @@
};
};
Fusion-Wifi = {
host = "fusion-wifi 172.16.1.1";
host = "fusion-wifi fusion 172.16.1.1";
user = "root";
hostname = "172.16.1.1";
checkHostIP = false;

View file

@ -1,6 +1,5 @@
{ ... }:
{
programs.zsh.initExtra = ''
{...}: {
programs.zsh.initContent = ''
if [ -f $HOME/.nix-profile/etc/profile.d/nix.sh ];
then
source $HOME/.nix-profile/etc/profile.d/nix.sh
@ -54,8 +53,11 @@
local ssh_login="fusion"
local update_file=''${1}
local fzf_preview='stat --printf "%n\nSize: %s bytes\nModified: %y" {}'
if [ -z ''${update_file} ]; then
update_file=$(find build/tmp/deploy/images -name "*.swu" -type f | fzf --select-1)
update_file=$(find build/tmp/deploy/images -name "*.swu" -type f \
| fzf --select-1 --exit-0 --header "Select a update file" --preview=''${fzf_preview} --preview-window=top)
fi
if [ -z ''${update_file} ]; then
@ -97,7 +99,7 @@
local wic_file=''${2}
if [ -z ''${bootloader_file} ]; then
bootloader_file=$(find build/tmp/deploy/images -name "imx-boot-horsch-fusion-sd*" -type f \
bootloader_file=$(find build/tmp/deploy/images -name "imx-boot-horsch-*" -type f \
| fzf --select-1 --exit-0 --header "Select a bootloader file" --preview=''${fzf_preview} --preview-window=top)
fi
@ -132,5 +134,16 @@
--get \
| jq | bat
}
function hb-roots {
curl --silent \
--location "https://hawkbit-smartcan.horsch.com/rest/v1/softwaremodules" \
--header "Content-Type: application/json" \
--header "Authorization: Basic ''$hawkbitToken" \
--data "q=type==rootfs-smartcan" \
--data "sort=id:DESC" \
--get \
| jq | bat
}
'';
}

38
neovim/blink-cmp.lua Normal file
View file

@ -0,0 +1,38 @@
require("copilot").setup({
copilot_model = "claude-4-sonnet"
})
require("blink-copilot").setup({})
require("blink-cmp").setup({
completion = {
documentation = { auto_show = true, auto_show_delay_ms = 500 },
ghost_text = { enabled = true },
list = {
selection = { preselect = false, auto_insert = true },
},
},
keymap = {
preset = "default",
["<Tab>"] = { "select_next", "fallback" },
["<S-Tab>"] = { "select_prev", "fallback" },
["<CR>"] = { "accept", "fallback" },
},
signature = { enabled = true },
sources = {
default = { "copilot", "lsp", "buffer", "path", "cmdline" },
per_filetype = {
codecompanion = { "codecompanion" }
},
providers = {
copilot = {
name = "copilot",
module = "blink-copilot",
score_offset = 100,
async = true,
}
}
},
})

35
neovim/codecompanion.lua Normal file
View file

@ -0,0 +1,35 @@
local codecompanion = require("codecompanion")
vim.g.codecompanion_auto_tool_mode = true
codecompanion.setup({
strategies = {
chat = {
adapter = "copilot",
tools = {
opts = {
auto_submit_errors = true,
auto_submit_success = true,
requires_approval = false,
}
}
},
inline = {
adapter = "copilot",
},
cmd = {
adapter = "copilot",
},
},
adapters = {
copilot = function()
return require("codecompanion.adapters").extend("copilot", {
schema = {
model = {
default = "claude-sonnet-4",
},
},
})
end,
}
})

View file

@ -1,6 +1,26 @@
local dap = require("dap")
local dapui = require("dapui")
dap.adapters.lldb = {
type = "executable",
command = "lldb-dap",
name = "lldb",
}
dap.configurations.cpp = {
{
name = "Launch",
type = "lldb",
request = "launch",
program = function()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
end,
cwd = "${workspaceFolder}",
stopOnEntry = false,
args = {},
},
}
dapui.setup()
vim.fn.sign_define("DapBreakpoint", { text = "🔴", texthl = "", linehl = "", numhl = "" })

View file

@ -1,8 +1,9 @@
{ pkgs, theme, vimwikiPath, ... }:
{
# symlink for a stable path
home.file.".vscode-extensions/vscode-lldb".source = pkgs.vscode-extensions.vadimcn.vscode-lldb;
pkgs,
theme,
vimwikiPath,
...
}: {
programs = {
neovim = {
enable = true;
@ -12,37 +13,33 @@
# theme
nvim-solarized-lua
# keep window layout when deleting buffers
vim-bbye
# auto-close brackets, etc
nvim-autopairs
# trailing whirespaces
vim-better-whitespace
# better wildmenu
wilder-nvim
# undo-tree
undotree
# quickfix
# better quickfix
nvim-bqf
# ui
dressing-nvim
# session handling
project-nvim
auto-session
# escape handling
better-escape-nvim
nvim-treesitter.withAllGrammars
nvim-treesitter-textobjects
nvim-ts-context-commentstring
markdown-preview-nvim # use({ "iamcco/markdown-preview.nvim", run = ":call mkdp#util#install()" })
render-markdown-nvim
toggleterm-nvim
nvim-notify
comment-nvim
lualine-nvim
tabline-nvim
indent-blankline-nvim
plenary-nvim
vim-illuminate
@ -55,21 +52,11 @@
vim-flog
git-blame-nvim
nvim-web-devicons # used by diffview-nvim
# snippets
friendly-snippets
luasnip
diffview-nvim
# auto-completion
nvim-cmp
cmp-nvim-lsp
cmp-buffer
cmp-path
cmp-cmdline
cmp-nvim-lua
cmp_luasnip
cmp-calc
cmp-nvim-lsp-signature-help
blink-cmp
blink-copilot
# telescope
telescope-nvim
@ -80,10 +67,15 @@
nvim-lspconfig
lsp-status-nvim
rustaceanvim
neodev-nvim
lazydev-nvim
none-ls-nvim
lsp_lines-nvim
lsp-inlayhints-nvim
lspkind-nvim
# Copilot
copilot-lua
copilot-cmp
codecompanion-nvim
# debugging
nvim-dap
@ -91,6 +83,12 @@
# vim-wiki
vimwiki
# firenvim
firenvim
# tmux
vim-tmux-navigator
];
withNodeJs = true;
@ -111,8 +109,10 @@
texlab
nixd
nixpkgs-fmt
bitbake-language-server
(python3.withPackages (ps: with ps; [
pyright
(python3.withPackages (ps:
with ps; [
pep8
autopep8
python-lsp-server
@ -137,17 +137,18 @@
require("local_toggleterm")
require("local_notify")
require("local_comment")
if vim.g.started_by_firenvim ~= true then
require("local_lualine")
require("local_tabline")
end
require("local_indent-blankline")
require("local_gitsigns")
require("local_luasnip")
require("local_nvim-cmp")
require("local_blink-cmp")
require("local_telescope")
require("local_themes").setup("${theme}")
require("local_project-nvim")
require("local_dap")
require("local_illuminate")
require("local_wilder")
@ -157,7 +158,26 @@
vim.g.gitblame_date_format = "%r"
require("nvim-autopairs").setup({})
require("neogen").setup({ snippet_engine = "luasnip" })
require("local_firenvim")
require("local_codecompanion")
require("diffview").setup({
view = {
merge_tool = {
layout = "diff4_mixed",
disable_diagnostics = true,
}
}
})
require("render-markdown").setup({
file_types = { "markdown", "vimwiki", "copilot-chat" },
})
vim.g.strip_whitespace_on_save = 1
vim.g.strip_whitespace_confirm = 0
'';
};
};
@ -172,18 +192,17 @@
home.file.".config/nvim/lua/local_notify.lua".source = ./notify.lua;
home.file.".config/nvim/lua/local_comment.lua".source = ./comment.lua;
home.file.".config/nvim/lua/local_lualine.lua".source = ./lualine.lua;
home.file.".config/nvim/lua/local_tabline.lua".source = ./tabline.lua;
home.file.".config/nvim/lua/local_indent-blankline.lua".source = ./indent-blankline.lua;
home.file.".config/nvim/lua/local_gitsigns.lua".source = ./gitsigns.lua;
home.file.".config/nvim/lua/local_luasnip.lua".source = ./luasnip.lua;
home.file.".config/nvim/lua/local_nvim-cmp.lua".source = ./nvim-cmp.lua;
home.file.".config/nvim/lua/local_blink-cmp.lua".source = ./blink-cmp.lua;
home.file.".config/nvim/lua/local_telescope.lua".source = ./telescope.lua;
home.file.".config/nvim/lua/local_themes.lua".source = ./themes.lua;
home.file.".config/nvim/lua/local_vimwiki.lua".source = ./vimwiki.lua;
home.file.".config/nvim/lua/local_project-nvim.lua".source = ./project-nvim.lua;
home.file.".config/nvim/lua/local_dap.lua".source = ./dap.lua;
home.file.".config/nvim/lua/local_illuminate.lua".source = ./illuminate.lua;
home.file.".config/nvim/lua/local_wilder.lua".source = ./wilder.lua;
home.file.".config/nvim/lua/local_firenvim.lua".source = ./firenvim.lua;
home.file.".config/nvim/lua/local_codecompanion.lua".source = ./codecompanion.lua;
}

38
neovim/firenvim.lua Normal file
View file

@ -0,0 +1,38 @@
if vim.g.started_by_firenvim ~= true then
return
end
vim.g.firenvim_config = {
globalSettings = { alt = "all" },
localSettings = {
[".*"] = {
cmdline = "neovim",
content = "text",
priority = 0,
selector = "textarea",
takeover = "never"
}
}
}
vim.api.nvim_create_autocmd('UIEnter', {
callback = function()
local client = vim.api.nvim_get_chan_info(vim.v.event.chan).client
if client ~= nil and client.name == "Firenvim" then
vim.o.laststatus = 0
end
end
})
vim.api.nvim_create_autocmd({ 'TextChanged', 'TextChangedI' }, {
callback = function()
if vim.g.timer_started == true then
return
end
vim.g.timer_started = true
vim.fn.timer_start(500, function()
vim.g.timer_started = false
vim.cmd('silent write')
end)
end
})

View file

@ -12,19 +12,19 @@ nnoremap("<C-k>", ":wincmd k<CR>")
nnoremap("<C-l>", ":wincmd l<CR>")
-- Switch buffers
nnoremap("<C-PageDown>", ":TablineBufferNext<CR>")
nnoremap("<C-PageUp>", ":TablineBufferPrevious<CR>")
nnoremap("<C-PageDown>", ":bnext<CR>")
nnoremap("<C-PageUp>", ":bprevious<CR>")
-- fugitive
nnoremap("<leader>g", ":0Git<CR>")
-- vim-flog
nnoremap("<leader>G", ":Flog -all -date=relative -open-cmd=new<CR>")
nnoremap("<leader>F", ":Flog -path=% -date=relative -open-cmd=new<CR>")
-- telescope
local telescope = require("telescope.builtin")
local telescope_themes = require("telescope.themes")
local telescope_projects = require("telescope").extensions.projects
local function map_telescope(key, telescope_function)
vim.api.nvim_set_keymap("n", key, "", {
@ -39,7 +39,6 @@ end
map_telescope("<leader>ff", telescope.find_files)
map_telescope("<leader>fb", telescope.buffers)
map_telescope("<leader>fg", telescope.git_files)
map_telescope("<leader>fp", telescope_projects.projects)
map_telescope("<leader>fs", telescope.lsp_document_symbols)
map_telescope("<leader>fS", telescope.lsp_dynamic_workspace_symbols)
map_telescope("<C-f>", telescope.grep_string)
@ -60,10 +59,10 @@ vim.api.nvim_create_autocmd("TermOpen", {
})
-- buffer closing
nnoremap("gq", ":bdelete<CR>")
nnoremap("gq", ":Bdelete<CR>")
-- toggle search highlighting
vim.cmd('nnoremap <expr> * v:hlsearch ? ":nohlsearch<cr>" : "*"')
-- insert-map jj/jk to escape
require("better_escape").setup()
-- open CodeCompanion chat window
nnoremap("<leader>cc", ":CodeCompanionChat #buffer{watch} #lsp @full_stack_dev<CR>")

View file

@ -12,8 +12,6 @@ local on_attach = function(client, bufnr)
})
end
require("lsp-inlayhints").on_attach(client, bufnr)
local telescope = require("telescope.builtin")
nnoremap("gD", vim.lsp.buf.declaration)
@ -41,8 +39,6 @@ local on_attach = function(client, bufnr)
end
end
require("lsp-inlayhints").setup({})
local lsp_status = require("lsp-status")
lsp_status.config({
current_function = false,
@ -52,21 +48,10 @@ lsp_status.config({
})
lsp_status.register_progress()
-- setup lua language server for init.nvim and nvim plugin development
require("neodev").setup({
override = function(root_dir, options)
if require("neodev.util").has_file(root_dir, "/etc/nixos") then
options.enabled = true
options.plugins = true
end
end,
})
local capabilities = require("cmp_nvim_lsp").default_capabilities(lsp_status.capabilities)
require('lazydev').setup()
local servers = {
["bashls"] = {},
["bitbake_language_server"] = {},
["clangd"] = {},
["cmake"] = {},
["dockerls"] = {},
@ -113,6 +98,7 @@ local servers = {
}
}
},
["pyright"] = {},
["texlab"] = {},
["yamlls"] = {
yaml = {

View file

@ -3,5 +3,13 @@ require('lualine').setup({
sections = {
lualine_c = { { "filename", path = 1 }, "require('lsp-status').status()" }
},
extensions = { "toggleterm" }
tabline = {
lualine_a = { 'buffers' },
lualine_z = { 'tabs' }
},
extensions = {
"fugitive",
"fzf",
"toggleterm"
}
})

View file

@ -1 +0,0 @@
require("luasnip.loaders.from_vscode").lazy_load()

View file

@ -1,87 +0,0 @@
local has_words_before = function()
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and
vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(
col, col):match("%s") == nil
end
local cmp = require("cmp")
local luasnip = require("luasnip")
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end
},
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "nvim_lsp_signature_help" },
{ name = "luasnip" },
{ name = "path" },
{ name = "buffer" },
{ name = "nvim-lua" },
{ name = "calc" },
}),
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete({}),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
}),
experimental = { ghost_text = true },
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
formatting = {
fields = { "menu", "abbr", "kind" },
format = function(entry, item)
local menu_icon = {
nvim_lsp = "λ",
luasnip = "",
buffer = "Ω",
path = "🖿",
}
item.menu = menu_icon[entry.source.name]
return item
end,
},
})
-- `/` cmdline setup.
cmp.setup.cmdline("/", {
sources = cmp.config.sources(
{ name = "buffer" }
)
})
-- `:` cmdline setup.
cmp.setup.cmdline(":", {
sources = cmp.config.sources(
{ name = "path" },
{ name = "cmdline" }
)
})

View file

@ -14,8 +14,8 @@ vim.opt.expandtab = true
-- scroll offset
vim.opt.scrolloff = 4
-- don't warp lines
vim.opt.wrap = false
-- wrap lines
vim.opt.wrap = true
-- split to right/below
vim.opt.splitright = true

View file

@ -1 +0,0 @@
require('project_nvim').setup({})

View file

@ -1 +0,0 @@
require('tabline').setup({ enable = true, options = { show_bufnr = true, show_filename_only = true } })

View file

@ -26,4 +26,3 @@ telescope.setup({
telescope.load_extension("fzf")
telescope.load_extension("ui-select")
telescope.load_extension("projects")

View file

@ -1,4 +1,4 @@
{ pkgs, user, ... }:
{ pkgs, user, lib, ... }:
{
home.username = user;
@ -13,7 +13,8 @@
thunderbird
keepassxc
light
element-desktop-wayland
# element-desktop-wayland
element-desktop
darktable
kubectl
kubectx
@ -25,6 +26,11 @@
evince
inkscape
chromium
zoom-us
];
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"zoom"
];
programs.home-manager.enable = true;
@ -34,5 +40,6 @@
./kitty.nix
./nextcloud.nix
./sway
./private/ssh.nix
];
}

19
private/ssh.nix Normal file
View file

@ -0,0 +1,19 @@
{ ... }:
{
programs = {
ssh = {
enable = true;
matchBlocks = {
tc-0x = {
host = "tc-*";
user = "root";
};
ed-0x = {
host = "ed-*";
user = "root";
};
};
};
};
}

View file

@ -1,13 +1,15 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
home.packages = with pkgs; [
devenv
difftastic
dust
htop
jq
nh
sshfs
unzip
xclip
llm
];
imports = [
@ -22,6 +24,7 @@
./rsync.nix
./shell_aliases.nix
./starship.nix
./tmux.nix
./tree.nix
./zoxide.nix
./zsh.nix

View file

@ -4,6 +4,7 @@
programs = {
direnv = {
enable = true;
silent = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};

View file

@ -7,7 +7,7 @@
gs = "git status";
gd = "git diff";
gf = "git fetch";
gfp = "git fetch --prune";
gfg = "git fetch --no-recurse-submodules && git graph --all --max-count 32";
k = "kubectl";
ww = "nvim -c VimwikiIndex";
};

28
shell/tmux.nix Normal file
View file

@ -0,0 +1,28 @@
{pkgs, ...}: {
programs = {
tmux = {
enable = true;
clock24 = true;
keyMode = "vi";
escapeTime = 0;
plugins = with pkgs.tmuxPlugins; [
tmux-colors-solarized
vim-tmux-navigator
{
plugin = power-theme;
extraConfig = ''
set -g @tmux_power_theme "colour4"
'';
}
];
terminal = "xterm-256color";
extraConfig = ''
# Terminal overrides
set-option -sa terminal-overrides ",xterm-256color:Tc"
# Reload tmux config to ensure theme is applied
bind r source-file ~/.config/tmux/tmux.conf \; display-message "Config reloaded!"
'';
};
};
}

View file

@ -1,8 +1,13 @@
{ pkgs, theme, ... }:
let
zsh_autosuggest_highlight_style = if theme == "light" then "fg=180" else "fg=10";
in
{
pkgs,
theme,
...
}: let
zsh_autosuggest_highlight_style =
if theme == "light"
then "fg=180"
else "fg=10";
in {
programs.zsh = {
enable = true;
enableCompletion = true;
@ -13,7 +18,16 @@ in
highlight = zsh_autosuggest_highlight_style;
};
initExtra = ''
initContent = ''
# Auto-start tmux if conditions are met
if [[ -z "$TMUX" && -z "$SSH_TTY" && $- == *i* ]]; then
# Check if tmux is available and terminal supports it
if command -v tmux >/dev/null 2>&1; then
# Try to attach to existing session, or create new one
exec tmux new-session -A -s default
fi
fi
function set_win_title(){
local TITLE=$(git config --get remote.origin.url || echo "$PWD")
echo -ne "\033]0; $(basename "$TITLE") \007"