Compare commits

...

303 Commits

Author SHA1 Message Date
9aec0768ae Use osc52 for every copy/paste in the terminal 2025-11-07 13:50:51 +01:00
0e83fa95e0 Add tmux get-clipboard patch 2025-11-07 12:20:32 +01:00
da06a331c4 Add slack 2025-11-07 09:50:41 +01:00
a90656fb9e Kitty remap 2025-11-07 09:20:49 +01:00
b0e4919f1a Mac improvmenets 2025-11-06 10:57:13 +01:00
a389ad81a5 Update stuff 2025-11-05 11:08:11 +01:00
d75ac8bb2e Update stuff 2025-10-30 17:07:13 +01:00
bbf687eae8 Cleanups 2025-10-29 15:58:09 +01:00
747374133e Fix taskfiel 2025-10-28 16:59:30 +01:00
c3f1877067 Disable on type formatting of biome 2025-10-26 11:41:24 +01:00
e637e48a66 Fix prompt 2025-10-26 11:41:24 +01:00
76dfcefc9a Cleanup packages 2025-10-21 19:57:50 +02:00
5342865b4e Update stuff 2025-10-21 15:11:03 +02:00
b3479548cc Update stuff 2025-10-12 16:57:28 +02:00
330ec0cb5a Remove deleted ssh key 2025-09-30 16:56:52 +02:00
2523da17f1 Add caffeinate to nix darwin 2025-09-30 16:35:28 +02:00
3a43ad343b Disable extended glob 2025-09-30 13:09:07 +02:00
835176af6b Alias copyfile instead of zsh plugin 2025-09-29 10:07:55 +02:00
20477090a8 Update stuff 2025-09-27 15:15:41 +02:00
081670cd92 Add a taskfile 2025-09-27 14:24:43 +02:00
6b4c870c40 . 2025-09-26 10:28:50 +02:00
9bed60a97e Cleanup ghostty on macos 2025-09-25 14:36:42 +02:00
7dfe71e57c toto 2025-09-25 14:36:42 +02:00
6615235f91 toto 2025-09-25 14:36:42 +02:00
cc74ea3f9a Add kc 2025-09-23 17:57:07 +02:00
1da66a323a Fix ghostty theme that got renamed 2025-09-23 17:21:35 +02:00
d5a964dd6e Fix docker compose aliases 2025-09-22 22:33:48 +02:00
9c41fb1677 Add knsc to clear ns 2025-09-22 11:31:03 +02:00
ec9f4a73ed Use kubectx instead of custom function 2025-09-22 10:33:07 +02:00
55ae0dfb59 Fix git root detection of snacks 2025-09-22 10:32:57 +02:00
b63074795a Run gfold when s is not in a git repo 2025-09-22 09:59:11 +02:00
3d8f12419e Update stuff & fix stat deps 2025-09-22 09:35:26 +02:00
2182221868 Enablel hwdec to mpv 2025-09-21 19:31:23 +02:00
f30ff13961 Fix yq with -r 2025-09-18 14:28:25 +02:00
36f81ad11c Cleanup kgy 2025-09-18 14:12:38 +02:00
2d0d502e13 Update packages 2025-09-17 11:01:54 +02:00
ffad902de5 Add move workspace up binding 2025-08-30 22:12:18 +02:00
2b3fdf82fa Add steam with gamescope destkop entry 2025-08-30 19:08:01 +02:00
8b702d04b2 Fix freecad with overlay 2025-08-30 17:26:17 +02:00
6ab50cff36 Delete unused server stuff 2025-08-30 01:28:58 +02:00
8da9e2dc9f Hand write a prompt 2025-08-29 19:56:04 +02:00
7bd6111065 Remove uwsm and use niri's sessions 2025-08-29 17:35:05 +02:00
f265cb5630 Fix kgy 2025-08-29 17:34:55 +02:00
3431868903 Add window rules 2025-08-27 11:40:33 +02:00
cce72aebd6 Try to make cmd-c work & try to allow screencats 2025-08-26 17:12:38 +02:00
dfcdeae0b2 Update things 2025-08-21 13:27:39 +02:00
63b0e3e51f Delete hyprland config 2025-08-17 12:04:16 +02:00
9b807a9ae1 Use self hosted atuin sync server 2025-08-05 00:52:33 +02:00
94b6dbb6cf Disable hot corners gesture 2025-08-04 17:00:20 +02:00
3db690d653 Fully use biome as an lsp 2025-08-04 17:00:20 +02:00
19da9716a9 Fix usql theme 2025-08-04 10:40:11 +02:00
571b859d29 Set conceallevel on copilot window 2025-08-04 01:19:13 +02:00
9eecdb8f34 Remove flood and river 2025-08-04 01:04:58 +02:00
27836f53dd Add completions to kgy and add kga 2025-08-03 17:48:36 +02:00
2f9def5d90 Bind snow shortcut 2025-08-03 01:48:51 +02:00
1c8c190b19 Fix snacks theme 2025-08-03 01:48:36 +02:00
e0da41a1c9 Add catppuccin to fcitx 2025-08-03 01:37:25 +02:00
a811dfe3aa Use catppuccin for bat and alias it to cat 2025-08-03 01:18:04 +02:00
826f71907d Decode secrets with kgy 2025-08-03 00:24:55 +02:00
f0fa3c1d77 Update stuff 2025-08-02 14:06:50 +02:00
6ce1f491a8 Add scratch function 2025-07-27 21:04:14 +02:00
94e35e9593 Add sqls 2025-07-27 20:40:34 +02:00
1532d54e5d Add sniprun 2025-07-27 01:56:17 +02:00
30f31c83ea Add usql 2025-07-27 01:56:11 +02:00
239de92695 Add c-x e in zsh 2025-07-27 00:19:00 +02:00
fa1bff94b4 Add .json.model fs extension 2025-07-25 10:02:59 +02:00
4ab5719eb7 Fix double compinit 2025-07-22 17:25:16 +02:00
e6e36b8252 Add k8s aliases 2025-07-21 15:40:34 +02:00
8e45632881 Remove render markdown plugin 2025-07-19 15:40:42 +02:00
f22d7cf9a5 Install ncat 2025-07-15 17:16:33 +02:00
127a2400b8 Remove git cherry pick advie 2025-07-15 14:46:16 +02:00
7b01b19456 Add git fixup binding on git log 2025-07-15 10:23:30 +02:00
dcf1286d78 Update stuff 2025-07-15 09:38:04 +02:00
2a0a7dd6be Enable autosave for quicker.nvim 2025-07-14 16:10:08 +02:00
e247c393a7 Theme select picker 2025-07-14 16:09:57 +02:00
7f1f556cdf Add k8s context to left prompt 2025-07-14 15:50:35 +02:00
37f5027c90 Use left/right instead of up/down for niri 2025-07-14 15:50:24 +02:00
ba3ef94fff Add git_show extension to snacks picker 2025-07-14 15:50:10 +02:00
e01a74145a Add vertical theme for snacks picker 2025-07-14 15:48:09 +02:00
53655a7529 Move snacks config 2025-07-14 15:19:09 +02:00
4554653236 Migrate from telescope to snacks.picker 2025-07-14 15:14:06 +02:00
13f09db11b Delete nvim-lint and use biome as an lsp 2025-07-14 01:57:29 +02:00
5798621279 Use higher mouse accel speed 2025-07-13 15:23:09 +02:00
d9569dadd0 Fix kubectl completions 2025-07-11 10:49:07 +02:00
66cab9fa0b Border fixes 2025-07-10 17:34:08 +02:00
3ed68a62c1 Install zsh completion sync & kubecolor 2025-07-10 16:14:19 +02:00
c3e788b8f1 Add kctx alias 2025-07-09 17:53:44 +02:00
d513d02fe6 Enable niri 2025-07-09 12:00:58 +02:00
9cee824ccb wip: Setup niri 2025-07-07 21:26:54 +02:00
bcd92724d0 Update stuff 2025-07-04 16:23:15 +02:00
a8c56008cf Add vm setup 2025-06-27 13:52:18 +00:00
d1c7cd9d79 Add macos vm 2025-06-26 17:25:56 +02:00
a60e185e65 Add coreutils to macos to have proper gnuutils 2025-06-24 10:57:53 +02:00
2986a673e3 Remove path completion in strings 2025-06-21 13:25:20 +02:00
33acf339d9 Add gdm for git diff origin/master 2025-06-20 16:33:44 +02:00
d6955bf749 Enable sudo via fingerprint 2025-06-18 17:53:38 +02:00
30f473e7dd Update stuff 2025-06-18 17:47:40 +02:00
4bf32f7854 I hate firewall 2025-06-14 16:59:38 +02:00
ed9a39d9e7 Add copilot tokens to impermanence 2025-06-14 16:59:16 +02:00
2d9e5019aa Install distrobox 2025-06-14 13:29:45 +02:00
6db830472c Add kujima's config (android) 2025-06-14 12:03:15 +02:00
dff3c72108 Add user to neworkmanager group 2025-06-14 10:59:04 +02:00
2d56b443fc Change copilot plugn 2025-06-09 20:21:26 +02:00
04e98de801 Fix roslyn 2025-06-06 15:53:09 +02:00
b8e8a9bae3 Jujutsu setup 2025-06-05 14:20:13 +02:00
b4e047a6b1 Install jj 2025-06-04 18:29:31 +02:00
57dceadca5 Switch to snacks to fix copilot issues 2025-06-04 17:27:21 +02:00
b16bf4e764 Cleanup 2025-06-04 14:52:42 +02:00
16fe91f802 Add & configure copilot agent mode 2025-06-04 14:52:16 +02:00
d80377946c Update stuff 2025-06-02 12:43:34 +02:00
f8ace1df7d Fix up/down search binds on zsh 2025-05-31 14:38:02 +02:00
dfd3c0992d Add lsof 2025-05-30 15:38:42 +02:00
f144492e57 Configure data sources in grafana 2025-05-29 17:34:28 +00:00
db63115735 Fix otel collector & loki 2025-05-29 15:32:35 +00:00
faa49e32d8 Fix tempo/loki/mimir 2025-05-29 13:23:12 +00:00
a775e51995 Update stuff 2025-05-28 16:28:41 +02:00
fb2df76e1e Set starting workspace 2025-05-26 01:05:02 +02:00
af3e59de52 wip: otel stuff 2025-05-23 21:05:10 +00:00
e3be79b0e5 Add urgent indicator with hyprland 2025-05-23 12:21:28 +02:00
3b2f18a4e3 Edit yank path keybind on oil 2025-05-21 15:36:43 +02:00
091b0cb36a Add yank action in oil 2025-05-19 15:08:03 +02:00
3a61a78c06 Fix for new nix-darwin 2025-05-19 15:07:20 +02:00
32942aa0d0 Fix hyprland rules/window orders & addback layout count 2025-05-18 21:28:20 +02:00
4e73628d6c Update ags for hyprland 2025-05-18 21:03:40 +02:00
ed8d1a7ca7 Cleanup & fix hyprland stuff 2025-05-18 19:21:32 +02:00
1c057211dd Switch to hyprland 2025-05-18 18:26:30 +02:00
0a15b4f27e Cleanup river/wm/gui modules separation 2025-05-18 16:11:50 +02:00
40c76794f8 Update stuff 2025-05-18 16:09:44 +02:00
2c4f639be0 wip otel 2025-05-16 12:57:55 +02:00
cbbd7f6535 Update stuff 2025-05-14 16:56:44 +02:00
635c5f5228 Allow leading newlines in python's sql injections 2025-05-14 10:14:48 +02:00
07008fbdc2 Add comma for nix darwin 2025-05-13 18:09:23 +02:00
8242c7e0d1 Match all sql like strings as sql 2025-05-10 03:08:41 +02:00
2de747bef4 Enable sql injection in execute functions in python 2025-05-09 20:25:27 +02:00
32e96de43f Bundle ruff in nvim closure 2025-05-09 19:52:46 +02:00
45b5e8c413 Replace colorizer with lsp's document_color 2025-05-09 19:39:11 +02:00
46f25eb193 Remove ts-comment (included in nvim core) 2025-05-09 19:22:21 +02:00
b1ab667f54 Add default settings for betterpyright (not sure if they are applied) 2025-05-09 03:11:11 +02:00
7cf467c481 Fix lsp fallback of conform 2025-05-08 00:59:42 +02:00
e743c495bb Micros*ft & oss, a love story... 2025-05-07 23:46:17 +02:00
fc803babae Update stuff 2025-05-07 21:50:45 +02:00
b9371595bb Add ruff to organize imports 2025-05-05 22:34:44 +02:00
3b39d0b576 Fuck global registries 2025-05-05 21:33:13 +02:00
9b94f4e14b Remove conflicting nix-index from hm closure 2025-05-04 22:43:26 +02:00
7db45cf96d Cleanup darwin/linux split in mksystem 2025-05-04 21:53:57 +02:00
7cb0cbbe6a Enable extendedglob & use it in dcd (zsh) 2025-05-04 20:06:01 +02:00
a2cea5dc0d Switch to vim.lsp.config & remove ltex-ls 2025-05-04 17:09:57 +02:00
2f5a78b724 Finally switch to beacon db as a geoclue backend 2025-05-04 16:21:54 +02:00
9cfddbc61f Remove "are you sure you wanna paste popup" from kitty 2025-05-02 02:35:04 +02:00
c3469efba3 Kill channels 2025-05-01 23:44:55 +02:00
0fe1354cc0 Fix udev rules for wakeup 2025-05-01 14:38:21 +02:00
a075101cd7 Update things 2025-04-28 19:50:23 +02:00
b0d1aa3578 Add grbmi 2025-04-28 19:12:37 +02:00
7c9ae829b6 Add k9s transparent theme 2025-04-28 18:13:26 +02:00
a0fa287165 Update stuff 2025-04-28 17:57:18 +02:00
e2b63a920e Add kubernetes in prompt 2025-04-28 16:36:48 +02:00
9561dafc9b Tlp didn't handle bluetooth shutdown 2025-04-22 00:09:34 +02:00
e436ab12a3 Try to disable manual powerManagement (tlp should handle that) 2025-04-21 14:30:04 +02:00
3d3633b653 Move to up/down monitor configuration 2025-04-18 12:43:29 +02:00
27734eb4a9 Update stuff 2025-04-18 12:39:05 +02:00
a396f234b6 Override nameservers 2025-04-18 12:38:53 +02:00
b0c1e2f206 Cleanup power profile stuff 2025-04-18 12:38:14 +02:00
11af4f40cf Disable git clean.requireForce 2025-04-13 21:53:54 +02:00
615ec9d1d5 Add mpris script to mpv 2025-04-12 15:43:10 +02:00
536ed15f48 Update stuff 2025-04-10 10:37:36 +02:00
d07cf5c39d Setup volty's plugin 2025-04-09 21:53:29 +02:00
f84aff95b5 Fix kitty paste and hls dependencies 2025-04-08 14:42:29 +02:00
222f0882b2 Update stuff 2025-04-06 17:33:02 +02:00
c385e9d39c Fix ghostty config on mac 2025-04-04 17:10:23 +02:00
83b1ee1ebd Update stuff 2025-04-04 11:17:20 +02:00
24dab5d47d Auto create second window in tmux's session.sh 2025-04-04 11:11:52 +02:00
ed137ac0bd Cleanup init.zsh 2025-03-29 00:01:12 +01:00
bee7994b38 Configure https->ssh rewrite for gh uris 2025-03-28 17:47:49 +01:00
c2851babb9 Remove ghostty's flake input (use nixpkgs one) 2025-03-28 11:37:02 +01:00
49638985b0 Update things 2025-03-25 09:43:07 +01:00
8d0f43f754 Make alt-d work on macos 2025-03-21 14:26:48 +01:00
b0ead6b886 Add grhho for reset to origin 2025-03-19 15:13:42 +01:00
25f01543d6 Remove libcamera workaround 2025-03-14 19:23:13 +01:00
dcb941c880 Update things (use patched htop-vim waiting for hydra) 2025-03-14 18:51:36 +01:00
fabdde1cc5 Change laptop scale to 1.6 (from 1.75) 2025-03-11 14:15:03 +01:00
6350e31036 Run CMD command (for tmux session) before zsh init 2025-03-07 16:02:03 +01:00
a21b64f0d4 Fix autocompletion 2025-03-07 16:01:52 +01:00
c6db6dd90c Add gur alias 2025-03-07 09:48:08 +01:00
a1af33abfb Update android sshkey 2025-03-07 08:46:08 +00:00
a54a2d8fc2 Ignore git in ripgrep 2025-03-06 22:59:35 +01:00
51c527d359 Add formatters to nvim's derivation 2025-03-06 12:42:37 +01:00
9631371336 Fix tmux copy mode not copying 2025-03-06 11:12:30 +01:00
ce57a99e64 Disable smooth scrolling on all electron apps 2025-03-05 15:59:24 +01:00
6886e40415 Update stuff 2025-03-05 10:54:56 +01:00
af458f6e3b Add go 2025-03-05 10:04:13 +01:00
b01261a60e Use mode 2031 instead of vim-lumen 2025-03-05 09:54:20 +01:00
6c9246abb3 Update stuff 2025-03-03 10:56:11 +01:00
40c2afc5b4 Fix git show <c-v> 2025-02-27 14:29:30 +01:00
4cb3681a3a Disable ltex-ls on some filetypes 2025-02-27 01:09:57 +01:00
d88996e01d Better git config 2025-02-27 01:04:39 +01:00
bbdc75ad33 Enable gfold 2025-02-26 19:03:35 +01:00
0461bcb59e update stuff 2025-02-23 16:01:04 +01:00
dbb3d0ae75 Add more caches to impermanence 2025-02-21 17:39:40 +01:00
6e290dcf45 Set foldmethod to syntax for git 2025-02-21 17:39:32 +01:00
f5aa4878bd Add git nuke 2025-02-21 01:05:50 +01:00
d14dd1a040 Disable spellcapcheck on non .md files 2025-02-21 01:05:32 +01:00
bc8f94a811 Make lsblk's default output readable 2025-02-21 00:34:13 +01:00
1690c0e195 Oups 2025-02-20 23:47:23 +01:00
08256daece Change download buffer size 2025-02-20 22:31:39 +00:00
6c367e0d35 Prevent transmission dir detection when manually setting it 2025-02-20 23:16:40 +01:00
8e0cd3f81f Allow ]h to target staged hunks 2025-02-20 17:54:00 +01:00
280500ef03 Add c-v & c-s mapping for commit pickers 2025-02-20 17:51:22 +01:00
c4b558686c Fix missing node dependency for yaml-ls 2025-02-20 17:23:57 +01:00
adc35c5926 Update stuff + add work dir to impermanence 2025-02-20 16:37:48 +01:00
d439a0cde0 Change ratio limits 2025-02-19 22:12:44 +01:00
8d3cf612ec Add biome to default nvim derivation 2025-02-19 19:59:44 +01:00
a6afd729bb Update darwin stuff 2025-02-19 14:12:01 +01:00
2948d795c9 Add kubebuilder to work machine 2025-02-19 14:05:55 +01:00
6841b37389 Use default ~ action on oil 2025-02-19 14:05:41 +01:00
a60aa92fe3 Cleanup disk labels & snapraid 2025-02-17 11:41:55 +00:00
e1d83060a4 Update things 2025-02-16 21:04:20 +01:00
43e630e36b Remove deprecated bindings of gitsigns 2025-02-14 22:51:32 +01:00
5283dcb4fc Pin ags to v1 2025-02-09 18:41:47 +01:00
fdbbf7a1dd Update stuff 2025-02-09 18:27:06 +01:00
66e0c96cab Fix gsettings use from systemd services (darkman) 2025-02-09 18:15:28 +01:00
509c2e7eca Specify umask for transmission 2025-02-08 01:44:26 +01:00
9b8ae1027f Install prename 2025-02-07 12:27:16 +01:00
dc7f5dea82 Fix git tag bugged display 2025-02-07 12:10:41 +01:00
c360287100 Add git fixup in telescope 2025-02-05 15:59:56 +01:00
58a4cc53d6 Add gmm 2025-02-05 15:10:56 +01:00
995426983d Install vim-rhubarb for GBrowse 2025-02-04 15:59:22 +01:00
8354c16032 Add grhhm 2025-02-03 16:21:48 +01:00
67f7d10a44 Fix natural scrolling 2025-02-03 09:42:58 +01:00
b7ae711216 Update flood fork 2025-02-02 18:04:14 +00:00
9c5664e498 Increase /tmp size on server (+ add swap) 2025-02-02 17:59:25 +00:00
43d5314f8f Use kitty by default since ghostty segf 2025-01-31 09:54:05 +01:00
cd7b554f5e Make ghostty config work on mac 2025-01-30 15:35:13 +01:00
aaa8c519e6 Fix grep of hidden (starting with a .) files 2025-01-30 15:22:25 +01:00
0b17063da0 Fix % in cmdline mode for oil 2025-01-30 10:36:08 +01:00
ff9b4f45e3 Update stuff 2025-01-29 18:05:01 +01:00
da9527ba20 Fix dotnet root 2025-01-29 16:36:00 +01:00
190e9eeb44 Add ctrl+0 on kitty also 2025-01-28 19:14:45 +01:00
4727df71a3 Fix git branches telescope picker 2025-01-28 12:33:07 +01:00
eb6432f52d Small cleanups 2025-01-25 23:22:19 +01:00
dbc0264579 Properly setup biome import 2025-01-25 16:53:39 +01:00
5cf5d46389 Add work config to flake instead of shell.nix 2025-01-23 15:29:06 +01:00
f0a5a9f541 Update stuff 2025-01-23 15:27:59 +01:00
8c78557053 Revert "Add vim-dirtytalk"
This reverts commit 0bfd2e65b7.
2025-01-23 15:26:39 +01:00
0bfd2e65b7 Add vim-dirtytalk 2025-01-23 15:26:33 +01:00
a8a8c7583e Ghostty extand bar setting 2025-01-23 15:26:23 +01:00
752531dfc1 Update things 2025-01-20 11:01:34 +01:00
df3763522b Fix tmux nested keybind mode 2025-01-19 18:44:51 +01:00
0ca6cbade3 Add site dir to rtp for spell files 2025-01-18 00:25:15 +01:00
ddc6b148c3 Use quicker.nvim for grd & gre 2025-01-18 00:12:03 +01:00
a6d84302e0 Add ]e mappings 2025-01-17 12:10:41 +01:00
c6c2cb83e3 Remake tmux config 2025-01-17 12:07:39 +01:00
037a9d217b Add basic spell checking in nvim 2025-01-17 01:14:00 +01:00
883a4cd180 Add fugtive binding 2025-01-16 18:05:39 +01:00
c3a9810ae8 Fix harppon setup 2025-01-16 18:05:30 +01:00
b5b9e4bc0a Use osc52 to copy/paste in nvim 2025-01-16 15:12:37 +01:00
595c31bee4 Bind c-a & c-e in telescope 2025-01-16 12:35:40 +01:00
985d5370cf Add --no-ignore in rg flags 2025-01-16 12:35:24 +01:00
bd3bc006e8 Prefer git root of current buffer for telescope bindings 2025-01-16 12:34:51 +01:00
e9a2cb3b68 Enable wrap 2025-01-15 22:20:51 +01:00
e8380a8302 Add cool git alias for master 2025-01-15 16:20:10 +01:00
a7705f169b Remove insecure flags for roslyn-ls 2025-01-14 15:43:11 +01:00
95ebb8375e Fix cli settings on darwin 2025-01-13 16:45:33 +01:00
85b4ad9341 Steal some wallpapers from @gmkonan 2025-01-13 12:29:11 +01:00
5f45277e30 Update stuff & remove upstreamed stuff 2025-01-13 12:28:38 +01:00
1ecfef1ea8 Unset cmd env before running it 2025-01-11 01:06:30 +01:00
2a883b5535 Fix wallpaper 2025-01-11 00:55:45 +01:00
6623a600b9 Fix harpoon binding conflict with gitsigns 2025-01-11 00:31:26 +01:00
468b7cf7fc Automatically start nvim on tmux new session 2025-01-11 00:31:13 +01:00
655e999094 Move items arround, cleanup 2025-01-10 23:52:49 +01:00
09e97bb22e Fix githunk & fugitive conflicts 2025-01-10 23:08:56 +01:00
37de1a65b3 Use ghostty's hm module 2025-01-10 23:00:20 +01:00
999b717f4e Add :ro for read only folders on prompt 2025-01-10 20:43:05 +01:00
37f08a45a6 random fixes 2025-01-09 11:56:48 +01:00
e93f107966 Add back git show telescope picker & use gedit for selections 2025-01-08 18:21:42 +01:00
182d929b7d Add git commit binding 2025-01-08 18:21:26 +01:00
0ab553a7c9 Reconfig atuin to old defaults 2025-01-08 17:34:46 +01:00
c458ab48db Add missing bashlsp 2025-01-08 17:34:28 +01:00
bc220cce86 Fix mini.splitjoin setup 2025-01-08 17:34:02 +01:00
7ca3d65b02 Handle path filters on telescope grep 2025-01-08 17:33:47 +01:00
bdb42577ba Fix autosave when exiting/suspending vim 2025-01-07 11:55:14 +01:00
48461f4901 Update stuff 2025-01-07 11:54:47 +01:00
9695fb79be Disable buffer autocomplete (execpt for comment & strings) 2025-01-07 11:54:28 +01:00
06756e60b8 Fix git conflict 2025-01-05 22:24:56 +01:00
aa5300e666 Eagerly load icons (oil issue) 2025-01-03 18:30:37 +01:00
73939399ad Lazy load more stuff 2025-01-03 18:27:23 +01:00
33e482e675 Fix diagnostic mapping 2025-01-03 18:27:07 +01:00
9ca5886a9c Use better mappings for git conflict 2025-01-03 18:26:36 +01:00
4c76f8759f Remove lazy commands handler that already exist before load 2025-01-03 18:26:18 +01:00
59ec639395 Update ghostty 2025-01-03 00:45:22 +01:00
815307d2bc Add cool git aliases 2025-01-03 00:09:34 +01:00
3856474569 Use builtin kitty auto color theme 2025-01-02 23:03:01 +01:00
3cf8b9de00 Add vim fugitive 2025-01-02 20:36:22 +01:00
4e25b64c76 Fix autosave for qf & ro comment autocmd 2025-01-02 20:36:05 +01:00
0d3b4be6a5 Use roslyn-ls instead of omnisharp 2025-01-02 17:51:37 +01:00
36e7f5c6f5 Use quicker.nvim instead of pqf 2025-01-02 15:45:07 +00:00
3764e1485f Add ssh key 2025-01-02 10:07:18 +01:00
cb2c22146c Remove dumb inccommand split 2025-01-01 22:43:04 +01:00
c685352b30 Fix blink settings 2025-01-01 22:32:23 +01:00
f8f5d61a7d Update things 2025-01-01 22:32:17 +01:00
905ca2d464 Small markdown stuff 2024-12-30 22:37:48 +01:00
e5eeaeced2 Update things 2024-12-28 02:06:11 +01:00
d2435f65cf Add config as an overlay 2024-12-28 01:36:17 +01:00
d7462353b7 Delete old nvim config 2024-12-28 01:36:04 +01:00
115 changed files with 3813 additions and 5015 deletions

2
.gitignore vendored
View File

@@ -1,3 +1,3 @@
result
log
log*
.luarc.json

View File

@@ -5,16 +5,30 @@
## Tools
- WM: river + luatile
- Widgets: ags (+ astal for river integration) + rofi (app picker + clipboard history picker)
- WM: niri
- Widgets: astal + rofi (app picker + clipboard history picker)
- Lockscreen: hyprlock (+ hypridle for loginctl/auto suspend when locked)
- Lots of cli tools
- Impermanence (everything except `~/stuff` & `~/projects` is wiped on reboot), `/` is a tmpfs.
## Nvim
## Notes for myself
- Is configured through lua
- Plugins & LSP are configured in nix
- Everything is binary compiled at build time
- Everything is packed in a single plugin to optimize the runtimepath length
- A `.luarc.json` can be generated using `nix develop`
- The config can be used from anywhere using `nix run github:zoriya/flake#nvim`
`mkdir -p /nix/persist/home` (else persisted seems to be bugged)
## Install
Format disk with:
- 200M efi part -> `mkfs.fat -F 32 -n boot /dev/sda1`
- other as linux part (/nix) -> `mkfs.ext4 -n nix /dev/sda2`
`nix-shell --run 'mkpasswd -m SHA-512' -p mkpasswd` to generate a password
```sh
nix-shell -p git go-task
git clone https://github.com/zoriya/flake
cd flake
sudo task install:host
```

View File

@@ -0,0 +1,25 @@
{
pkgs,
user,
...
}: {
imports = [
../../modules/wm
../../modules/gui
];
programs.niri.enable = true;
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${pkgs.greetd}/bin/agreety --cmd zsh";
user = "greeter";
};
initial_session = {
command = ./niri-session.sh;
user = user;
};
};
};
}

View File

@@ -0,0 +1,81 @@
{pkgs, ...}: {
imports = [
../../modules/gui/home.nix
../../modules/wm/home.nix
];
services.gnome-keyring.enable = true;
systemd.user.services.polkit-gnome-authentication-agent-1 = {
Unit = {
Description = "polkit-gnome-authentication-agent-1";
Wants = ["graphical-session.target"];
After = ["graphical-session.target"];
};
Install = {
WantedBy = ["graphical-session.target"];
};
Service = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
home.packages = with pkgs; [
pamixer
brightnessctl
playerctl
hyprpicker
gnome-control-center
gnome-weather
wdisplays
wtype
niri
];
xdg.configFile."niri/config.kdl".source = ./niri.kdl;
services.kanshi = {
enable = true;
systemdTarget = "graphical-session.target";
settings = [
{
output.criteria = "eDP-1";
output.scale = 1.6;
}
{
profile.name = "undocked";
profile.outputs = [
{
criteria = "eDP-1";
status = "enable";
}
];
}
{
profile.name = "docked";
profile.outputs = [
{
criteria = "eDP-1";
status = "disable";
}
{
criteria = "Dell Inc. DELL S2722QC 2HHZH24";
# position = "1500,0";
position = "0,900";
scale = 1.7;
}
{
criteria = "*";
position = "0,0";
scale = 1.4;
}
];
}
];
};
}

View File

@@ -0,0 +1,17 @@
#!/bin/sh
# Snippet from the official niri-session
# We remove the `import-environment` (and login shell sourcing that became useless), this is needed otherwise SHLVL gets in the systemd env and it breaks stuff
if systemctl --user -q is-active niri.service; then
echo 'A niri session is already running.'
exit 1
fi
systemctl --user reset-failed
# still need path to have things like systemctl
systemctl --user import-environment PATH
systemctl --user --wait start niri.service
systemctl --user start --job-mode=replace-irreversibly niri-shutdown.target
systemctl --user unset-environment WAYLAND_DISPLAY XDG_SESSION_TYPE XDG_CURRENT_DESKTOP NIRI_SOCKET

217
environments/niri/niri.kdl Normal file
View File

@@ -0,0 +1,217 @@
input {
keyboard {
xkb {
options "caps:escape_shifted_capslock"
}
numlock
}
touchpad {
tap
dwt
drag true
drag-lock
natural-scroll
scroll-method "two-finger"
}
mouse {
accel-speed 0.5
}
disable-power-key-handling
warp-mouse-to-focus
focus-follows-mouse max-scroll-amount="0%"
workspace-auto-back-and-forth
}
gestures {
hot-corners {
off
}
}
prefer-no-csd
cursor {
hide-when-typing
hide-after-inactive-ms 1000
}
clipboard {
disable-primary
}
hotkey-overlay {
skip-at-startup
}
layout {
gaps 16
struts {
left -16
right -16
top -16
bottom -16
}
focus-ring {
width 2
}
}
binds {
XF86AudioPlay allow-when-locked=true { spawn "playerctl" "play-pause"; }
XF86AudioPause allow-when-locked=true { spawn "playerctl" "play-pause"; }
XF86AudioMedia allow-when-locked=true { spawn "playerctl" "play-pause"; }
XF86AudioPrev allow-when-locked=true { spawn "playerctl" "previous"; }
XF86AudioNext allow-when-locked=true { spawn "playerctl" "next"; }
XF86AudioRaiseVolume allow-when-locked=true { spawn "pamixer" "-i" "5"; }
XF86AudioLowerVolume allow-when-locked=true { spawn "pamixer" "-d" "5"; }
XF86AudioMute allow-when-locked=true { spawn "pamixer" "--toggle-mute"; }
XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "s" "+5%"; }
XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "s" "5%-"; }
Mod+R { spawn "zen"; }
Mod+E { spawn "kitty"; }
Mod+P { spawn "rofi" "-show" "drun" "-show-icons" "-run-command" "{cmd}"; }
Mod+S { spawn "screenshot"; }
Mod+Control+S { spawn "screenshot-freeze"; }
Mod+Shift+S { spawn "record"; }
Super+Shift+L { spawn "loginctl" "lock-session"; }
Mod+B repeat=false { spawn "sh" "-c" "hyprpicker | wl-copy"; }
Mod+X repeat=false { spawn "wtype" "-k" "XF86Cut"; }
Mod+C repeat=false { spawn "wtype" "-k" "XF86Copy" "-s" "200ms"; }
Mod+V repeat=false { spawn "wtype" "-k" "XF86Paste"; }
Mod+Shift+V repeat=false { spawn "sh" "-c" "cliphist list | rofi -dmenu -display-columns 2 | cliphist decode | wl-copy"; }
Mod+Space repeat=false { toggle-overview; }
Mod+Q repeat=false { close-window; }
Mod+J { focus-window-up-or-column-left; }
Mod+K { focus-window-down-or-column-right; }
// TODO: add move window down or column right (need to implement those)
Mod+Shift+J { move-column-left; }
Mod+Shift+K { move-column-right; }
Mod+Home { focus-column-first; }
Mod+End { focus-column-last; }
Mod+Shift+Home { move-column-to-first; }
Mod+Shift+End { move-column-to-last; }
Mod+Comma { focus-monitor-previous; }
Mod+Period { focus-monitor-next; }
Mod+Shift+Comma { move-window-to-monitor-previous; }
Mod+Shift+Period { move-window-to-monitor-next; }
Mod+Ctrl+Shift+Comma { move-column-to-monitor-previous; }
Mod+Ctrl+Shift+Period { move-column-to-monitor-next; }
Mod+Alt+J { focus-workspace-down; }
Mod+Alt+K { focus-workspace-up; }
Mod+Alt+Shift+J { move-window-to-workspace-down; }
Mod+Alt+Shift+K { move-window-to-workspace-up; }
Mod+Alt+Ctrl+Shift+J { move-workspace-down; }
Mod+Alt+Ctrl+Shift+K { move-workspace-up; }
Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; }
Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
Mod+Shift+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
Mod+Shift+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; }
Mod+WheelScrollRight { focus-column-right; }
Mod+WheelScrollLeft { focus-column-left; }
Mod+Shift+WheelScrollRight { move-column-right; }
Mod+Shift+WheelScrollLeft { move-column-left; }
Mod+1 { focus-workspace 1; }
Mod+2 { focus-workspace 2; }
Mod+3 { focus-workspace 3; }
Mod+4 { focus-workspace 4; }
Mod+5 { focus-workspace 5; }
Mod+6 { focus-workspace 6; }
Mod+7 { focus-workspace 7; }
Mod+8 { focus-workspace 8; }
Mod+9 { focus-workspace 9; }
Mod+Shift+1 { move-window-to-workspace 1; }
Mod+Shift+2 { move-window-to-workspace 2; }
Mod+Shift+3 { move-window-to-workspace 3; }
Mod+Shift+4 { move-window-to-workspace 4; }
Mod+Shift+5 { move-window-to-workspace 5; }
Mod+Shift+6 { move-window-to-workspace 6; }
Mod+Shift+7 { move-window-to-workspace 7; }
Mod+Shift+8 { move-window-to-workspace 8; }
Mod+Shift+9 { move-window-to-workspace 9; }
Mod+Ctrl+Shift+1 { move-column-to-workspace 1; }
Mod+Ctrl+Shift+2 { move-column-to-workspace 2; }
Mod+Ctrl+Shift+3 { move-column-to-workspace 3; }
Mod+Ctrl+Shift+4 { move-column-to-workspace 4; }
Mod+Ctrl+Shift+5 { move-column-to-workspace 5; }
Mod+Ctrl+Shift+6 { move-column-to-workspace 6; }
Mod+Ctrl+Shift+7 { move-column-to-workspace 7; }
Mod+Ctrl+Shift+8 { move-column-to-workspace 8; }
Mod+Ctrl+Shift+9 { move-column-to-workspace 9; }
Mod+U { consume-window-into-column; }
Mod+I { expel-window-from-column; }
// Mod+R { switch-preset-column-width; }
// Mod+Shift+R { switch-preset-window-height; }
// Mod+Ctrl+R { reset-window-height; }
Mod+D { toggle-column-tabbed-display; }
Mod+M { maximize-column; }
Mod+F { fullscreen-window; }
Mod+Shift+F { toggle-window-floating; }
Mod+Alt+F { switch-focus-between-floating-and-tiling; }
Mod+Z { center-column; }
Mod+Ctrl+Z { center-visible-columns; }
Mod+H { set-column-width "-5%"; }
Mod+L { set-column-width "+5%"; }
// Applications such as remote-desktop clients and software KVM switches may
// request that niri stops processing the keyboard shortcuts defined here
// so they may, for example, forward the key presses as-is to a remote machine.
// It's a good idea to bind an escape hatch to toggle the inhibitor,
// so a buggy application can't hold your session hostage.
//
// The allow-inhibiting=false property can be applied to other binds as well,
// which ensures niri always processes them, even when an inhibitor is active.
Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
}
workspace "emtpy" {
open-on-output "Dell Inc. DELL S2722QC 2HHZH24"
}
workspace "chat" {
open-on-output "Dell Inc. DELL S2722QC 2HHZH24"
}
workspace "work" {
open-on-output "Dell Inc. DELL S2722QC 2HHZH24"
}
window-rule {
match at-startup=true
open-on-output "Dell Inc. DELL S2722QC 2HHZH24"
open-on-workspace "work"
open-maximized true
open-focused false
}
window-rule {
match app-id="discord"
match app-id="vesktop"
match app-id="com.github.th_ch.youtube_music"
open-on-workspace "chat"
}
// from wiki, move steam notifications to a corner
window-rule {
match app-id="steam" title=r#"^notificationtoasts_\d+_desktop$"#
default-floating-position x=10 y=10 relative-to="bottom-right"
}
spawn-at-startup "wallpaper"
spawn-at-startup "ags"
spawn-at-startup "kitty"
spawn-at-startup "zen"
spawn-at-startup "hyprlock" "--immediate"

View File

@@ -1,64 +0,0 @@
{
pkgs,
user,
lib,
...
}: {
imports = [
../../modules/wm
];
programs.uwsm = {
enable = true;
waylandCompositors = {
river = {
prettyName = "river";
comment = "river compositor managed by UWSM";
binPath = "${pkgs.river}/bin/river";
};
};
};
services.greetd = {
enable = true;
settings = {
default_session = {
command = "${pkgs.greetd.greetd}/bin/agreety --cmd zsh";
user = "greeter";
};
initial_session = {
command = "uwsm start -S river-uwsm.desktop";
user = user;
};
};
};
# Without this, greetd would depend on graphical.target & would get activated before
# uwsm. This leads to a race that can:
# - fail startup & retry it (leading to a ~10s delay)
# - make graphical services start before river.
# To prevent those issue, simply target the default tty & greetd's inital_session will
# start uwsm & end up reaching graphical.target
# systemd.defaultUnit = lib.mkForce "multi-user.target";
xdg.portal = {
enable = true;
wlr.enable = true;
# gtk portal needed to make gtk apps happy
extraPortals = [pkgs.xdg-desktop-portal-gtk];
config.common.default = "*";
};
environment.systemPackages = with pkgs; [
wineWowPackages.stable
wineWowPackages.waylandFull
winetricks
];
hardware.steam-hardware.enable = true;
programs.gamescope.enable = true;
services.flatpak.enable = true;
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;
}

View File

@@ -1,247 +0,0 @@
{
pkgs,
config,
...
}: let
cliphist = "${pkgs.cliphist}/bin/cliphist";
screenshot = pkgs.writeShellApplication {
name = "screenshot";
runtimeInputs = [pkgs.slurp pkgs.grim];
text = ''
grim -g "$(slurp -b 00000000 -s 61616140)" - | wl-copy
'';
};
screenshot-freeze = pkgs.writeShellApplication {
name = "screenshot-freeze";
runtimeInputs = [pkgs.slurp pkgs.grim pkgs.wayfreeze];
text = ''
# shellcheck disable=SC2016
wayfreeze --after-freeze-cmd ''\'grim -g "$(slurp -b 00000000 -s 61616140)" - | wl-copy; killall wayfreeze''\'
'';
};
record = pkgs.writeShellApplication {
name = "record";
runtimeInputs = [pkgs.slurp pkgs.wf-recorder];
text = ''
pkill wf-recorder && exit
wf-recorder -g "$(slurp -b 00000000 -s 61616140)" -f "$HOME/rec-$(date +%Y-%m-%d_%H:%M:%S).mp4"
'';
};
common_binds = {
"None XF86AudioRaiseVolume" = "spawn '${pkgs.pamixer}/bin/pamixer -i 5'";
"None XF86AudioLowerVolume" = "spawn '${pkgs.pamixer}/bin/pamixer -d 5'";
"None XF86AudioMute" = "spawn '${pkgs.pamixer}/bin/pamixer --toggle-mute'";
"None XF86AudioMedia" = "spawn '${pkgs.playerctl}/bin/playerctl play-pause'";
"None XF86AudioPlay" = "spawn '${pkgs.playerctl}/bin/playerctl play-pause'";
"None XF86AudioPause" = "spawn '${pkgs.playerctl}/bin/playerctl play-pause'";
"None XF86AudioPrev" = "spawn '${pkgs.playerctl}/bin/playerctl playerctl previous'";
"None XF86AudioNext" = "spawn '${pkgs.playerctl}/bin/playerctl playerctl next'";
"None XF86MonBrightnessUp" = "spawn '${pkgs.brightnessctl}/bin/brightnessctl s +5%'";
"None XF86MonBrightnessDown" = "spawn '${pkgs.brightnessctl}/bin/brightnessctl s 5%-'";
};
in {
imports = [
../../modules/gui
../../modules/wm/home.nix
];
services.cliphist.enable = true;
systemd.user.services.cliphist.Unit.After = "graphical-session.target";
systemd.user.services.cliphist-images.Unit.After = "graphical-session.target";
xdg.configFile."river-luatile/layout.lua".source = ./layout.lua;
wayland.windowManager.river = {
enable = true;
extraSessionVariables = {
XDG_CURRENT_DESKTOP = "river";
};
settings = {
default-layout = "luatile";
spawn = [
"${pkgs.river-luatile}/bin/river-luatile"
"wallpaper"
"ags"
];
default-attach-mode = "top";
focus-follows-cursor = "normal";
set-cursor-warp = "on-focus-change";
hide-cursor = {
when-typing = true;
};
set-repeat = "25 600";
keyboard-layout = "-options 'caps:escape_shifted_capslock' us";
input = {
"'*'" = {
events = true;
accel-profile = "adaptive";
pointer-accel = 0;
click-method = "button-areas";
tap = true;
drag = true;
disable-while-typing = true;
middle-emulation = true;
natural-scroll = true;
tap-button-map = "left-right-middle";
scroll-method = "two-finger";
};
"'*Mouse'" = {
natural-scroll = "disabled";
};
};
# border-color-focused = "0x94e2d5";
# border-color-unfocused = "0x00000000";
# border-color-urgent = "0xcba6f7";
border-width = 0;
rule-add = {
"-app-id" = {
"discord" = "tags $((1 << 2))";
"vesktop" = "tags $((1 << 2))";
"'YouTube Music'" = "tags $((1 << 1))";
# disable all client side decorations
"'*'" = "ssd";
};
};
declare-mode = ["normal" "locked" "passthrough"];
map = {
normal =
{
"Super+Shift Q" = "exit";
"Super C" = "close";
"Super K" = "focus-view next";
"Super J" = "focus-view previous";
"Super+Shift K" = "swap previous";
"Super+Shift J" = "swap previous";
"Super Return" = "zoom";
"Super Period" = "focus-output next";
"Super Comma" = "focus-output previous";
"Super+Shift Period" = "send-to-output -current-tags next";
"Super+Shift Comma" = "send-to-output -current-tags previous";
"Super+Control+Shift Period" = "send-to-output next";
"Super+Control+Shift Comma" = "send-to-output previous";
"Super H" = "send-layout-cmd luatile 'set_mfact(-0.05)'";
"Super L" = "send-layout-cmd luatile 'set_mfact( 0.05)'";
"Super U" = "send-layout-cmd luatile 'set_mcount(-1)'";
"Super I" = "send-layout-cmd luatile 'set_mcount( 1)'";
"Super T" = "send-layout-cmd luatile 'set_layout(\"tiling\")'";
"Super M" = "send-layout-cmd luatile 'set_layout(\"monocle\")'";
"Super D" = "send-layout-cmd luatile 'set_layout(\"deck\")'";
"Super F" = "toggle-fullscreen";
"Super+Shift F" = "toggle-float";
"Super R" = "spawn 'uwsm app -- ${config.home.sessionVariables.BROWSER}'";
"Super E" = "spawn 'uwsm app -- ${config.home.sessionVariables.TERMINAL}'";
"Super P" = ''spawn 'rofi -show drun -show-icons -run-command "uwsm app -- {cmd}"' '';
"Super X" = "spawn '${screenshot}/bin/screenshot'";
"Super+Control X" = "spawn '${screenshot-freeze}/bin/screenshot-freeze'";
"Super+Shift X" = "spawn 'uwsm app -- ${record}/bin/record'";
"Super B" = "spawn '${pkgs.hyprpicker}/bin/hyprpicker | wl-copy'";
"Super V" = "spawn '${cliphist} list | rofi -dmenu -display-columns 2 | ${cliphist} decode | wl-copy'";
"Super+Shift L" = "spawn 'loginctl lock-session'";
"Super+Shift Backslash" = "enter-mode passthrough";
}
// common_binds;
locked = common_binds;
passthrough = {
"Super+Shift Backslash" = "enter-mode normal";
};
};
map-pointer = {
normal = {
"Super+Shift BTN_LEFT" = "move-view";
"Super+Shift BTN_RIGHT" = "resize-view";
};
};
};
extraConfig = ''
for i in $(seq 1 9)
do
tags=$((1 << (i - 1)))
riverctl map normal Super "$i" set-focused-tags -alternate $tags
riverctl map normal Super+Shift "$i" set-view-tags $tags
riverctl map normal Super+Control "$i" toggle-focused-tags $tags
riverctl map normal Super+Shift+Control "$i" toggle-view-tags $tags
done
all_tags=$(((1 << 32) - 1))
riverctl map normal Super 0 set-focused-tags -alternate "$all_tags"
riverctl map normal Super+Shift 0 set-view-tags "$all_tags"
# Focus second screen by default (also spawn apps there)
riverctl focus-output DP-1
riverctl set-focused-tags $((1 << 3))
${pkgs.uwsm}/bin/uwsm finalize DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE
hyprlock --immediate
'';
# we use uwsm instead.
systemd.enable = false;
};
home.packages = with pkgs; [
gnome-control-center
gnome-weather
wdisplays
];
services.kanshi = {
enable = true;
systemdTarget = "graphical-session.target";
settings = [
{
output.criteria = "eDP-1";
output.scale = 1.75;
}
{
profile.name = "undocked";
profile.outputs = [
{
criteria = "eDP-1";
status = "enable";
}
];
}
{
profile.name = "docked";
profile.outputs = [
{
criteria = "eDP-1";
status = "disable";
}
{
criteria = "Dell Inc. DELL S2722QC 2HHZH24";
position = "1500,0";
scale = 1.7;
}
{
criteria = "*";
position = "0,0";
scale = 1.4;
}
];
}
];
};
dconf.settings = {
"org/gnome/desktop/interface" = {
cursor-blink = false;
};
# Disable close/resize buttons on GTK windows that really want CSD.
# gsettings set org.gnome.desktop.wm.preferences button-layout ""
"org/gnome/desktop/wm/preferences" = {
button-layout = "";
};
};
}

View File

@@ -1,174 +0,0 @@
---@diagnostic disable: lowercase-global, undefined-global
local inner_gaps = 10
local outer_gaps = 15
local smart_gaps = true
local outputs = {}
function _get_output(name)
local output = outputs[name]
if output ~= nil then
return output
end
outputs[name] = {
mfact = 0.65,
mcount = 1,
layout = "tiling",
alayout = "monocle"
}
return outputs[name]
end
-- The most important function - the actual layout generator
--
-- The argument is a table with:
-- * Focused tags (`args.tags`)
-- * Window count (`args.count`)
-- * Output width (`args.width`)
-- * Output height (`args.height`)
-- * Output name (`args.output`)
--
-- The return value must be a table with exactly `count` entries. Each entry is a table with four
-- numbers:
-- * X coordinate
-- * Y coordinate
-- * Window width
-- * Window height
--
-- This example is a simplified version of `rivertile`
function handle_layout(args)
local output = _get_output(args.output)
-- Prevent mcount from growing too much. We can't do that in the set function.
output.mcount = math.min(output.mcount, args.count)
local ret = {}
if args.count == 1 or output.layout == "monocle" then
if smart_gaps then
for _ = 0, (args.count - 1) do
table.insert(ret, { 0, 0, args.width, args.height })
end
else
for _ = 0, (args.count - 1) do
table.insert(ret, { outer_gaps, outer_gaps, args.width - outer_gaps * 2, args.height - outer_gaps * 2 })
end
end
return ret
end
local width = args.width - outer_gaps * 2
local height = args.height - outer_gaps * 2
local mcount = math.min(output.mcount, args.count)
local scount = math.max(args.count - mcount, 0)
local old_scount = scount
if output.layout == "deck" and scount > 0 then
scount = 1;
end
local main_w = (width * output.mfact) - (inner_gaps / 2)
local side_w = (width * (1 - output.mfact)) - (inner_gaps / 2)
local main_h = (height - (inner_gaps * (mcount - 1))) / mcount
local side_h = (height - (inner_gaps * (scount - 1))) / scount
scount = old_scount
if args.count <= output.mcount then
main_w = width
end
for i = 0, (mcount - 1) do
table.insert(ret, {
outer_gaps,
outer_gaps + i * (main_h + inner_gaps),
main_w,
main_h,
})
end
for i = 0, (scount - 1) do
local y = outer_gaps + i * (side_h + inner_gaps)
if output.layout == "deck" then
y = outer_gaps
end
table.insert(ret, {
main_w + outer_gaps * 2,
y,
side_w,
side_h,
})
end
return ret
end
-- This optional function returns the metadata for the current layout.
-- Currently only `name` is supported, the name of the layout. It get's passed
-- the same `args` as handle_layout()
function handle_metadata(args)
local output = _get_output(args.output)
if output.layout == "tiling" then
return { name = "[]=" }
elseif output.layout == "monocle" then
return { name = string.format("[%d]", args.count) }
elseif output.layout == "deck" then
return { name = "[D]" }
else
return { name = "><>" }
end
end
-- IMPORTANT: User commands send via `riverctl send-layout-cmd` are treated as lua code.
-- Active tags are stored in `CMD_TAGS` global variable.
-- Output name is stored in `CMD_OUTPUT` global variable.
-- Here is an example of a function that can be mapped to some key
-- Run with `riverctl send-layout-cmd luatile "toggle_gaps()"`
function set_mfact(diff)
local output = _get_output(CMD_OUTPUT)
output.mfact = math.max(0, math.min(output.mfact + diff, 1))
end
function set_mcount(diff)
local output = _get_output(CMD_OUTPUT)
-- we don't have the number of clients so we can't set a max value there.
output.mcount = math.max(0, output.mcount + diff)
end
function set_layout(name)
local output = _get_output(CMD_OUTPUT)
if output.layout == name then
output.layout = output.alayout
output.alayout = name
else
output.alayout = output.layout
output.layout = name
end
end
-- Just an helper function to print tables.
function inspect(tbl)
local result = "{"
for k, v in pairs(tbl) do
-- Check the key type (ignore any numerical keys - assume its an array)
if type(k) == "string" then
result = result .. "[\"" .. k .. "\"]" .. "="
end
-- Check the value type
if type(v) == "table" then
result = result .. inspect(v)
elseif type(v) == "boolean" then
result = result .. tostring(v)
else
result = result .. "\"" .. v .. "\""
end
result = result .. ","
end
-- Remove leading commas from the result
if result ~= "" then
result = result:sub(1, result:len() - 1)
end
return result .. "}"
end

View File

@@ -1,210 +0,0 @@
{
pkgs,
lib,
...
}: let
guesspath = pkgs.stdenv.mkDerivation rec {
name = "guesspath";
nativeBuildInputs = with pkgs; [makeWrapper];
propagatedBuildInputs = with pkgs; [
python3Packages.guessit
transmission_4
];
dontUnpack = true;
installPhase = "
install -Dm755 ${./guesspath.sh} $out/bin/guesspath
wrapProgram $out/bin/guesspath --prefix PATH : '${lib.makeBinPath propagatedBuildInputs}'
";
};
smartrss = pkgs.stdenv.mkDerivation rec {
name = "smartrss";
nativeBuildInputs = with pkgs; [makeWrapper];
propagatedBuildInputs = with pkgs; [
python3Packages.guessit
curl
jq
];
dontUnpack = true;
installPhase = "
install -Dm755 ${./smartrss.sh} $out/bin/smartrss
wrapProgram $out/bin/smartrss --prefix PATH : '${lib.makeBinPath propagatedBuildInputs}'
";
};
in {
# Make it use predictable interface names starting with eth0
boot.kernelParams = ["net.ifnames=0"];
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
};
};
programs.mosh.enable = true;
services.fail2ban = {
enable = true;
bantime = "5w";
ignoreIP = [
"192.168.0.0/16"
];
maxretry = 5;
};
# virtualisation.oci-containers.containers."watchtower" = {
# autoStart = true;
# image = "containrrr/watchtower";
# volumes = [
# "/var/run/docker.sock:/var/run/docker.sock"
# ];
# environment = {
# WATCHTOWER_CLEANUP = "true";
# WATCHTOWER_POLL_INTERVAL = "86400";
# };
# };
networking.firewall.allowedTCPPorts = [80 443];
services.nginx = {
enable = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts."kyoo.sdg.moe" = {
enableACME = true;
forceSSL = true;
locations."/robots.txt" = {
extraConfig = ''
rewrite ^/(.*) $1;
return 200 "User-agent: *\nDisallow: /";
'';
};
locations."/" = {
proxyPass = "http://localhost:8901";
proxyWebsockets = true;
extraConfig = "proxy_pass_header Authorization;";
};
};
virtualHosts."flood.sdg.moe" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://localhost:3000";
proxyWebsockets = true;
extraConfig = "proxy_pass_header Authorization;";
};
};
virtualHosts."git.sdg.moe" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://localhost:4789";
proxyWebsockets = true;
extraConfig = "proxy_pass_header Authorization;";
};
};
# virtualHosts."suwayomi.sdg.moe" = {
# enableACME = true;
# forceSSL = true;
# locations."/" = {
# proxyPass = "http://localhost:4677";
# proxyWebsockets = true;
# extraConfig = "proxy_pass_header Authorization;";
# };
# };
virtualHosts."reader.sdg.moe" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://localhost:2345";
proxyWebsockets = true;
extraConfig = "proxy_pass_header Authorization;";
};
};
virtualHosts."proxy.sdg.moe" = {
enableACME = true;
addSSL = true;
locations."/" = {
proxyPass = "http://localhost:5000";
proxyWebsockets = true;
extraConfig = ''
proxy_pass_header Authorization;
add_header Access-Control-Allow-Origin *;
'';
};
};
};
security.acme = {
acceptTerms = true;
defaults.email = "zoe.roux@zoriya.dev";
};
services.transmission = {
enable = true;
package = pkgs.transmission_4;
# Make downloaded items readable/writtable by users
group = "users";
settings = {
incomplete-dir-enabled = false;
download-dir = "/mnt/kyoo/downloads";
download-queue-enabled = false;
rename-partial-files = false;
trash-can-enabled = false;
ratio-limit-enabled = true;
ratio-limit = 1;
script-torrent-added-enabled = true;
script-torrent-added-filename = "${guesspath}/bin/guesspath";
};
};
# Also allows transmission to reach thoses files
systemd.services.transmission.serviceConfig.BindPaths = [
"/mnt/kyoo/downloads"
"/mnt/kyoo/shows"
"/mnt/kyoo/lives"
"/mnt/kyoo/manga"
];
systemd.services.flood = {
enable = true;
wantedBy = ["multi-user.target"];
after = ["transmission.service"];
requires = ["transmission.service"];
path = with pkgs; [mediainfo smartrss];
serviceConfig = {
ExecStart = "${pkgs.flood}/bin/flood --rundir=/var/lib/flood --trurl=http://127.0.0.1:9091/transmission/rpc --truser '' --trpass ''";
User = "transmission";
Restart = "on-failure";
};
};
services.gitea = {
enable = true;
settings.server = rec {
DOMAIN = "sdg.moe";
ROOT_URL = "https://git.${DOMAIN}/";
HTTP_PORT = 4789;
DISABLE_SSH = true;
};
};
# services.suwayomi-server = {
# enable = true;
# settings.server = {
# port = 4677;
# # basicAuthEnabled = true;
# # basicAuthUsername = "zoriya";
# # basicAuthPasswordFile = ../../password/zoriya;
# extensionRepos = ["https://raw.githubusercontent.com/keiyoushi/extensions/repo/index.min.json"];
# downloadAsCbz = true;
# };
# dataDir = "/mnt/kyoo/manga";
# };
}

View File

@@ -1,19 +0,0 @@
#!/usr/bin/env bash
set -e
OUT=/mnt/kyoo/shows
if [[ ! -z "$TR_TORRENT_LABELS" ]]; then
echo "Ignoring $TR_TORRENT_NAME since it has labels $TR_TORRENT_LABELS"
exit
fi
echo "Running with $TR_TORRENT_NAME $TR_TORRENT_ID"
name=$TR_TORRENT_NAME
dir=$(guessit "$name" -P "title")
echo "Guessed '$dir' for torrent '$name'"
transmission-remote -t "$TR_TORRENT_ID" --move "$OUT/$dir"
# TODO: support multi-files torrent (currently wrapped in an usless directory)

View File

@@ -1,50 +0,0 @@
{
pkgs,
lib,
...
}: let
gitea-mirror = pkgs.stdenv.mkDerivation rec {
name = "gitea-mirror";
nativeBuildInputs = with pkgs; [makeWrapper];
propagatedBuildInputs = with pkgs; [
curl
jq
coreutils
];
dontUnpack = true;
installPhase = "
install -Dm755 ${./mirror.sh} $out/bin/gitea-mirror
wrapProgram $out/bin/gitea-mirror --prefix PATH : '${lib.makeBinPath propagatedBuildInputs}'
";
};
in {
systemd.user.timers."gitea-mirror" = {
Unit = {
Description = "Mirror github repo to gitea";
};
Install = {
WantedBy = ["timers.target"];
};
Timer = {
OnCalendar = "daily";
Persistent = true;
Unit = "gitea-mirror.service";
};
};
systemd.user.services."gitea-mirror" = {
Unit = {
Description = "Mirror github repo to gitea";
After = ["network.target"];
};
Service = {
Type = "oneshot";
ExecStart = toString (pkgs.writeShellScript "gitea-sync" ''
set -eou pipefail
export GITEA_URL="https://git.sdg.moe"
export ACCESS_TOKEN=$(< ~/stuff/gitea-access-token)
export GITHUB_TOKEN=$(${pkgs.gh}/bin/gh auth token)
exec ${gitea-mirror}/bin/gitea-mirror -m user -u zoriya
'');
};
};
}

View File

@@ -1,255 +0,0 @@
#!/usr/bin/env bash
# Stollen from https://github.com/maxkratz/github2gitea-mirror
# License: https://github.com/maxkratz/github2gitea-mirror/blob/master/LICENSE
# Script to mirror GitHub repos to a Gitea instance.
#
# Modes:
# - Mirror a public/private repo
# - Mirror all public/private repos of a user
# - Mirror all starred repos by a user
# - Mirror all public/private repos of an organization
#
# Heavily inspired by:
# https://github.com/juergenhoetzel/github2gitea-mirror
#
# ENVs:
# ACCESS_TOKEN = Gitea token
# GITERA_URL = Gitea URL
# GITHUB_TOKEN = GitHub personal access token
# Displays the given input including "=> " on the console.
log () {
echo "=> $1"
}
CURL="curl -f -S -s"
# Check for correctly set ENVs
# ACCESS_TOKEN and GITEA_URL are always necessary
if [[ -z "${ACCESS_TOKEN}" || -z "${GITEA_URL}" ]]; then
echo -e "Please set the Gitea access token and URL in environment:\nexport ACCESS_TOKEN=abc\nexport GITEA_URL=http://gitea:3000\n" >&2
echo -e "Don't use a trailing slash in URL!"
exit 1
fi
# Parse input arguments
if [[ -z "$1" ]]; then
log "No parameter(s) given. Exit."
exit 1
fi
while [[ "$#" -gt 0 ]]; do
case $1 in
-m|--mode) mode="$2"; shift ;;
-o|--org) gitea_organization="$2"; shift ;;
-u|--user) github_user="$2"; shift ;;
-v|--visibility) visibility="$2"; shift ;;
-r|--repo) repo="$2"; shift ;;
*) log "Unknown parameter passed: $1"; exit 1 ;;
esac
shift
done
# Prints a message on how to use the script with exit 1
fail_print_usage () {
echo -e "Usage: $0"
echo -e " -m, --mode {org,star,repo,user} Mode to use; either mirror an organization or mirror all starred repositories."
echo -e " -o, --org \$organization GitHub organization to mirror and/or the target organization in Gitea."
echo -e " -u, --user \$github_user GitHub user to gather the starred repositories from."
echo -e " -v, --visibility {public,private} Visibility for the created Gitea organization."
echo -e " -r, --repo \$repo_url GitHub URL of a single repo to create a mirror for."
echo "" >&2
exit 1;
}
# Check if mode is set
if [[ -z "${mode}" ]]; then
fail_print_usage
fi
# Check required parameters per mode
if [ "${mode}" == "org" ]; then
if [[ -z "${gitea_organization}" ]]; then
echo -e "Organization not set."
fail_print_usage
fi
if [[ -z "${visibility}" ]]; then
echo -e "Visibility not set."
fail_print_usage
fi
elif [ "${mode}" == "star" ]; then
if [[ -z "${gitea_organization}" || -z "${github_user}" ]]; then
echo -e "Organization or GitHub user not set."
fail_print_usage
fi
elif [ "${mode}" == "repo" ]; then
if [[ -z "${repo}" || -z "${github_user}" ]]; then
echo -e "Repo URL or GitHub user not set."
fail_print_usage
fi
elif [ "${mode}" == "user" ]; then
if [[ -z "${github_user}" ]]; then
echo -e "GitHub user not set."
fail_print_usage
fi
else
echo -e "Mode not found."
fail_print_usage
fi
# TODO:
#set -euo pipefail
set -eu pipefail
header_options=(-H "Authorization: Bearer ${ACCESS_TOKEN}" -H "accept: application/json" -H "Content-Type: application/json")
jsonoutput=$(mktemp -d -t github-repos-XXXXXXXX)
trap "rm -rf ${jsonoutput}" EXIT
# Sets the uid to the specified Gitea organization
set_uid() {
uid=$($CURL "${header_options[@]}" $GITEA_URL/api/v1/orgs/${gitea_organization} | jq .id)
}
# Sets the uid to the specified Gitea user
set_uid_user() {
uid=$($CURL "${header_options[@]}" $GITEA_URL/api/v1/users/${github_user} | jq .id)
}
# Fetches all starred repos of the given user to JSON files
fetch_starred_repos() {
log "Fetch starred repos."
i=1
# GitHub API just returns empty arrays instead of 404
while $CURL "https://api.github.com/users/${github_user}/starred?page=${i}&per_page=100" >${jsonoutput}/${i}.json \
&& (( $(jq <${jsonoutput}/${i}.json '. | length') > 0 )) ; do
(( i++ ))
done
}
# Fetches all public/private repos of the given GitHub organization to JSON files
fetch_orga_repos() {
log "Fetch organization repos."
i=1
# GitHub API just returns empty arrays instead of 404
while $CURL "https://api.github.com/orgs/${gitea_organization}/repos?page=${i}&per_page=100" -u "username:${GITHUB_TOKEN}" >${jsonoutput}/${i}.json \
&& (( $(jq <${jsonoutput}/${i}.json '. | length') > 0 )) ; do
(( i++ ))
done
}
# Fetches all public/private repos of the given GitHub user to JSON files
fetch_user_repos() {
log "Fetch user repos."
i=1
# GitHub API just returns empty arrays instead of 404
while $CURL "https://api.github.com/user/repos?affiliation=owner&page=${i}&per_page=100" -u "${github_user}:${GITHUB_TOKEN}" >${jsonoutput}/${i}.json \
&& (( $(jq <${jsonoutput}/${i}.json '. | length') > 0 )) ; do
(( i++ ))
done
}
# Fetches one public/private GitHub repo to a JSON file
fetch_one_repo() {
log "Fetch one repo."
# Remove URL prefix
repo=$(echo $repo | sed "s/https:\/\/github.com\///g" | sed "s/.git//g")
$CURL "https://api.github.com/repos/$repo" -u "username:${GITHUB_TOKEN}" >${jsonoutput}/1.json
}
# Creates a specific migration repo on Gitea
create_migration_repo() {
log "Create migration repo."
if ! $CURL -w "%{http_code}\n" "${header_options[@]}" -d @- -X POST $GITEA_URL/api/v1/repos/migrate > ${jsonoutput}/result.txt 2>${jsonoutput}/stderr.txt; then
local code=$(<${jsonoutput}/result.txt)
if (( code != 409 ));then # 409 == repo already exits
cat ${jsonoutput}/stderr.txt >&2
fi
fi
}
# Creates a specific public/private organization on Gitea
create_migration_orga() {
visibility="${1:-}"
log "Create migration orga with name: ${gitea_organization}"
if ! $CURL -X POST $GITEA_URL/api/v1/orgs "${header_options[@]}" --data '{"username": "'"${gitea_organization}"'", "visibility": "'"${visibility}"'"}' > ${jsonoutput}/result.txt 2>${jsonoutput}/stderr.txt; then
local code=$(<${jsonoutput}/result.txt)
if (( code != 422 ));then # 422 == orga already exits
cat ${jsonoutput}/stderr.txt >&2
fi
fi
}
# Creates a migration repo on Gitea for each GitHub repo in the JSON files
repos_to_migration() {
log "Repos to migration started."
for f in ${jsonoutput}/*.json; do
n=$(jq '. | length'<$f)
if [[ "${n}" -gt "0" ]]; then
(( n-- )) # last element
else
continue;
fi
for i in $(seq 0 $n); do
mig_data=$(jq ".[$i] | .uid=${uid} | \
if(.visibility==\"private\") then .private=true else .private=false end |\
if(.visibility==\"private\") then .auth_username=\"${github_user}\" else . end | \
if(.visibility==\"private\") then .auth_password=\"${GITHUB_TOKEN}\" else . end | \
.mirror=true | \
.clone_addr=.clone_url | \
.description=.description[0:255] | \
.repo_name=.name | \
{uid,repo_name,clone_addr,description,mirror,private,auth_username,auth_password}" <$f)
echo "Migrating repo" $(jq ".[$i] | .uid=${uid} | .name" <$f)
echo $mig_data | create_migration_repo
done
done
}
# Creates one migration repo on Gitea for the one GitHub repo in '1.json'
one_repo_to_migration() {
log "One repo to migration started."
# There should only be one JSON file
for f in ${jsonoutput}/*.json; do
mig_data=$(jq ".repo_owner=\"${github_user}\" | \
if(.visibility==\"private\") then .private=true else .private=false end |\
if(.visibility==\"private\") then .auth_username=\"${github_user}\" else . end | \
if(.visibility==\"private\") then .auth_password=\"${GITHUB_TOKEN}\" else . end | \
.mirror=true | \
.clone_addr=.clone_url | \
.description=.description[0:255] | \
.repo_name=.name | \
{repo_owner,repo_name,clone_addr,description,mirror,private,auth_username,auth_password}" <$f)
echo "Migrating repo" $(jq ".name" <$f)
echo $mig_data | create_migration_repo
done
}
# Actual run the script
if [ "${mode}" == "org" ]; then
log "Mode = organization"
fetch_orga_repos
create_migration_orga ${visibility}
set_uid
repos_to_migration
elif [ "${mode}" == "repo" ]; then
log "Mode = single repo"
fetch_one_repo
one_repo_to_migration
elif [ "${mode}" == "star" ]; then
log "Mode = starred repos"
set_uid
fetch_starred_repos
repos_to_migration
elif [ "${mode}" == "user" ]; then
log "Mode = user"
set_uid_user
fetch_user_repos
repos_to_migration
fi
log "Finished."

View File

@@ -0,0 +1,114 @@
{pkgs, ...}: {
services.opentelemetry-collector = {
enable = true;
package = pkgs.opentelemetry-collector-contrib;
configFile = ./otelcol.yaml;
};
services.mimir = {
enable = true;
configuration = {
multitenancy_enabled = false;
server = {
http_listen_port = 1880;
grpc_listen_port = 9095;
};
};
};
services.loki = {
enable = true;
configuration = {
auth_enabled = false;
server = {
http_listen_port = 1881;
grpc_listen_port = 9096;
};
storage_config = {
filesystem = {
directory = "/var/lib/loki/chunks";
};
};
common = {
path_prefix = "/var/lib/loki";
ring = {
kvstore = {
store = "inmemory";
};
};
};
schema_config = {
configs = [
{
from = "2020-05-15";
store = "tsdb";
object_store = "filesystem";
schema = "v13";
index = {
prefix = "index_";
period = "24h";
};
}
];
};
};
};
services.tempo = {
enable = true;
settings = {
server = {
http_listen_port = 1882;
grpc_listen_port = 9097;
};
storage = {
trace = {
backend = "local";
local = {
path = "/var/lib/tempo";
};
wal = {
path = "/var/lib/tempo/wal";
};
};
};
};
};
services.grafana = {
enable = true;
settings = {
server = {
http_addr = "127.0.0.1";
http_port = 1892;
domain = "grafana.sdg.moe";
};
};
provision = {
enable = true;
datasources.settings.datasources = [
{
name = "mimir";
type = "prometheus";
url = "http://localhost:1880/prometheus";
isDefault = false;
jsonData = {
prometheusType = "Mimir";
};
}
{
name = "loki";
type = "loki";
url = "http://localhost:1881";
isDefault = true;
}
{
name = "tempo";
type = "tempo";
url = "localhost:1882";
isDefault = false;
}
];
};
};
}

View File

@@ -0,0 +1,50 @@
receivers:
otlp:
protocols:
grpc:
endpoint: localhost:4318
auth:
authenticator: basicauth/server
http:
endpoint: localhost:4319
auth:
authenticator: basicauth/server
extensions:
basicauth/server:
htpasswd:
inline: |
otel-user:thisissecretpleasedontuseit
processors:
batch:
exporters:
otlp/mimir:
endpoint: localhost:9095
tls:
insecure: true
otlp/loki:
endpoint: localhost:9096
tls:
insecure: true
otlp/tempo:
endpoint: localhost:9097
tls:
insecure: true
service:
extensions: [basicauth/server]
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [otlp/tempo]
metrics:
receivers: [otlp]
processors: [batch]
exporters: [otlp/mimir]
logs:
receivers: [otlp]
processors: [batch]
exporters: [otlp/loki]

View File

@@ -1,9 +0,0 @@
#!/usr/bin/env bash
set -e
name=$(guessit "$1" -P title | tr -d "[:punct:]")
ls /mnt/kyoo/shows/ | tr -d "[:punct:]" | grep -qix "$name"
echo "Downloading $1"
exit 80

View File

@@ -1,7 +1,7 @@
{lib, ...}: {
imports = [
# Install apps that I open with wslg (and tools like wl-clipboard which works)
../../modules/gui
../../modules/gui/home.nix
];
gtk.enable = lib.mkForce false;

523
flake.lock generated
View File

@@ -1,81 +1,13 @@
{
"nodes": {
"astal": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1735329054,
"narHash": "sha256-YHBIouh51UieVL5KHmdlQGaO/7wEgjpkyXnXLHaPJBo=",
"owner": "aylur",
"repo": "astal",
"rev": "661b14cc893c5be17a4fce8fa269074785f57a36",
"type": "github"
},
"original": {
"owner": "aylur",
"repo": "astal",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"lastModified": 1761588595,
"narHash": "sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1733328505,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_4": {
"flake": false,
"locked": {
"lastModified": 1733328505,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5",
"type": "github"
},
"original": {
@@ -92,11 +24,11 @@
]
},
"locked": {
"lastModified": 1733312601,
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
"lastModified": 1762040540,
"narHash": "sha256-z5PlZ47j50VNF3R+IMS9LmzI5fYRGY/Z5O5tol1c9I4=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
"rev": "0010412d62a25d959151790968765a70c436598b",
"type": "github"
},
"original": {
@@ -105,175 +37,6 @@
"type": "github"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"neovim-nightly",
"hercules-ci-effects",
"nixpkgs"
]
},
"locked": {
"lastModified": 1733312601,
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
"type": "github"
},
"original": {
"id": "flake-parts",
"type": "indirect"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"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"
}
},
"flood": {
"flake": false,
"locked": {
"lastModified": 1730892065,
"narHash": "sha256-z8PKXKx3eWinq9Lx2mDjn163dWsmizYJLIqI5tEpdik=",
"owner": "zoriya",
"repo": "flood",
"rev": "6571624b7200556bc5637c4e08d361500c1aa6a4",
"type": "github"
},
"original": {
"owner": "zoriya",
"repo": "flood",
"type": "github"
}
},
"ghostty": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs-stable": [
"nixpkgs"
],
"nixpkgs-unstable": [
"nixpkgs"
],
"zig": "zig"
},
"locked": {
"lastModified": 1735335581,
"narHash": "sha256-D7AnTrsZLlC67ixT+djxolTSnM8zVcL1P/ZjTqfhpAY=",
"ref": "refs/heads/main",
"rev": "bee21880149129f9373a35e9df0d39c223481709",
"revCount": 8511,
"type": "git",
"url": "ssh://git@github.com/mitchellh/ghostty"
},
"original": {
"type": "git",
"url": "ssh://git@github.com/mitchellh/ghostty"
}
},
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat_3",
"gitignore": "gitignore",
"nixpkgs": [
"neovim-nightly",
"nixpkgs"
],
"nixpkgs-stable": [
"neovim-nightly",
"nixpkgs"
]
},
"locked": {
"lastModified": 1734797603,
"narHash": "sha256-ulZN7ps8nBV31SE+dwkDvKIzvN6hroRY8sYOT0w+E28=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "f0f0dc4920a903c3e08f5bdb9246bb572fcae498",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"neovim-nightly",
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"hercules-ci-effects": {
"inputs": {
"flake-parts": "flake-parts_2",
"nixpkgs": [
"neovim-nightly",
"nixpkgs"
]
},
"locked": {
"lastModified": 1733333617,
"narHash": "sha256-nMMQXREGvLOLvUa0ByhYFdaL0Jov0t1wzLbKjr05P2w=",
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
"rev": "56f8ea8d502c87cf62444bec4ee04512e8ea24ea",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@@ -281,11 +44,11 @@
]
},
"locked": {
"lastModified": 1735053786,
"narHash": "sha256-Gm+0DcbUS338vvkwyYWms5jsWlx8z8MeQBzcnIDuIkw=",
"lastModified": 1762266885,
"narHash": "sha256-THnfl16UGSjMXdDQZwIuFuDJj+tYjUHAl9w/DNpkuAw=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "35b98d20ca8f4ca1f6a2c30b8a2c8bb305a36d84",
"rev": "c39c07bf31dc080851377c04352fa06f197f0c1c",
"type": "github"
},
"original": {
@@ -296,11 +59,11 @@
},
"impermanence": {
"locked": {
"lastModified": 1734945620,
"narHash": "sha256-olIfsfJK4/GFmPH8mXMmBDAkzVQ1TWJmeGT3wBGfQPY=",
"lastModified": 1737831083,
"narHash": "sha256-LJggUHbpyeDvNagTUrdhe/pRVp4pnS6wVKALS782gRI=",
"owner": "nix-community",
"repo": "impermanence",
"rev": "d000479f4f41390ff7cf9204979660ad5dd16176",
"rev": "4b3e914cdf97a5b536a889e939fb2fd2b043a170",
"type": "github"
},
"original": {
@@ -309,40 +72,20 @@
"type": "github"
}
},
"lz-nvim": {
"flake": false,
"locked": {
"lastModified": 1735151625,
"narHash": "sha256-XROyv0DgH+1ZWA7Z+OdNd41ufqtl8PoAfwZtSjPFem0=",
"owner": "zoriya",
"repo": "lz.n",
"rev": "e9ee565439706d86b4dd63e20aef1fc231e0570b",
"type": "github"
},
"original": {
"owner": "zoriya",
"repo": "lz.n",
"type": "github"
}
},
"neovim-nightly": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-parts": "flake-parts",
"git-hooks": "git-hooks",
"hercules-ci-effects": "hercules-ci-effects",
"neovim-src": "neovim-src",
"nixpkgs": [
"nixpkgs"
],
"treefmt-nix": "treefmt-nix"
]
},
"locked": {
"lastModified": 1735172062,
"narHash": "sha256-Ru+5fwMqXEoc6G1PbuTppAzxtqvj0322cBAWCb0Yhbo=",
"lastModified": 1762214689,
"narHash": "sha256-rRIECim04sRqCeBCvuARPLyDezGa7CU4XKAkCx4mmqA=",
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
"rev": "d05e1d754812bcd89925d845992f377faf6c4944",
"rev": "928ecc3c71ef85227c25cf0ff3bfba1efd9b1930",
"type": "github"
},
"original": {
@@ -354,11 +97,11 @@
"neovim-src": {
"flake": false,
"locked": {
"lastModified": 1735157560,
"narHash": "sha256-ndlWdGm61W3uObi8cowWqnPdJwq2FsH4GHGOQYeNSOM=",
"lastModified": 1762151025,
"narHash": "sha256-5XdkjVsB8LbqTUMmOmK3YscnCVm7yHenKoaKrgFESac=",
"owner": "neovim",
"repo": "neovim",
"rev": "487c48ec8689b865bad04fdb87b61f5ada25da97",
"rev": "b80d390765b0c987f86ecd257fa8c38cc1225797",
"type": "github"
},
"original": {
@@ -374,11 +117,11 @@
]
},
"locked": {
"lastModified": 1735218083,
"narHash": "sha256-MoUAbmXz9TEr7zlKDRO56DBJHe30+7B5X7nhXm+Vpc8=",
"lastModified": 1762186368,
"narHash": "sha256-dzLBZKccS0jMefj+WAYwsk7gKDluqavC7I4KfFwVh8k=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "bc03f7818771a75716966ce8c23110b715eff2aa",
"rev": "69921864a70b58787abf5ba189095566c3f0ffd3",
"type": "github"
},
"original": {
@@ -394,11 +137,11 @@
]
},
"locked": {
"lastModified": 1735222882,
"narHash": "sha256-kWNi45/mRjQMG+UpaZQ7KyPavYrKfle3WgLn9YeBBVg=",
"lastModified": 1762055842,
"narHash": "sha256-Pu1v3mlFhRzZiSxVHb2/i/f5yeYyRNqr0RvEUJ4UgHo=",
"owner": "nix-community",
"repo": "nix-index-database",
"rev": "7e3246f6ad43b44bc1c16d580d7bf6467f971530",
"rev": "359ff6333a7b0b60819d4c20ed05a3a1f726771f",
"type": "github"
},
"original": {
@@ -407,13 +150,31 @@
"type": "github"
}
},
"nixos-avf": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1761791238,
"narHash": "sha256-KAfIkokYx86S62nfIxzPvCtSrNJIIqWNeBCbtLLb/LM=",
"owner": "nix-community",
"repo": "nixos-avf",
"rev": "9142152e9fd1a18e003605465bc5cd060261edc8",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixos-avf",
"type": "github"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1734954597,
"narHash": "sha256-QIhd8/0x30gEv8XEE1iAnrdMlKuQ0EzthfDR7Hwl+fk=",
"lastModified": 1762267440,
"narHash": "sha256-WHjEJ80oYbWyNu0dxysBs5oMlBc5w7YYzL1/UPj4iGo=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "def1d472c832d77885f174089b0d34854b007198",
"rev": "2e85ae1b7030df39269d29118b1f74944d0c8f15",
"type": "github"
},
"original": {
@@ -425,18 +186,17 @@
},
"nixos-wsl": {
"inputs": {
"flake-compat": "flake-compat_4",
"flake-utils": "flake-utils_2",
"flake-compat": "flake-compat",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1733854371,
"narHash": "sha256-K9qGHniYBbjqVcEiwXyiofj/IFf78L5F0/FCf+CKyr0=",
"lastModified": 1762251193,
"narHash": "sha256-CmSddz8e2kM+ITbYutluhKZyXXwI9Sg2lf7XXSvc8oY=",
"owner": "nix-community",
"repo": "NixOS-WSL",
"rev": "dee4425dcee3149475ead0cb6a616b8a028c5888",
"rev": "e001844d4553aef268f97b32d3a825b6370eed91",
"type": "github"
},
"original": {
@@ -447,11 +207,27 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1735291276,
"narHash": "sha256-NYVcA06+blsLG6wpAbSPTCyLvxD/92Hy4vlY9WxFI1M=",
"lastModified": 1757545623,
"narHash": "sha256-mCxPABZ6jRjUQx3bPP4vjA68ETbPLNz9V2pk9tO7pRQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "634fd46801442d760e09493a794c4f15db2d0cbb",
"rev": "8cd5ce828d5d1d16feff37340171a98fc3bf6526",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1762111121,
"narHash": "sha256-4vhDuZ7OZaZmKKrnDpxLZZpGIJvAeMtK6FKLJYUtAdw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b3d51a0365f6695e7dd5cdf3e180604530ed33b4",
"type": "github"
},
"original": {
@@ -460,106 +236,34 @@
"type": "indirect"
}
},
"river-src": {
"flake": false,
"locked": {
"lastModified": 1734359263,
"narHash": "sha256-wD8GSFBZLeCjAbHAT6WXlgM+X/o39Loxt5xjI4qKGWo=",
"owner": "zoriya",
"repo": "river",
"rev": "ebdbaaeb6c6006165cd18120b60e8dd114e78bae",
"type": "github"
},
"original": {
"owner": "zoriya",
"ref": "0.3.x",
"repo": "river",
"type": "github"
}
},
"root": {
"inputs": {
"astal": "astal",
"flood": "flood",
"ghostty": "ghostty",
"home-manager": "home-manager",
"impermanence": "impermanence",
"lz-nvim": "lz-nvim",
"neovim-nightly": "neovim-nightly",
"nix-darwin": "nix-darwin",
"nix-index-database": "nix-index-database",
"nixos-avf": "nixos-avf",
"nixos-hardware": "nixos-hardware",
"nixos-wsl": "nixos-wsl",
"nixpkgs": "nixpkgs",
"river-src": "river-src",
"vim-lumen": "vim-lumen",
"nixpkgs": "nixpkgs_2",
"tmux": "tmux",
"zen-browser": "zen-browser"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"neovim-nightly",
"nixpkgs"
]
},
"locked": {
"lastModified": 1735135567,
"narHash": "sha256-8T3K5amndEavxnludPyfj3Z1IkcFdRpR23q+T0BVeZE=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "9e09d30a644c57257715902efbb3adc56c79cf28",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"vim-lumen": {
"tmux": {
"flake": false,
"locked": {
"lastModified": 1726782166,
"narHash": "sha256-rsDUDI9lh4CEX1upMBjeyBOm99GAXWGPQ9vSCN8cmFo=",
"owner": "vimpostor",
"repo": "vim-lumen",
"rev": "ac13c32c3e309f6c6a84ff6cad8dbb135e75f0e4",
"lastModified": 1762171266,
"narHash": "sha256-Ze/CXFGvf3H25gCqlPsVCm+0WNwj1A9qqNSwzICFewQ=",
"owner": "tmux",
"repo": "tmux",
"rev": "815f7ecffbf5e7f6daecb3ce6e550bdb32b0d887",
"type": "github"
},
"original": {
"owner": "vimpostor",
"repo": "vim-lumen",
"owner": "tmux",
"repo": "tmux",
"type": "github"
}
},
@@ -567,72 +271,19 @@
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"zen-browser-aarch64": "zen-browser-aarch64",
"zen-browser-x86_64": "zen-browser-x86_64"
},
"locked": {
"lastModified": 1735099614,
"narHash": "sha256-FCQFeOhVg/SNOCdryvxVd/5eLqwXwVr6/48Xyh7wpwU=",
"owner": "youwen5",
"repo": "zen-browser-flake",
"rev": "3e4af3607e303a88169782471a082857a3e80162",
"type": "github"
},
"original": {
"owner": "youwen5",
"repo": "zen-browser-flake",
"type": "github"
}
},
"zen-browser-aarch64": {
"flake": false,
"locked": {
"lastModified": 1735043335,
"narHash": "sha256-nuGSRzwBloFwgNCIbc5xv3vGkiHQxzOQr4FUX4Cip7Y=",
"type": "tarball",
"url": "https://github.com/zen-browser/desktop/releases/download/1.0.2-b.5/zen.linux-aarch64.tar.bz2"
},
"original": {
"type": "tarball",
"url": "https://github.com/zen-browser/desktop/releases/download/1.0.2-b.5/zen.linux-aarch64.tar.bz2"
}
},
"zen-browser-x86_64": {
"flake": false,
"locked": {
"lastModified": 1735049411,
"narHash": "sha256-sS9phyr97WawxB2AZAwcXkvO3xAmv8k4C8b8Qw364PY=",
"type": "tarball",
"url": "https://github.com/zen-browser/desktop/releases/download/1.0.2-b.5/zen.linux-x86_64.tar.bz2"
},
"original": {
"type": "tarball",
"url": "https://github.com/zen-browser/desktop/releases/download/1.0.2-b.5/zen.linux-x86_64.tar.bz2"
}
},
"zig": {
"inputs": {
"flake-compat": [
"ghostty"
],
"flake-utils": "flake-utils",
"nixpkgs": [
"ghostty",
"nixpkgs-stable"
]
},
"locked": {
"lastModified": 1717848532,
"narHash": "sha256-d+xIUvSTreHl8pAmU1fnmkfDTGQYCn2Rb/zOwByxS2M=",
"owner": "mitchellh",
"repo": "zig-overlay",
"rev": "02fc5cc555fc14fda40c42d7c3250efa43812b43",
"lastModified": 1761883599,
"narHash": "sha256-ntnfAAqSuXI/+uqXAWUjbY5arB7sRK9cpgFbHbCZgK8=",
"owner": "youwen5",
"repo": "zen-browser-flake",
"rev": "5355c0dc6857a2aa34b126fb4a93a454ed702f52",
"type": "github"
},
"original": {
"owner": "mitchellh",
"repo": "zig-overlay",
"owner": "youwen5",
"repo": "zen-browser-flake",
"type": "github"
}
}

144
flake.nix
View File

@@ -11,6 +11,11 @@
url = "github:nix-community/NixOS-WSL";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-avf.url = "github:nix-community/nixos-avf";
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
@@ -19,38 +24,13 @@
url = "github:nix-community/neovim-nightly-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
ghostty = {
url = "git+ssh://git@github.com/mitchellh/ghostty";
inputs.nixpkgs-stable.follows = "nixpkgs";
inputs.nixpkgs-unstable.follows = "nixpkgs";
};
flood = {
url = "github:zoriya/flood";
flake = false;
};
astal = {
url = "github:aylur/astal";
inputs.nixpkgs.follows = "nixpkgs";
};
river-src = {
url = "github:zoriya/river/0.3.x";
flake = false;
};
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
zen-browser = {
url = "github:youwen5/zen-browser-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
lz-nvim = {
url = "github:zoriya/lz.n";
flake = false;
};
vim-lumen = {
url = "github:vimpostor/vim-lumen";
# use tmux's master for mode 2031
tmux = {
url = "github:tmux/tmux";
flake = false;
};
};
@@ -64,17 +44,32 @@
overlays = {
nixpkgs.overlays = [
(import ./overlays inputs)
neovim-nightly.overlays.default
nvim-overlay
];
};
mkSystem = import ./lib/mksystem.nix (inputs // {inherit overlays inputs;});
eachSystem = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
nvim-overlay = final: prev:
import ./nvim (inputs
// {
pkgs = prev.pkgs;
lib = nixpkgs.lib;
});
in {
nixosConfigurations.fuhen = mkSystem "fuhen" {
env = "river";
env = "niri";
custom = [
nixos-hardware.nixosModules.tuxedo-infinitybook-pro14-gen7
{
services.sshd.enable = true;
}
];
customHome = [
({pkgs, ...}: {
home.packages = with pkgs; [slack];
})
];
};
@@ -82,18 +77,8 @@
env = "server";
};
nixosConfigurations.kadan = mkSystem "kadan" {
env = "server";
custom = [
({pkgs, ...}: {
environment.systemPackages = with pkgs; [
python3Packages.guessit
mediainfo
yt-dlp
mkvtoolnix-cli
];
})
];
nixosConfigurations.virtual = mkSystem "virtual" {
env = "niri";
};
nixosConfigurations.lucca = mkSystem "lucca" {
@@ -101,43 +86,88 @@
wsl = true;
};
nixosConfigurations.kujima = mkSystem "kujima" {
env = "none";
system = "aarch64-linux";
avf = true;
};
darwinConfigurations."zroux-mac" = mkSystem "zroux-mac" {
env = "none";
user = "zroux";
system = "aarch64-darwin";
darwin = true;
custom = [
{
# waiting for gnupg agents to be ported
system.primaryUser = "zroux";
}
];
customHome = [
./modules/gui/ghostty.nix
({pkgs, ...}: let
dotnet = with pkgs.dotnetCorePackages;
combinePackages [
sdk_9_0
sdk_8_0
aspnetcore_9_0
aspnetcore_8_0
];
in {
home.packages = with pkgs; [
nodejs
volta
dotnet
dotnet-ef
csharprepl
kubernetes-helm
colima
kubelogin-oidc
kustomize
docker_28
kubebuilder
sqlcmd
go
];
home.sessionVariables = {
DOTNET_ROOT = "${dotnet}/share/dotnet";
DOTNET_HOST_ROOT = "${dotnet}/share/dotnet";
};
})
];
};
packages = eachSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
vim = import ./nvim (inputs
// {
inherit pkgs;
lib = nixpkgs.lib;
});
pkgs = import nixpkgs {
inherit system;
overlays = [nvim-overlay];
};
in rec {
default = nvim;
nvim = vim.nvim;
nvim = pkgs.nvim;
});
devShells = eachSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
vim = import ./nvim (inputs
// {
inherit pkgs;
lib = nixpkgs.lib;
});
pkgs = import nixpkgs {
inherit system;
overlays = [nvim-overlay];
};
in rec {
default = nvim-lua;
default = pkgs.mkShell {
inputsFrom = [nvim-lua];
packages = with pkgs; [go-task];
};
nvim-lua = pkgs.mkShell {
name = "nvim-lua";
shellHook = ''
ln -fs ${vim.luarc} .luarc.json
ln -fs ${pkgs.nvim-luarc} .luarc.json
'';
};
});
overlays = rec {
default = nvim;
nvim = nvim-overlay;
};
};
}

View File

@@ -12,7 +12,22 @@
boot.initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
# powersave settings
boot = {
kernelParams = [
"pcie_aspm.policy=powersave"
# enable hardware accel (not powersave settings)
"i915.enable_guc=2"
];
extraModprobeConfig = ''
options snd_hda_intel power_save=1
'';
kernel.sysctl = {
"kernel.nmi_watchdog" = 0;
"vm.dirty_writeback_centisecs" = 6000;
};
};
fileSystems."/" = {
device = "none";
@@ -54,10 +69,6 @@
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
boot.kernelParams = [
"i915.enable_guc=2"
];
hardware.graphics = {
enable = true;
enable32Bit = true;

View File

@@ -1,143 +0,0 @@
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"];
boot.kernelModules = ["kvm-intel" "coretemp" "nct6775"];
boot.extraModulePackages = [config.boot.kernelPackages.nvidia_x11];
boot.blacklistedKernelModules = ["nouveau"];
fileSystems."/" = {
device = "none";
fsType = "tmpfs";
options = ["size=2G" "mode=755"];
};
fileSystems."/tmp" = {
device = "none";
fsType = "tmpfs";
options = ["size=4G" "mode=755"];
};
fileSystems."/nix" = {
device = "/dev/disk/by-label/kadan";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "vfat";
};
fileSystems."/mnt/a" = {
device = "/dev/disk/by-label/sda";
fsType = "ext4";
};
fileSystems."/mnt/c" = {
device = "/dev/disk/by-label/sdc";
fsType = "ext4";
};
fileSystems."/mnt/d" = {
device = "/dev/disk/by-label/sdd";
fsType = "ext4";
};
fileSystems."/mnt/parity" = {
device = "/dev/disk/by-label/parity";
fsType = "ext4";
};
environment.systemPackages = with pkgs; [mergerfs];
fileSystems."/mnt/kyoo" = {
device = "/mnt/a:/mnt/c:/mnt/d";
depends = ["/mnt/a" "/mnt/c" "/mnt/d"];
fsType = "fuse.mergerfs";
options = [
"func.getattr=newest" # For kyoo's scanner
"cache.files=partial" # To enable mmap (used by rtorrent)
"dropcacheonclose=true"
"category.create=mfs"
];
};
services.snapraid = {
enable = true;
exclude = [
"*.unrecoverable"
"/tmp/"
"/lost+found/"
];
dataDisks = {
a = "/mnt/a/";
c = "/mnt/c/";
d = "/mnt/d/";
};
contentFiles = [
"/var/snapraid.content"
"/mnt/a/snapraid.content"
"/mnt/c/snapraid.content"
"/mnt/d/snapraid.content"
];
parityFiles = [
"/mnt/parity/snapraid.parity"
];
};
swapDevices = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
#networking.interfaces.eno1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.graphics = {
enable = true;
enable32Bit = true;
extraPackages = with pkgs; [vaapiVdpau];
};
# Load nvidia driver for Xorg and Wayland
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia-container-toolkit.enable = true;
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
powerManagement.enable = true;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Do not disable this unless your GPU is unsupported or if you have a good reason to.
open = false;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
system.stateVersion = "23.05";
}

View File

@@ -0,0 +1,5 @@
{lib, ...}: {
system.stateVersion = "25.11";
environment.persistence."/nix/persist".enable = false;
services.automatic-timezoned.enable = lib.mkForce false;
}

View File

@@ -0,0 +1,54 @@
{ lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "virtio_pci" "usbhid" "usb_storage" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "none";
fsType = "tmpfs";
options = ["size=8G" "mode=755"];
};
fileSystems."/tmp" = {
device = "none";
fsType = "tmpfs";
options = ["size=32G" "mode=755"];
};
fileSystems."/nix" =
{ device = "/dev/disk/by-label/nix";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-label/boot";
fsType = "vfat";
options = ["umask=007"];
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s1.useDHCP = lib.mkDefault true;
environment.systemPackages = with pkgs; [ kdePackages.konsole ];
services.spice-vdagentd.enable = true;
services.spice-autorandr.enable = true;
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
system.stateVersion = "25.05";
}

View File

@@ -8,6 +8,7 @@
system ? "x86_64-linux",
wsl ? false,
darwin ? false,
avf ? false,
custom ? [],
customHome ? [],
}: let
@@ -47,24 +48,13 @@ in
openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDGcLP/ZEjnSgkzQMBeLLOWn5uejSr9Gg1h9PJZECVTLm+VDQ7KyI3ORZt+qbfEnsnGL73iwcAqB5Upy9Cdj0182mnrTk2ZViNMeFT7kLBF0yXpiajQTtMjENYj0nbNWpQ5+sJrtJKKYK/tBghW8PyTrJPpVQcrLcf4D66U5DkkJNRDeu4v9SjHKaASUeyia4gRSVV59Ugtrl0lz8sl4yBSL4957zwzdkNR0pVmftaKmUP4KfBvpNcFOOpHcdvzDtEPQs8j0g2l65YOQNNFSMsYQfxt1X4zmEi4unRIlECglaPz12CyoTiM2xmCWa/mS5nm0dR1VbEHFMRtGbbgm9MwedXoxYAfycbu08fqi1AAvg7MQxDNLfWWBIHe7+imGLKrVkqk8B89I409iI4YiOytnUkxKZkxynqVYtEE0bx5J15mniq2vJTw9JD89qSVkvGjZNGuJgh4leIlxPGj4iP8KY3N3Ifaf72PsmmwW4rB5JPDW93RL1DZV8lk3NgyF8M= zoriya@fuhen" # laptop
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCpQ8Td98YIS0EtVQ7xabYVe9A9/+ZECrHBpKi01NKQ0Mleg9Z4fnTsdGFX1uhbG6Pu7niBVzYReVTC1CbyVWKmm/4DbbRpaqY94eOzQEe0p4wMSURQ9weuB5737k+5MuLDLUbhc1ytDa84Ubj/A/rQUueKdq2K1o+YSN7b7HKe7kXoXACEpbrSCC43mteBgCtvgsLY0New9xXnvGFJPSe7PcjYkOhSJB1xA0Gu4DoDdOyErvV62QQH4sSQMu5cFICJGfdXQzBdshA8MgWKXFv3Hq7K5/GGDNyCsMxeoPQET3vbmgUsE+KGtcdqizdFM3bAfCBGXOBx6h7BoNuQzkp8hgmrq62CmMwF0krX05Sb3qR/wVjRKDo9pYuSk6/awnnBp5kY6sNgEruI93ZXNQWMkxXQNbmpCi+uEvzMveP16O/uP3NxklD4wtmfpSZsxBi+jRGFqcjdy3Qlc13Tiz98EBaXkir9YwUAh8SNs3gRaJGI0Fn2HzUCPH0zNh42EY8= zoriya@kadan" # server
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCnPn6ga4tsJfdyGyft9RnJJmSvlGLn/rJuLsWwFHtxHwdcOolZEAn2zrLqOo1Fty44lrWJ62KLOJ+eZVt4rfREBWd+esttTY2BbhrjvRThKsst1RJdWjFXI3xny7v48mMG8PKjTCkXom2Y/wfLKRpeaNJyCgauUNdDFXuiwiMmIEGXN/WE6LfWBg2XbPWilMLEVm6pwXf3lGtaS0QxhIQ/OIdx5XfUKS6lUfRq9Ki6FbsSQ60ejRtKmjbqY93KNQPUBAJnJHgDDX2+pkrSKiNHBjFH5/HZJTSRdpumaqO0E+HZRSEbR/aKRvshUN0SO/59pvrqb1ARF6CG2X0k0A+jTag0N7SyLwHEJ8J/bl43zm0JWenfAPMuhzQqAv3Vw4i13u8mgHf+ng7ClDo1ms5K7e/XXZV7Asb6orkuslZCO2QR3WgfmbUU03r89aG7Eg58ZeGMP57CoEcMAVah20to4iPm5HPy/Ej0JznFXXjRW4z+/DZDvWhFtsjIkalqQCU= u0_a369@localhost" # android
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDJ/c2rQ9xUI6XpDR/+dmCK5IcxkOIezvNtbC2EVTrfh73H5juotME6JrQSxgQjtgsaUAzZzrac9kI/7Do8/lisbofdKRcneXi2UEeERKrKEwC/EGcQgqnoPLL1+mnqwvQ923d3105DV4hFksoDbblCinFuUr5s55EMm991IL/T70cy820AOgAf+hgleM1Its47EBkZBzpa4KwxYepJG0+kBa7K1Loi9QgBvTGpxs7rWMDxllfL6ivrWJxAKRZdWlJ/MKBVQIYhv0W+vaQ7OZA1qUY4bq/9wY/i88nixbVSPJmikj0+QNeLksU78bOIxLpTTeLdH4HQ6+qKOBT3JhEpBtUHdBxOT5tYJTr4qwjevlFqceLw3x1V9URxPS2XBDjlxnzYzdnD40LK5BehXdmElGio9dy98/qJINbDW/7AH+BpP1GWNKVhiYXPj7A/2fkFD2K7DgIgGlsrZthS+LxDTEcQ8Yx0iD/+nI8LcnvU42S0muSvmP7LE4xBl8AoaI0= zoriya@nixos" # lucca windows
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB/TujCSbUueF4p3wbzImPkEvgJjshDfh2sb/bwGdaRN" # bitwarden
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBzfKjYeQ80s/M+qEKCxBhseJjLa2OwBk9ZrHeku90Vg zoriya@kujima" # android
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCq7uaYigZWAhk/EIn9SHd6mhWJHtYPRFCUlpYwGSG6SDW2Ef0epsYJL2hBuMhhmhOvmpzzKiP83hZjNXchq8u7xcAhLsCPdPXhrQ4kOScJaeLuoxyY/7wiOqTSvSwz/N2s9tdNNcOLLUAset1Kvyp1OPBkEuXbIFfRGGqwAwcS2YYimlHf9mpcg/tZujBYQHIetHQkMaO+P0h+vMjVHBBcFLcsao+1QsVjoQnZOE96QTf2Oc66SxDBXnyS+1y1OnlWAEslSDL9AXVl6wF4O1JBWcsKNk+X4ShaaJMFRiPJEDQKSqRMKXWflkdFe1vNQ0bSiA6TLeH1lPeT8PXye2sUhu/DhpEswB7sV9YPpiP216QGsVM/2MepjCRq2sdr4EZ/17tubYdNcO8PkhVlQWOhHWXvIwIrvAzOVG1l9laAL1mxAY2iQLLN/gHGFPuiLcZCBem2LrDLQ7Ny+rDYQe4jZMEX4NYzNgNbHPk1ecwj/fqeLM4Qn+TkQgUL/kSM3ZU= zroux@zroux-mac" # lucca mac
];
};
})
(
if (!darwin)
then {
users.users.root.hashedPassword = builtins.readFile ../password/root;
users.users.${user} = {
isNormalUser = true;
hashedPassword = builtins.readFile ../password/${user};
extraGroups = ["wheel" "input" "docker" "audio" "mlocate" "libvirtd"];
};
}
else {}
)
../hosts/${hostname}/hardware-configuration.nix
home-manager.home-manager
@@ -78,13 +68,34 @@ in
[
../modules/cli/home.nix
(../environments + "/${env}/home.nix")
inputs.nix-index-database.hmModules.nix-index
]
++ customHome;
};
};
}
]
++ nixpkgs.lib.optionals (!darwin)
[
inputs.nix-index-database.nixosModules.nix-index
{
users.users.root.hashedPassword = builtins.readFile ../password/root;
users.users.${user} = {
isNormalUser = true;
hashedPassword = builtins.readFile ../password/${user};
extraGroups = [
"wheel"
"input"
"docker"
"audio"
"mlocate"
"libvirtd"
"networkmanager"
];
};
networking.nameservers = ["1.1.1.1" "9.9.9.9"];
networking.resolvconf.extraConfig = "name_servers=\"1.1.1.1 9.9.9.9\"";
}
]
++ nixpkgs.lib.optionals wsl [
inputs.nixos-wsl.nixosModules.wsl
({pkgs, ...}: {
@@ -103,5 +114,24 @@ in
};
})
]
++ nixpkgs.lib.optionals avf [
inputs.nixos-avf.nixosModules.avf
{
avf.defaultUser = user;
}
]
++ nixpkgs.lib.optionals darwin [
inputs.nix-index-database.darwinModules.nix-index
({pkgs, ...}: {
environment.systemPackages = with pkgs; [
coreutils
];
# auth sudo via fingerprint
security.pam.services.sudo_local = {
reattach = true;
touchIdAuth = true;
};
})
]
++ custom;
}

View File

@@ -1,10 +1,8 @@
# Common file for both nixos and nix-darwin
{pkgs, ...}: {
{pkgs, lib, ...}: {
imports = [
./nix.nix
./nix/nix.nix
];
nix.package = pkgs.nix;
services.nix-daemon.enable = true;
programs.gnupg.agent = {
enable = true;
@@ -22,6 +20,7 @@
];
programs.zsh.enable = true;
programs.nix-index-database.comma.enable = true;
environment.shells = with pkgs; [zsh];
documentation = {
@@ -31,4 +30,34 @@
};
info.enable = true;
};
launchd.user.agents.caffeinate = {
command = "${pkgs.darwin.PowerManagement}/bin/caffeinate -diu";
serviceConfig = {
KeepAlive = true;
RunAtLoad = true;
StandardOutPath = "/tmp/caffeinate.log";
StandardErrorPath = "/tmp/caffeinate.err";
};
};
launchd.user.agents.ssh-tunnel = let
ssh-tunnel = pkgs.writeShellScriptBin "ssh-tunnel" ''
while true; do
dns-sd -m -Q fuhen.local
echo "Host found, starting tunnel" | tee /dev/stderr
ssh -NR "2222:localhost:22" zoriya@fuhen.local
echo "Connetion closed" | tee /dev/stderr
sleep 5
done
'';
in {
command = lib.getExe ssh-tunnel;
serviceConfig = {
KeepAlive = true;
RunAtLoad = true;
StandardOutPath = "/tmp/ssh-tunnel.log";
StandardErrorPath = "/tmp/ssh-tunnel.err";
};
};
}

View File

@@ -1,11 +1,14 @@
{pkgs, ...}: {
{
pkgs,
lib,
...
}: {
imports = [
./fonts.nix
./nix.nix
./impermanence.nix
./nix/nix.nix
./nix/impermanence.nix
];
security.sudo.wheelNeedsPassword = true;
security.sudo.wheelNeedsPassword = lib.mkForce true;
security.sudo.extraConfig = ''
Defaults lecture="never"
'';
@@ -21,8 +24,6 @@
};
efi.canTouchEfiVariables = true;
};
# Using arch's google api key. Waiting for https://github.com/NixOS/nixpkgs/issues/321121 to be fixed.
services.geoclue2.geoProviderUrl = "https://www.googleapis.com/geolocation/v1/geolocate?key=AIzaSyDwr302FpOSkGRpLlUpPThNTDPbXcIn_FM";
# needed for geoclue, see https://github.com/NixOS/nixpkgs/issues/329522
services.avahi.enable = true;
services.automatic-timezoned.enable = true;
@@ -48,13 +49,12 @@
programs.zsh.enable = true;
environment.shells = with pkgs; [zsh];
programs.command-not-found.enable = false;
programs.nix-index-database.comma.enable = true;
services.locate = {
enable = true;
package = pkgs.mlocate;
interval = "hourly";
localuser = null;
};
virtualisation.docker.enable = true;

View File

@@ -1,11 +0,0 @@
: "${XDG_CACHE_HOME:=$HOME/.cache}"
declare -A direnv_layout_dirs
direnv_layout_dir() {
echo "${direnv_layout_dirs[$PWD]:=$(
local hash="$(sha1sum - <<<"${PWD}" | cut -c-7)"
local path="${PWD//[^a-zA-Z0-9]/-}"
echo "${XDG_CACHE_HOME}/direnv/layouts/${hash}${path}"
)}"
}

View File

@@ -1,94 +1,10 @@
{pkgs, ...}: {
{
imports = [
./zsh
./nvim
./tools/git.nix
./tools/jujutsu.nix
./tools/tmux.nix
];
programs.direnv = {
enable = true;
stdlib = builtins.readFile ./direnv.sh;
nix-direnv.enable = true;
config = {warn_timeout = "500h";};
};
programs.git = {
enable = true;
ignores = [".envrc"];
difftastic = {
# This breaks telescope's git status and I don't want to debug why
enable = false;
display = "inline";
};
signing = {
signByDefault = true;
key = "~/.ssh/id_rsa.pub";
};
# TODO: unstable feature not in my fork yet
# maintenance = {
# enable = false;
# # TODO: figure out a way to specify all repositories in ~/projects & ~/work at run time
# repositories = [];
# };
extraConfig = {
gpg.format = "ssh";
gpg.ssh.allowedSignersFile = "~/.ssh/allowed_signers";
push.autoSetupRemote = true;
push.default = "upstream";
pull.ff = "only";
init.defaultBranch = "master";
advice.diverging = false;
rerere.enabled = true;
rebase.updateRefs = true;
rebase.autoStash = true;
rebase.autoSquash = true;
branch.sort = "-committerdate";
# Disable hooks
core.hookspath = "/dev/null";
# Break compat with older versions of git (and systems that doesn't support mtime) to have better performances
feature.manyFiles = true;
};
userEmail = "zoe.roux@zoriya.dev";
userName = "Zoe Roux";
};
home.packages = [
(pkgs.writeShellScriptBin "tmux-sessionizer" (builtins.readFile ./tmux-sessionizer.sh))
];
xdg.configFile."tmux/tmux.conf".text = ''
unbind C-b
set -g prefix C-t
bind -N "Send the prefix key through to the application" t send-prefix
set -g mouse on
set -g status off
set -g set-clipboard on
set -g focus-events on
set-window-option -g mode-keys vi
bind-key v copy-mode
bind-key -T copy-mode-vi i send -X cancel
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi V send -X select-line
bind-key -T copy-mode-vi y send -X copy-selection -x
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-selection -x
bind-key [ copy-mode \; send-keys -X previous-prompt
bind-key ] copy-mode \; send-keys -X next-prompt
bind-key -T copy-mode-vi [ send-keys -X previous-prompt
bind-key -T copy-mode-vi ] send-keys -X next-prompt
bind-key f run-shell "tmux neww tmux-sessionizer"
bind-key C-h run-shell "tmux-sessionizer ~/projects/kyoo"
bind-key C-s run-shell "tmux-sessionizer ~/projects/flake"
bind-key C-n run-shell "tmux-sessionizer ~/projects/blog"
run-shell ${pkgs.tmuxPlugins.sensible.rtp}
run-shell ${pkgs.tmuxPlugins.fzf-tmux-url.rtp}
# https://github.com/tmux/tmux/issues/4162
set -gu default-command
set -g default-shell "$SHELL"
'';
xdg.configFile."nixpkgs/config.nix".text = '' {
allowUnfree = true;

View File

@@ -26,6 +26,9 @@
"/var/lib/transmission"
"/var/lib/gitea"
"/var/lib/acme"
"/var/lib/loki"
"/var/lib/mimir"
"/var/lib/tempo"
"/etc/NetworkManager/system-connections"
"/etc/tailord/"
];
@@ -43,6 +46,7 @@
"downloads"
"stuff"
"projects"
"work"
{
directory = ".gnupg";
mode = "0700";
@@ -57,16 +61,19 @@
".local/share/waydroid"
".local/share/bottles"
".var"
".zen"
".kube"
".cache/flatpak"
".local/share/atuin"
# Cache for sessions (keep website logged in, plugin downloaded...)
".mozilla"
".zen"
".config/google-chrome"
".config/discord"
".config/Slack"
".config/vesktop"
".config/YouTube\ Music"
".config/gh"
".config/github-copilot"
# Don't reinstall plugins on reboot
".local/share/nvim"
".local/state/nvim"
@@ -76,6 +83,11 @@
# Games directory for lutris
".local/lutris"
".local/games"
# Huge cache & long download i want to stay cache
".cache/nix"
".cache/.bun"
".cache/yarn"
".cache/go-build"
];
files = [
".config/zsh/custom.zsh"

View File

@@ -1,32 +1,20 @@
{
pkgs,
lib,
inputs,
config,
...
}: {
{pkgs, inputs, ...}: {
nix = {
# This will add each flake input as a registry
# To make nix3 commands consistent with your flake
registry = lib.mapAttrs (_: value: {flake = value;}) inputs;
# This will additionally add your inputs to the system's legacy channels
# Making legacy nix commands consistent as well, awesome!
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
optimise.automatic = true;
channel.enable = false;
registry = { nixpkgs.flake = inputs.nixpkgs; };
settings = {
warn-dirty = false;
experimental-features = ["nix-command" "flakes"];
use-xdg-base-directories = true;
substituters = [
"https://nix-community.cachix.org"
"https://ghostty.cachix.org"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns="
];
# 500mb of download buffer size (default is 64mb)
download-buffer-size = 500 * 1024 * 1024;
};
gc =
{

View File

@@ -1,182 +0,0 @@
; extends
(
((comment) @_comm (#match? @_comm "[Ss][Qq][Ll]"))
.
[
((string_literal_fragment) @injection.content)
(_ ((string_literal_fragment) @injection.content))
(_ (_ ((string_literal_fragment) @injection.content)))
(_ (_ (_ ((string_literal_fragment) @injection.content))))
(_ (_ (_ (_ ((string_literal_fragment) @injection.content)))))
(_ (_ (_ (_ (_ ((string_literal_fragment) @injection.content))))))
(_ (_ (_ (_ (_ (_ ((string_literal_fragment) @injection.content)))))))
(_ (_ (_ (_ (_ (_ (_ ((string_literal_fragment) @injection.content))))))))
(_ (_ (_ (_ (_ (_ (_ (_ ((string_literal_fragment) @injection.content)))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ ((string_literal_fragment) @injection.content))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((string_literal_fragment) @injection.content)))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((string_literal_fragment) @injection.content))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((string_literal_fragment) @injection.content)))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((string_literal_fragment) @injection.content))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((string_literal_fragment) @injection.content)))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((string_literal_fragment) @injection.content))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((string_literal_fragment) @injection.content)))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((string_literal_fragment) @injection.content))))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((string_literal_fragment) @injection.content)))))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((string_literal_fragment) @injection.content))))))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((string_literal_fragment) @injection.content)))))))))))))))))))))
]
(#set! injection.language "sql")
)
(
((comment) @_comm (#match? @_comm "[Ss][Qq][Ll]"))
.
[
((verbatim_string_literal) @injection.content)
(_ ((verbatim_string_literal) @injection.content))
(_ (_ ((verbatim_string_literal) @injection.content)))
(_ (_ (_ ((verbatim_string_literal) @injection.content))))
(_ (_ (_ (_ ((verbatim_string_literal) @injection.content)))))
(_ (_ (_ (_ (_ ((verbatim_string_literal) @injection.content))))))
(_ (_ (_ (_ (_ (_ ((verbatim_string_literal) @injection.content)))))))
(_ (_ (_ (_ (_ (_ (_ ((verbatim_string_literal) @injection.content))))))))
(_ (_ (_ (_ (_ (_ (_ (_ ((verbatim_string_literal) @injection.content)))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ ((verbatim_string_literal) @injection.content))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((verbatim_string_literal) @injection.content)))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((verbatim_string_literal) @injection.content))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((verbatim_string_literal) @injection.content)))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((verbatim_string_literal) @injection.content))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((verbatim_string_literal) @injection.content)))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((verbatim_string_literal) @injection.content))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((verbatim_string_literal) @injection.content)))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((verbatim_string_literal) @injection.content))))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((verbatim_string_literal) @injection.content)))))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((verbatim_string_literal) @injection.content))))))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((verbatim_string_literal) @injection.content)))))))))))))))))))))
]
((#offset! @injection.content 0 2 0 -1))
(#set! injection.language "sql")
)
(
((comment) @_comm (#match? @_comm "[Ss][Qq][Ll]"))
.
[
((raw_string_literal) @injection.content)
(_ ((raw_string_literal) @injection.content))
(_ (_ ((raw_string_literal) @injection.content)))
(_ (_ (_ ((raw_string_literal) @injection.content))))
(_ (_ (_ (_ ((raw_string_literal) @injection.content)))))
(_ (_ (_ (_ (_ ((raw_string_literal) @injection.content))))))
(_ (_ (_ (_ (_ (_ ((raw_string_literal) @injection.content)))))))
(_ (_ (_ (_ (_ (_ (_ ((raw_string_literal) @injection.content))))))))
(_ (_ (_ (_ (_ (_ (_ (_ ((raw_string_literal) @injection.content)))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ ((raw_string_literal) @injection.content))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((raw_string_literal) @injection.content)))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((raw_string_literal) @injection.content))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((raw_string_literal) @injection.content)))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((raw_string_literal) @injection.content))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((raw_string_literal) @injection.content)))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((raw_string_literal) @injection.content))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((raw_string_literal) @injection.content)))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((raw_string_literal) @injection.content))))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((raw_string_literal) @injection.content)))))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((raw_string_literal) @injection.content))))))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((raw_string_literal) @injection.content)))))))))))))))))))))
]
((#offset! @injection.content 0 3 0 -3))
(#set! injection.language "sql")
)
(
((comment) @_comm (#match? @_comm "[Ss][Qq][Ll]"))
.
[
((interpolated_verbatim_string_text) @injection.content)
(_ ((interpolated_verbatim_string_text) @injection.content))
(_ (_ ((interpolated_verbatim_string_text) @injection.content)))
(_ (_ (_ ((interpolated_verbatim_string_text) @injection.content))))
(_ (_ (_ (_ ((interpolated_verbatim_string_text) @injection.content)))))
(_ (_ (_ (_ (_ ((interpolated_verbatim_string_text) @injection.content))))))
(_ (_ (_ (_ (_ (_ ((interpolated_verbatim_string_text) @injection.content)))))))
(_ (_ (_ (_ (_ (_ (_ ((interpolated_verbatim_string_text) @injection.content))))))))
(_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_verbatim_string_text) @injection.content)))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_verbatim_string_text) @injection.content))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_verbatim_string_text) @injection.content)))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_verbatim_string_text) @injection.content))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_verbatim_string_text) @injection.content)))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_verbatim_string_text) @injection.content))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_verbatim_string_text) @injection.content)))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_verbatim_string_text) @injection.content))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_verbatim_string_text) @injection.content)))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_verbatim_string_text) @injection.content))))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_verbatim_string_text) @injection.content)))))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_verbatim_string_text) @injection.content))))))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_verbatim_string_text) @injection.content)))))))))))))))))))))
]
((#offset! @injection.content 0 3 0 -3))
(#set! injection.conbined)
(#set! injection.language "sql")
)
(
((comment) @_comm (#match? @_comm "[Ss][Qq][Ll]"))
.
[
((interpolated_string_text) @injection.content)
(_ ((interpolated_string_text) @injection.content))
(_ (_ ((interpolated_string_text) @injection.content)))
(_ (_ (_ ((interpolated_string_text) @injection.content))))
(_ (_ (_ (_ ((interpolated_string_text) @injection.content)))))
(_ (_ (_ (_ (_ ((interpolated_string_text) @injection.content))))))
(_ (_ (_ (_ (_ (_ ((interpolated_string_text) @injection.content)))))))
(_ (_ (_ (_ (_ (_ (_ ((interpolated_string_text) @injection.content))))))))
(_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_string_text) @injection.content)))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_string_text) @injection.content))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_string_text) @injection.content)))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_string_text) @injection.content))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_string_text) @injection.content)))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_string_text) @injection.content))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_string_text) @injection.content)))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_string_text) @injection.content))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_string_text) @injection.content)))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_string_text) @injection.content))))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_string_text) @injection.content)))))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_string_text) @injection.content))))))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_string_text) @injection.content)))))))))))))))))))))
]
(#set! injection.conbined)
(#set! injection.language "sql")
)
(
((comment) @_comm (#match? @_comm "[Ss][Qq][Ll]"))
.
[
((interpolated_raw_string_text) @injection.content)
(_ ((interpolated_raw_string_text) @injection.content))
(_ (_ ((interpolated_raw_string_text) @injection.content)))
(_ (_ (_ ((interpolated_raw_string_text) @injection.content))))
(_ (_ (_ (_ ((interpolated_raw_string_text) @injection.content)))))
(_ (_ (_ (_ (_ ((interpolated_raw_string_text) @injection.content))))))
(_ (_ (_ (_ (_ (_ ((interpolated_raw_string_text) @injection.content)))))))
(_ (_ (_ (_ (_ (_ (_ ((interpolated_raw_string_text) @injection.content))))))))
(_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_raw_string_text) @injection.content)))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_raw_string_text) @injection.content))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_raw_string_text) @injection.content)))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_raw_string_text) @injection.content))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_raw_string_text) @injection.content)))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_raw_string_text) @injection.content))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_raw_string_text) @injection.content)))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_raw_string_text) @injection.content))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_raw_string_text) @injection.content)))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_raw_string_text) @injection.content))))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_raw_string_text) @injection.content)))))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_raw_string_text) @injection.content))))))))))))))))))))
(_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ (_ ((interpolated_raw_string_text) @injection.content)))))))))))))))))))))
]
(#set! injection.conbined)
(#set! injection.language "sql")
)

View File

@@ -1,19 +0,0 @@
{
pkgs,
config,
neovim-nightly,
...
}: {
programs.neovim = {
enable = true;
withNodeJs = true;
package = neovim-nightly.packages.${pkgs.system}.default;
extraPackages = with pkgs; [
gcc
tree-sitter
# Give access to gdbus for color-scheme detection (vim-lumen).
glib
];
};
xdg.configFile."nvim".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/projects/flake/modules/cli/nvim";
}

View File

@@ -1,20 +0,0 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
require("./settings");
require("lazy").setup("plugins", { change_detection = { notify = false } });

View File

@@ -1,62 +0,0 @@
{
"SchemaStore.nvim": { "branch": "main", "commit": "f8c2a0f5d51b800ea4625808e243d9e8f7c5e1df" },
"auto-save.nvim": { "branch": "main", "commit": "b58948445c43e6903987a9bb97c82e66fdcc0786" },
"blame.nvim": { "branch": "main", "commit": "20cf0918962fa2da787c4b25331f6024d1b1d808" },
"catppuccin": { "branch": "main", "commit": "faf15ab0201b564b6368ffa47b56feefc92ce3f4" },
"cmp-git": { "branch": "main", "commit": "ec049036e354ed8ed0215f2427112882e1ea7051" },
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"conform.nvim": { "branch": "master", "commit": "f4e8837878fc5712d053ba3091a73d27d96a09e2" },
"dressing.nvim": { "branch": "master", "commit": "fc78a3ca96f4db9f8893bb7e2fd9823e0780451b" },
"fidget.nvim": { "branch": "main", "commit": "e2a175c2abe2d4f65357da1c98c59a5cfb2b543f" },
"flit.nvim": { "branch": "main", "commit": "1ef72de6a02458d31b10039372c8a15ab8989e0d" },
"git-conflict.nvim": { "branch": "main", "commit": "4dc906855751096aaeba2edde7c2cdc7bb881c98" },
"gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" },
"harpoon": { "branch": "harpoon2", "commit": "a84ab829eaf3678b586609888ef52f7779102263" },
"increment-activator": { "branch": "master", "commit": "b49fc24094f93aa29a7592034b97095b709c3528" },
"indent-blankline.nvim": { "branch": "master", "commit": "259357fa4097e232730341fa60988087d189193a" },
"lazy-lsp.nvim": { "branch": "master", "commit": "91146e303717f55561c281d541e32f75de931a0d" },
"lazy.nvim": { "branch": "main", "commit": "7c493713bc2cb392706866eeba53aaef6c8e9fc6" },
"lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" },
"leap.nvim": { "branch": "main", "commit": "c6bfb191f1161fbabace1f36f578a20ac6c7642c" },
"lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" },
"ltex_extra.nvim": { "branch": "dev", "commit": "57192d7ae5ba8cef3c10e90f2cd62d4a7cdaab69" },
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
"luvit-meta": { "branch": "main", "commit": "57d464c4acb5c2e66bd4145060f5dc9e96a7bbb7" },
"mini.ai": { "branch": "main", "commit": "ebb04799794a7f94628153991e6334c3304961b8" },
"mini.align": { "branch": "main", "commit": "acf1ad6031e49553ed887a2a5e3603211346f1de" },
"mini.icons": { "branch": "main", "commit": "54686be7d58807906cb2c8c2216e0bf9c044f19a" },
"mini.operators": { "branch": "main", "commit": "7cb4dc66c51a3d736d347bbc517dc73dc7d28888" },
"mini.splitjoin": { "branch": "main", "commit": "3e92f6764e770ba392325cad3a4497adcada695f" },
"mini.surround": { "branch": "main", "commit": "aa5e245829dd12d8ff0c96ef11da28681d6049aa" },
"neogen": { "branch": "main", "commit": "37dd095892e3f846418c465852f7b21f81d0f46c" },
"noice.nvim": { "branch": "main", "commit": "7b1960c48078a8b2fb44a89db82f4fa637b2d7c8" },
"nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" },
"nvim-cmp": { "branch": "main", "commit": "3403e2e9391ed0a28c3afddd8612701b647c8e26" },
"nvim-colorizer.lua": { "branch": "master", "commit": "4acf88d31b3a7a1a7f31e9c30bf2b23c6313abdb" },
"nvim-lint": { "branch": "master", "commit": "6b46370d02cd001509a765591a3ffc481b538794" },
"nvim-lspconfig": { "branch": "master", "commit": "b1729954329236f59d075bec79fdee7a6f3ce88b" },
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
"nvim-pqf": { "branch": "main", "commit": "148ee2ca8b06d83fd9bf6f9b9497724ad39a07d6" },
"nvim-treesitter": { "branch": "master", "commit": "5874cac1b76c97ebb3fc03225bd7215d4e671cd2" },
"nvim-type-fmt": { "branch": "main", "commit": "6c1f520f04c1e4f924dae4e822262d7186b5ed59" },
"oil.nvim": { "branch": "master", "commit": "dba037598843973b8c54bc5ce0318db4a0da439d" },
"omnisharp-extended-lsp.nvim": { "branch": "main", "commit": "4916fa12e5b28d21a1f031f0bdd10aa15a75d85d" },
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"statuscol.nvim": { "branch": "0.10", "commit": "b0de00dfcf583bdd94284d844aac1b134d47c578" },
"telescope-fzf-native.nvim": { "branch": "feature/69-prebuilt-release-binaries", "commit": "af1d3c6efa0124123272bba094a60e15682c9cd5" },
"telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" },
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
"trouble.nvim": { "branch": "main", "commit": "46cf952fc115f4c2b98d4e208ed1e2dce08c9bf6" },
"ts-comments.nvim": { "branch": "main", "commit": "2002692ad1d3f6518d016550c20c2a890f0cbf0e" },
"undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" },
"vim-helm": { "branch": "master", "commit": "ae1ebc160d2b9b90108477ab10df7a4fc501e358" },
"vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" },
"vim-lumen": { "branch": "master", "commit": "ac13c32c3e309f6c6a84ff6cad8dbb135e75f0e4" },
"vim-matchup": { "branch": "master", "commit": "5fb083de1e06fdd134c6ad8d007d4b5576b25ba7" },
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
"vim-wordmotion": { "branch": "master", "commit": "81d9bd298376ab0dc465c85d55afa4cb8d5f47a1" },
"virtcolumn.nvim": { "branch": "main", "commit": "2291fe12098f1541483e7ee4d0fa0835c1f028f6" },
"which-key.nvim": { "branch": "main", "commit": "9b365a6428a9633e3eeb34dbef1b791511c54f70" },
"zen-mode.nvim": { "branch": "main", "commit": "863f150ca321b3dd8aa1a2b69b5f411a220e144f" }
}

View File

@@ -1,3 +0,0 @@
{
"workspace.checkThirdParty": false,
}

View File

@@ -1,69 +0,0 @@
return {
{
"hrsh7th/nvim-cmp",
version = false, -- last release is way too old
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
{ "petertriho/cmp-git", opts = true },
"hrsh7th/cmp-path",
"onsails/lspkind.nvim",
},
opts = function()
local cmp = require("cmp")
return {
completion = {
autocomplete = false
},
snippet = {
expand = function(args)
vim.snippet.expand(args.body)
end,
},
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-p>'] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }),
['<C-n>'] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }),
["<C-e>"] = cmp.mapping.abort(),
["<C-y>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
["<C-h>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = "lazydev", group_index = 0 },
{ name = "git" },
{ name = "nvim_lsp" },
{ name = "path" },
}),
navigation = {
documentation = {
border = { "", "", "", "", "", "", "", "" },
},
},
window = {
completion = {
-- winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
col_offset = -3,
side_padding = 0,
},
},
formatting = {
fields = { "kind", "abbr" },
format = function(entry, vim_item)
local kind = require("lspkind").cmp_format({
mode = "symbol",
maxwidth = 50,
symbol_map = { TypeParameter = "", },
})(entry, vim_item)
kind.kind = " " .. (kind.kind or "?") .. " "
return kind
end,
},
experimental = {
ghost_text = false,
},
}
end,
},
}

View File

@@ -1,60 +0,0 @@
return {
{
"catppuccin/nvim",
name = "catppuccin",
lazy = false,
priority = 1000,
opts = {
integrations = {
which_key = true,
lsp_trouble = true,
telescope = {
enabled = true,
style = "nvchad",
},
noice = true,
fidget = true,
mini = true,
cmp = true,
native_lsp = {
enabled = true
},
navic = true,
harpoon = true,
leap = true,
gitsigns = true,
semantic_tokens = true,
indent_blankline = {
enabled = true,
},
illuminate = true,
},
custom_highlights = function(colors)
return {
FlashLabel = { fg = colors.red },
NotCommitedBlame = { fg = "DimGray" },
}
end
},
config = function(_, opts)
require("catppuccin").setup(opts)
vim.cmd([[colorscheme catppuccin]])
end
},
{
"vimpostor/vim-lumen",
lazy = false,
priority = 1000,
-- event = "VeryLazy",
init = function()
-- keep vim's default behavior of checking the terminal's colors
-- Only use lumen to detect runtime changes (that's why VeryLazy is used).
-- vim.g.lumen_startup_overwrite = 0
if vim.fn.has("wsl") then
vim.g.lumen_startup_overwrite = 0
vim.opt.background = "light"
end
end
},
}

View File

@@ -1,73 +0,0 @@
return {
{
"lewis6991/gitsigns.nvim",
event = { "BufReadPost", "BufWritePost", "BufNewFile" },
opts = {
signs = {
add = { text = "" },
change = { text = "" },
changedelete = { text = "" },
untracked = { text = "" },
},
on_attach = function(buffer)
local gs = package.loaded.gitsigns
local function map(mode, l, r, desc)
vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc })
end
map("n", "]h", gs.next_hunk, "Next Hunk")
map("n", "[h", gs.prev_hunk, "Prev Hunk")
map({ "n", "v" }, "<leader>ga", ":Gitsigns stage_hunk<CR>", "Add Hunk")
map({ "n", "v" }, "<leader>gr", ":Gitsigns reset_hunk<CR>", "Reset Hunk")
map("n", "<leader>gu", gs.undo_stage_hunk, "Unstage Hunk")
map("n", "<leader>gA", gs.stage_buffer, "Add buffer")
map("n", "<leader>gR", gs.reset_buffer, "Reset Buffer")
map("n", "<leader>gp", gs.preview_hunk, "Preview Hunk")
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", "Git Select Hunk")
map({ "o", "x" }, "ah", ":<C-U>Gitsigns select_hunk<CR>", "Git Select Hunk")
end,
},
},
{
"akinsho/git-conflict.nvim",
event = "VeryLazy",
keys = {
{ "gxo", "<Plug>(git-conflict-ours)", desc = "Accept ours" },
{ "gxt", "<Plug>(git-conflict-theirs)", desc = "Accept theirs" },
{ "gxb", "<Plug>(git-conflict-both)", desc = "Accept both" },
{ "gx0", "<Plug>(git-conflict-none)", desc = "Accept none" },
{ "[x", "<Plug>(git-conflict-prev-conflict)", desc = "Previous conflict" },
{ "]x", "<Plug>(git-conflict-next-conflict)", desc = "Next conflict" },
},
opts = {
default_mappings = false,
},
init = function()
vim.keymap.del("n", "gx")
end
},
{
-- "FabijanZulj/blame.nvim",
"zoriya/blame.nvim",
-- dev = true,
keys = {
{ "<leader>gb", "<cmd>ToggleBlame window<CR>", desc = "Git blame" },
},
cmd = "ToggleBlame",
opts = {
date_format = "%Y/%m/%d",
width = 50,
commit_detail_view = "current",
format = function(blame)
if string.sub(blame.hash, 0, 8) == "00000000" then
return "Not Committed Yet"
end
return string.format("%s %s %s", blame.author, blame.date, blame.summary)
end,
},
},
}

View File

@@ -1,118 +0,0 @@
return {
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = function()
vim.opt["showmode"] = false
return {
options = {
theme = "auto",
component_separators = '|',
section_separators = { left = '', right = '' },
always_divide_middle = true,
globalstatus = true,
disabled_filetypes = {},
},
sections = {
lualine_a = {
{
'mode',
fmt = function(str) return string.format("%7s", str) end
},
},
lualine_b = {
{
"diagnostics",
sources = {
function()
local diag_severity = vim.diagnostic.severity
local function workspace_diag(severity)
local count = vim.diagnostic.get(nil, { severity = severity })
return vim.tbl_count(count)
end
return {
error = workspace_diag(diag_severity.ERROR),
warn = workspace_diag(diag_severity.WARN),
info = workspace_diag(diag_severity.INFO),
hint = workspace_diag(diag_severity.HINT)
}
end,
},
sections = { "error", "warn" },
symbols = { error = "󰅚 ", warn = "" },
always_visible = false,
}
},
lualine_c = {
{
function()
return ""
end,
color = "ErrorMsg",
cond = function() return not vim.g.auto_save_state end,
},
{
'filetype',
colored = true,
icon_only = true,
separator = "",
padding = { left = 1, right = 0 }
},
{
'filename',
separator = '>',
path = 0,
symbols = {
modified = '',
readonly = '[-]',
unnamed = '[No Name]',
},
},
{
"navic",
color_correction = "static",
},
},
lualine_x = {
-- require "dap".status,
{
require("noice").api.status.mode.get,
cond = require("noice").api.status.mode.has,
color = { fg = "#ff9e64" },
},
'fileformat',
},
lualine_y = { 'branch', 'progress' },
lualine_z = {
{
'location',
},
},
},
tabline = {},
extensions = {
"quickfix",
"lazy",
"trouble",
"oil",
},
}
end
},
{
"SmiteshP/nvim-navic",
lazy = true,
dependencies = {
"neovim/nvim-lspconfig",
},
opts = {
highlight = true,
lsp = {
auto_attach = true,
},
},
}
}

View File

@@ -1,357 +0,0 @@
local lsp_keymaps = function(buffer)
local function map(mode, l, r, desc)
vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc })
end
map("i", "<C-Space>", '<cmd>lua vim.lsp.completion.trigger()<CR>', "Open completion menu")
map({ "n", "i" }, "<C-k>", '<cmd>lua vim.lsp.buf.signature_help()<CR>', "See signature help")
map("n", "gD", '<cmd>lua vim.lsp.buf.declaration()<CR>', "Go to declaration")
map("n", "gd", '<cmd>lua vim.lsp.buf.definition()<CR>', "Go to definition")
map("n", "gI", '<cmd>lua vim.lsp.buf.implementation()<CR>', "Go to implementation")
map("n", "gr", '<cmd>lua vim.lsp.buf.references()<CR>', "Go to reference(s)")
map("n", "gs", '<cmd>lua vim.lsp.buf.type_definition()<CR>', "Type definition")
map("n", "<leader>r", '<cmd>lua vim.lsp.buf.rename()<CR>', "Rename")
map("n", "<leader>la", '<cmd>lua vim.lsp.buf.code_action()<CR>', "Code action")
map("n", "<leader>ll", '<cmd>lua vim.lsp.codelens.run()<CR>', "Run code lens")
map("n", "<leader>lg", '<cmd>Telescope lsp_document_symbols<CR>', "Go to symbol")
map("v", "<leader>e", '<cmd>lua vim.lsp.buf.format({async=true})<CR>', "Range Format")
end
return {
{
"dundalek/lazy-lsp.nvim",
-- dev = true,
event = { "BufReadPost", "BufWritePost", "BufNewFile" },
dependencies = {
"neovim/nvim-lspconfig",
},
opts = function()
local lsp_on_attach = function(client, buffer)
lsp_keymaps(buffer)
vim.lsp.completion.enable(true, client.id, buffer)
end
local lspconfig = require("lspconfig")
return {
excluded_servers = {
-- Disable generic purpose LSP that I don't care about.
"efm",
"diagnosticls",
-- Slow lsps to configure
"turtle_ls",
-- enabled on too many ft
"zk",
"tailwindcss",
-- bugged/deprecated
"ruby_ls",
"drools_lsp",
"mutt_ls",
},
prefer_local = true,
preferred_servers = {
haskell = { "hls" },
rust = { "rust_analyzer" },
c = { "clangd" },
cpp = { "clangd" },
cs = { "omnisharp" },
python = { "pyright" },
nix = { "nil_ls" },
typescript = { "ts_ls" },
javascript = { "ts_ls" },
jsx = { "ts_ls" },
tsx = { "ts_ls" },
javascriptreact = { "ts_ls" },
typescriptreact = { "ts_ls" },
go = { "gopls" },
json = { "jsonls" },
yaml = { "yamlls" },
markdown = { "marksman", "ltex" },
tex = { "texlab", "ltex" },
html = { "html" },
},
default_config = {
on_attach = lsp_on_attach,
},
configs = {
jsonls = {
on_new_config = function(new_config)
new_config.settings.json.schemas = new_config.settings.json.schemas or {}
vim.list_extend(new_config.settings.json.schemas, require("schemastore").json.schemas())
end,
settings = {
json = {
format = {
enable = true,
},
validate = { enable = true },
},
},
},
ts_ls = {
root_dir = lspconfig.util.root_pattern("yarn.lock", "package-lock.json", "bun.lockb", ".git"),
single_file_support = false,
commands = {
OrganizeImports = {
function()
vim.lsp.buf.execute_command({
command = "_typescript.organizeImports",
arguments = { vim.api.nvim_buf_get_name(0) },
title = ""
})
end,
description = "Organize Imports"
},
},
},
omnisharp = {
handlers = {
["textDocument/definition"] = require('omnisharp_extended').definition_handler,
["textDocument/references"] = require('omnisharp_extended').references_handler,
["textDocument/implementation"] = require('omnisharp_extended').implementation_handler,
},
enable_editorconfig_support = true,
enable_roslyn_analyzers = true,
organize_imports_on_format = true,
enable_import_completion = true,
cmd_env = {
["OMNISHARP_RoslynExtensionsOptions:enableDecompilationSupport"] = true,
["OMNISHARP_msbuild:EnablePackageAutoRestore"] = true,
},
on_new_config = function(new_config, new_root_dir)
-- lazy-lsp magics for nix
pcall(require("lspconfig").omnisharp.document_config.default_config.on_new_config,
new_config, new_root_dir)
local custom_nix_pkgs = { "omnisharp-roslyn" }
new_config.cmd = require("lazy-lsp").in_shell(custom_nix_pkgs, new_config.cmd)
end,
},
robotframework_ls = {
cmd = { "nix-shell", "-p", "python3", "--command",
"cd /tmp && python3 -m venv venv && . venv/bin/activate && pip install robotframework_lsp robotframework RESTInstance && robotframework_ls" },
filetypes = { "robot" },
settings = {
robot = {
codeFormatter = "robotidy",
},
}
},
gopls = {
settings = {
-- https://go.googlesource.com/vscode-go/+/HEAD/docs/settings.md#settings-for
gopls = {
analyses = {
nilness = true,
unusedparams = true,
unusedwrite = true,
useany = true
},
experimentalPostfixCompletions = true,
gofumpt = true,
staticcheck = true,
usePlaceholders = true,
hints = {
assignVariableTypes = true,
compositeLiteralFields = true,
compositeLiteralTypes = true,
constantValues = true,
functionTypeParameters = true,
parameterNames = true,
rangeVariableTypes = true
}
}
}
},
zls = {
settings = {
enable_build_on_save = true,
},
-- I think this can be disabled with prefer_local but not tested yet.
-- on_new_config = function(new_config, new_root_dir)
-- -- Simply disable the nix-shell wrapping and use zls from the shell.nix of the projects
-- -- I use nightly builds of zigs/zls
-- pcall(require("lspconfig").zls.document_config.default_config.on_new_config, new_config,
-- new_root_dir)
-- end,
},
},
}
end,
init = function()
vim.keymap.set("n", "<leader>li", "<cmd>LspInfo<cr>", { desc = "Info" })
vim.diagnostic.config({
signs = {
text = {
[vim.diagnostic.severity.ERROR] = "󰅚",
[vim.diagnostic.severity.WARN] = "",
[vim.diagnostic.severity.HINT] = "󰌶",
[vim.diagnostic.severity.INFO] = "",
},
},
virtual_text = false,
update_in_insert = true,
float = {
border = "rounded",
source = true,
},
})
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
border = "rounded",
})
vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.signature_help, {
border = 'rounded',
})
end,
},
{
"b0o/SchemaStore.nvim",
lazy = true,
version = false
},
{
"Hoffs/omnisharp-extended-lsp.nvim",
lazy = true,
},
{
"folke/lazydev.nvim",
ft = "lua",
dependencies = {
{ "Bilal2453/luvit-meta", lazy = true }
},
opts = {
library = {
"luvit-meta/library",
},
},
},
{
"barreiroleo/ltex_extra.nvim",
branch = "dev",
ft = { "markdown", "tex" },
opts = {
-- See https://valentjn.github.io/ltex/supported-languages.html#natural-languages
load_langs = { 'en-US' },
},
},
{
"stevearc/conform.nvim",
cmd = "ConformInfo",
keys = {
{
"<leader>e",
function()
require("conform").format()
end,
desc = "Format",
mode = { "n", "v" },
},
},
opts = {
default_format_opts = { async = true, lsp_format = "fallback" },
formatters_by_ft = {
python = function(bufnr)
if require("conform").get_formatter_info("ruff_format", bufnr).available then
return { "ruff_format" }
else
return { "isort", "black" }
end
end,
javascript = { "biome", "prettierd", "prettier", stop_after_first = true },
typescript = { "biome", "prettierd", "prettier", stop_after_first = true },
javascriptreact = { "biome", "prettierd", "prettier", stop_after_first = true },
typescriptreact = { "biome", "prettierd", "prettier", stop_after_first = true },
json = { "biome", "prettierd", "prettier", stop_after_first = true },
css = { "biome", "prettierd", "prettier", stop_after_first = true },
html = { "biome", "prettierd", "prettier", stop_after_first = true },
sql = { "pg_format" },
cs = { "csharpier" },
nix = { "alejandra" },
-- ["_"] = { "injected", lsp_format = "last" },
["*"] = { "injected" }
},
formatters = {
biome = {
-- disable node module search since native binaries can't be run from nix
command = "biome",
},
csharpier = function()
return {
cwd = require("conform.util").root_file(function(name)
return name:match('.*%.sln$') or name:match('.*%.csproj$')
end),
require_cwd = true,
}
end,
},
},
init = function()
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
end
},
{
"mfussenegger/nvim-lint",
event = { "BufReadPost", "BufWritePost", "BufNewFile" },
config = function(_, opts)
local override_severity = function(linter)
local old_parser = linter.parser;
linter.parser = function(output)
local diags = old_parser(output);
for _, d in pairs(diags) do
d.severity = vim.diagnostic.severity.HINT
end
return diags
end
end
override_severity(require("lint").linters.eslint_d)
override_severity(require("lint").linters.biomejs)
require("lint").linters_by_ft = opts
vim.api.nvim_create_autocmd({ "BufWritePost", "BufEnter" }, {
callback = function()
require("lint").try_lint(nil, { ignore_errors = true })
end,
})
end,
opts = {
javascript = { "biomejs", "eslint_d" },
typescript = { "biomejs", "eslint_d" },
javascriptreact = { "biomejs", "eslint_d" },
typescriptreact = { "biomejs", "eslint_d" },
},
},
{
"yioneko/nvim-type-fmt",
event = { "InsertEnter" },
},
{
"RRethy/vim-illuminate",
event = { "BufReadPost", "BufWritePost", "BufNewFile" },
opts = {
providers = {
"lsp",
"treesitter",
},
under_cursor = false,
min_count_to_highlight = 2,
delay = 200,
large_file_cutoff = 2000,
large_file_overrides = {
providers = { "lsp" },
},
},
config = function(_, opts) require("illuminate").configure(opts) end,
},
}

View File

@@ -1,33 +0,0 @@
return {
{
"okuuva/auto-save.nvim",
keys = {
{ "<leader>w", "<cmd>lua vim.g.auto_save_state = not vim.g.auto_save_state<cr>", desc = "Toggle autosave" },
},
event = {
"InsertLeave",
"TextChanged",
},
opts = {
write_all_buffers = true,
condition = function(buf)
if not vim.g.auto_save_state then
return false
end
local ft = vim.fn.getbufvar(buf, "&filetype")
return ft ~= "oil" and ft ~= "harpoon"
end,
},
init = function() vim.g.auto_save_state = true end,
},
{
"mbbill/undotree",
keys = {
{ "<leader>u", vim.cmd.UndotreeToggle, desc = "Show undotree" },
},
},
-- TODO: upstream this to vim
"towolf/vim-helm"
}

View File

@@ -1,139 +0,0 @@
return {
{
"ggandor/leap.nvim",
keys = {
{ "s", "<Plug>(leap-forward-till)", mode = { "n", "x", }, desc = "Leap forward to" },
{ "S", "<Plug>(leap-backward)", mode = { "n", "x", }, desc = "Leap backward to" },
{ "z", "<Plug>(leap-forward-till)", mode = "o", desc = "Leap forward to" },
{ "Z", "<Plug>(leap-backward)", mode = "o", desc = "Leap backward to" },
},
},
{
"ggandor/flit.nvim",
keys = { "f", "F", "t", "T" },
opts = true,
},
{
"ThePrimeagen/harpoon",
branch = "harpoon2",
keys = {
{ "<leader>a", '<cmd>lua require("harpoon"):list():add()<CR>', desc = "Mark file" },
{ "<leader>h", '<cmd>lua require("harpoon").ui:toggle_quick_menu(require("harpoon"):list())<CR>', desc = "Harpoon menu" },
{ "<A-h>", '<cmd>lua require("harpoon"):list():select(1)<CR>', desc = "Navigate to harpoon 1" },
{ "<A-t>", '<cmd>lua require("harpoon"):list():select(2)<CR>', desc = "Navigate to harpoon 2" },
{ "<A-n>", '<cmd>lua require("harpoon"):list():select(3)<CR>', desc = "Navigate to harpoon 3" },
{ "<A-s>", '<cmd>lua require("harpoon"):list():select(4)<CR>', desc = "Navigate to harpoon 4" },
-- <C-;> is not a valid sequence so use HJKL instead.
{ "<A-j>", '<cmd>lua require("harpoon"):list():select(2)<CR>', desc = "Navigate to harpoon 2" },
{ "<A-k>", '<cmd>lua require("harpoon"):list():select(3)<CR>', desc = "Navigate to harpoon 3" },
-- <C-L> is already taken but since I use harpoon less on querty no worry
},
config = function(_, opts)
require("harpoon"):setup(opts)
end,
opts = {
settings = {
save_on_toggle = true,
},
},
},
"tpope/vim-sleuth",
{
"echasnovski/mini.surround",
opts = {
mappings = {
add = "ys",
replace = "cs",
delete = "ds",
find = '',
find_left = '',
highlight = '',
update_n_lines = '',
suffix_last = 'l',
suffix_next = 'n',
},
custom_surroundings = {
B = { output = { left = "{", right = "}" } },
},
},
config = function(_, opts)
require("mini.surround").setup(opts)
vim.keymap.del('x', 'ys')
vim.keymap.set('x', 'S', [[:<C-u>lua MiniSurround.add('visual')<CR>]], { silent = true })
vim.keymap.set('n', 'yss', 'ys_', { remap = true })
end,
keys = {
{ "ys", desc = "Add surrounding" },
{ "cs", desc = "Change surroundings" },
{ "ds", desc = "Delete surroundings" },
},
},
{
"nishigori/increment-activator",
keys = {
{ "<C-A>", desc = "Increment" },
{ "<C-X>", desc = "Decrement" },
},
},
{
"echasnovski/mini.operators",
opts = {
replace = {
prefix = "cr",
reindent_linewise = true,
},
},
keys = {
{ "gx" },
{ "cr", desc = "Replace with register" },
{ "<leader>cr", '"+cr', remap = true, desc = "Replace with system clipboard" },
},
},
{
"chaoren/vim-wordmotion",
keys = {
{ "gw", "<plug>WordMotion_w", desc = "Next small world", mode = { "n", "x", "o" } },
-- This overrides the default ge but i never used it.
{ "ge", "<plug>WordMotion_e", desc = "Next end of small world", mode = { "n", "x", "o" } },
{ "gb", "<plug>WordMotion_b", desc = "Previous small world", mode = { "n", "x", "o" } },
{ "igw", "<plug>WordMotion_iw", desc = "inner small word", mode = { "x", "o" } },
{ "agw", "<plug>WordMotion_aw", desc = "a small word (with white-space)", mode = { "x", "o" } },
},
init = function() vim.g.wordmotion_nomap = true end,
},
{
"echasnovski/mini.align",
keys = {
{ "ga", desc = "Align" },
{ "gA", desc = "Align with preview" }
},
config = true,
},
{
"echasnovski/mini.splitjoin",
keys = {
{ "gS", desc = "Split arguments" },
{ "gJ", desc = "Join arguments" },
},
opts = {
mappings = {
toggle = '',
split = 'gS',
join = 'gJ',
},
},
version = '*',
},
}

View File

@@ -1,106 +0,0 @@
return {
{
"nvim-telescope/telescope.nvim",
dependencies = {
{
"airtonix/telescope-fzf-native.nvim",
branch = 'feature/69-prebuilt-release-binaries',
build = function()
require('telescope-fzf-native').download_library()
end
},
"nvim-lua/plenary.nvim",
},
cmd = "Telescope",
version = false, -- telescope did only one release, so use HEAD for now
keys = {
{ "<leader>f", "<cmd>Telescope find_files<cr>", desc = "Find Files" },
{ "<leader>F", "<cmd>Telescope live_grep theme=ivy<cr>", desc = "Grep" },
{ "<leader>gl", "<cmd>Telescope git_commits<CR>", desc = "Git log" },
{ "<leader>gh", "<cmd>Telescope git_bcommits<CR>", desc = "Git history" },
{ "<leader>gB", "<cmd>Telescope git_branches<CR>", desc = "Git branches" },
{ "<leader>gs", "<cmd>Telescope git_status<CR>", desc = "Git status" },
{ "<leader>gc", "<cmd>Telescope git_show<CR>", desc = "Show last commit" },
},
opts = function()
local actions = require("telescope.actions")
local action_state = require("telescope.actions.state")
local function git_show()
local entry = action_state.get_selected_entry()
vim.cmd("Telescope git_show ref=" .. entry.value)
end
return {
defaults = {
prompt_prefix = "",
selection_caret = "",
sorting_strategy = "ascending",
layout_strategy = "horizontal",
layout_config = {
horizontal = {
prompt_position = "top",
}
},
path_display = { "truncate" },
mappings = {
i = {
["<esc>"] = actions.close,
["<C-c>"] = actions.close,
["<C-h>"] = function() vim.api.nvim_input("<C-w>") end,
["<C-BS>"] = function() vim.api.nvim_input("<C-w>") end,
["<A-k>"] = actions.move_selection_previous,
["<A-j>"] = actions.move_selection_next,
["<c-t>"] = function()
local has_trouble, trouble_action = pcall(require, "trouble.providers.telescope")
if has_trouble then
trouble_action.open_with_trouble()
end
end
},
},
},
extensions = {
fzf = {
fuzzy = true, -- false will only do exact matching
override_generic_sorter = true, -- override the generic sorter
override_file_sorter = true, -- override the file sorter
}
},
pickers = {
find_files = {
hidden = true,
find_command = { "fd", "--type", "f", "--strip-cwd-prefix", "-E", ".git" },
},
git_commits = {
mappings = {
i = {
["<CR>"] = git_show,
},
},
},
git_bcommits = {
mappings = {
i = {
["<CR>"] = git_show,
},
},
},
git_status = {
mappings = {
i = {
-- ["<c-c>"] = local_actions.commit,
},
},
},
},
}
end,
config = function(_, opts)
local telescope = require("telescope")
telescope.setup(opts)
telescope.load_extension("fzf")
telescope.load_extension("git_show")
end,
}
}

View File

@@ -1,26 +0,0 @@
return {
{
"stevearc/oil.nvim",
lazy = false,
dependencies = { {
"echasnovski/mini.icons",
config = function(_, opts)
require("mini.icons").setup(opts);
MiniIcons.mock_nvim_web_devicons()
end
} },
keys = {
{ "-", "<CMD>Oil<CR>", desc = "Open parent directory" },
{ "<BS>", "<CMD>Oil<CR>", desc = "Open parent directory" },
},
opts = {
skip_confirm_for_simple_edits = true,
view_options = {
show_hidden = true,
},
keymaps = {
["<BS>"] = "actions.parent",
},
},
},
}

View File

@@ -1,68 +0,0 @@
return {
{
"nvim-treesitter/nvim-treesitter",
version = false,
build = ":TSUpdate",
event = { "BufReadPost", "BufWritePost", "BufNewFile" },
opts = {
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
indent = { enable = true },
ensure_installed = "all",
sync_install = false,
matchup = { enable = true },
},
main = "nvim-treesitter.configs",
init = function()
vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
vim.opt.foldtext = "v:lua.vim.treesitter.foldtext()"
end
},
{
"folke/ts-comments.nvim",
opts = {},
event = "VeryLazy",
},
{
"danymat/neogen",
dependencies = "nvim-treesitter/nvim-treesitter",
opts = {
languages = {
cs = {
template = {
annotation_convention = "xmldoc",
},
},
},
},
keys = {
{ "<leader>n", "<cmd>Neogen<cr>", desc = "Generate documentation" },
},
},
{
"andymass/vim-matchup",
event = { "BufReadPost", "BufWritePost", "BufNewFile" },
init = function()
vim.g.matchup_matchparen_offscreen = { method = "popup" }
end,
config = function()
vim.keymap.del("o", "z%")
end
},
{
"echasnovski/mini.ai",
opts = {
custom_textobjects = {
B = { { "%b{}" }, "^.().*().$" }
},
n_lines = 500,
},
event = "VeryLazy",
},
}

View File

@@ -1,243 +0,0 @@
return {
{
"lukas-reineke/indent-blankline.nvim",
event = { "BufReadPost", "BufWritePost", "BufNewFile" },
main = "ibl",
opts = {
indent = {
char = "",
tab_char = "",
},
exclude = {
filetypes = {
"help",
"alpha",
"dashboard",
"neo-tree",
"Trouble",
"lazy",
"lspinfo",
"packer",
"checkhealth",
"help",
"man",
"",
}
},
scope = { show_start = false, show_end = false, },
},
},
{
"zoriya/virtcolumn.nvim",
-- "xiyaowong/virtcolumn.nvim",
event = "VeryLazy",
init = function()
vim.g.virtcolumn_char = ''
vim.opt.colorcolumn = { 80, 120 }
end,
},
{
"folke/noice.nvim",
event = "VeryLazy",
dependencies = {
"MunifTanjim/nui.nvim",
},
opts = {
presets = {
command_palette = true,
inc_rename = true,
},
messages = { enabled = true },
notify = { enabled = false },
lsp = {
progress = { enabled = false },
signature = { enabled = false },
hover = { enabled = false },
message = { enabled = false },
},
views = {
mini = {
timeout = 2000,
reverse = false,
},
},
-- routes = {
-- -- Remove Checking document notifications from ltx-ls
-- {
-- filter = { event = "lsp", kind = "progress", find = "Checking document" },
-- opts = { skip = true },
-- },
-- },
},
},
{
"j-hui/fidget.nvim",
event = "VeryLazy",
opts = {
progress = {
ignore = { "ltex" },
display = {
render_limit = 5,
},
},
notification = {
override_vim_notify = true,
window = {
winblend = 0,
},
},
},
init = function()
vim.opt.cmdheight = 0
end,
},
{
"luukvbaal/statuscol.nvim",
branch = "0.10",
event = "VeryLazy",
config = function()
local builtin = require("statuscol.builtin")
require("statuscol").setup({
relculright = false,
segments = {
{
sign = {
name = { ".*" },
namespace = { ".*" },
maxwidth = 1,
},
click = "v:lua.ScSa"
},
{ text = { builtin.lnumfunc }, click = "v:lua.ScLa", },
{
sign = { namespace = { "gitsign" }, maxwidth = 1, colwidth = 1 },
click = "v:lua.ScSa"
},
}
})
end
},
{
"folke/which-key.nvim",
event = "VeryLazy",
opts = {
plugins = { spelling = true },
},
init = function()
vim.opt["timeoutlen"] = 500
end,
},
{
"NvChad/nvim-colorizer.lua",
event = "VeryLazy",
opts = {
filetypes = {
'*',
html = { names = true },
css = { names = true },
},
user_default_options = {
mode = "virtualtext",
RGB = false,
RRGGBB = true,
names = false,
RRGGBBAA = true,
AARRGGBB = true,
rgb_fn = true,
hsl_fn = true,
tailwind = true,
},
}
},
{
"stevearc/dressing.nvim",
lazy = true,
init = function()
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.select = function(...)
require("lazy").load({ plugins = { "dressing.nvim" } })
return vim.ui.select(...)
end
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.input = function(...)
require("lazy").load({ plugins = { "dressing.nvim" } })
return vim.ui.input(...)
end
end,
},
{
"folke/trouble.nvim",
keys = {
{ "<leader>lw", "<cmd>Trouble cascade<cr>", desc = "Diagnostics" },
{
"<leader>q",
"<cmd>Trouble close<cr><cmd>cclose<cr>",
desc = "Close quickfix",
},
},
opts = {
auto_close = true,
auto_preview = false,
cycle_results = false,
use_diagnostic_signs = true,
follow = false,
icons = {
indent = {
middle = " ",
last = " ",
top = " ",
ws = "",
},
},
modes = {
diagnostics = {
groups = {
{ "filename", format = "{file_icon} {basename:Title} {count}" },
},
},
cascade = {
mode = "diagnostics", -- inherit from diagnostics mode
filter = function(items)
local severity = vim.diagnostic.severity.HINT
for _, item in ipairs(items) do
severity = math.min(severity, item.severity)
end
return vim.tbl_filter(function(item)
return item.severity == severity
end, items)
end,
},
}
},
},
{
"folke/todo-comments.nvim",
dependencies = "nvim-lua/plenary.nvim",
config = true,
event = "VeryLazy",
},
{
"yorickpeterse/nvim-pqf",
event = "VeryLazy",
config = true,
},
{
"folke/zen-mode.nvim",
keys = {
{ "<leader>z", "<cmd>ZenMode<cr>", desc = "Toogle zen mode" },
},
cmd = "ZenMode",
config = true
},
}

View File

@@ -1,157 +0,0 @@
local options = {
fileencoding = "utf-8",
expandtab = false,
shiftwidth = 4,
tabstop = 4,
cinoptions = {
"(1s",
"m1",
},
hlsearch = true,
ignorecase = true,
smartcase = true,
mouse = "a",
mousemodel = "extend",
splitbelow = true,
splitright = true,
cursorline = true,
sidescrolloff = 8,
wrap = false,
linebreak = true, -- When using set wrap, do not break in the middle of a word.
spell = false,
termguicolors = true,
swapfile = false,
undofile = true,
updatetime = 300, -- faster completion (4000ms default)
number = true,
relativenumber = true,
numberwidth = 4,
signcolumn = "yes",
list = true,
listchars = {
space = "·",
tab = "",
extends = "",
precedes = "",
nbsp = "",
},
fillchars = {
diff = "",
eob = " ",
fold = " ",
foldopen = "",
foldsep = " ",
foldclose = "",
},
completeopt = { "menuone", "popup", "noinsert", "fuzzy" },
pumheight = 15,
foldcolumn = "1",
foldlevel = 99,
foldlevelstart = 99,
foldenable = true,
}
vim.g.loaded_python3_provider = 0
vim.g.loaded_ruby_provider = 0
vim.g.loaded_perl_provider = 0
vim.g.loaded_node_provider = 0
for k, v in pairs(options) do
vim.opt[k] = v
end
-- Disable comment continuations (enter or o/O)
vim.cmd("autocmd BufEnter * set formatoptions-=ro")
vim.cmd("autocmd BufEnter * setlocal formatoptions-=ro")
vim.g.mapleader = " "
vim.g.maplocalleader = " "
-- Stay in indent mode
vim.keymap.set("v", "<", "<gv")
vim.keymap.set("v", ">", ">gv")
-- for all modes except terminal
vim.keymap.set({ "i", "n", "o", "x", "v", "s", "l", "c" }, "<C-c>", "<esc>")
vim.keymap.set("i", "<C-BS>", "<C-w>")
vim.keymap.set("c", "<C-BS>", "<C-w>")
-- vim.keymap.set("i", "<C-H>", "<C-w>") -- Keymap for CTRL-BACKSPACE on some termial emulators.
-- vim.keymap.set("c", "<C-H>", "<C-w>")
-- Center screen when navigating search results
vim.keymap.set("n", "n", "nzzzv", { desc = "Next result" })
vim.keymap.set("n", "N", "Nzzzv", { desc = "Previous result" })
vim.keymap.set({ "n", "x" }, "<leader>y", '"+y', { desc = "Yank to system clipboard" })
vim.keymap.set({ "n", "x" }, "<leader>Y", '"+y$', { desc = "Yank line to system clipboard" })
vim.keymap.set({ "n", "x" }, "<leader>p", '"+p', { desc = "Past from system clipboard" })
vim.keymap.set({ "n", "x" }, "<leader>P", '"+P', { desc = "Past line from system clipboard" })
vim.keymap.set("n", "<C-.>", "<cmd>cnext<CR>zz", { desc = "Next quickfix" })
vim.keymap.set("n", "<C-,>", "<cmd>cprev<CR>zz", { desc = "Prev quickfix" })
vim.keymap.set("n", "<leader>q", "<cmd>cclose<cr>", { desc = "Close quickfix" })
vim.keymap.set('n', '[q', '<cmd>cprev<cr>zvzz', { desc = 'Previous quickfix item' })
vim.keymap.set('n', ']q', '<cmd>cnext<cr>zvzz', { desc = 'Next quickfix item' })
vim.keymap.set('n', '[l', '<cmd>lprev<cr>zvzz', { desc = 'Previous loclist item' })
vim.keymap.set('n', ']l', '<cmd>lnext<cr>zvzz', { desc = 'Next loclist item' })
vim.keymap.set("t", "<esc>", "<C-\\><C-N>", { desc = "Normal mode" })
vim.keymap.set({ "n", "x" }, "gq", "gw", { desc = "Reformat using textwidth (tw)", noremap = true })
-- Clear snippets with C-l and go to next/prev with C-n & C-p
vim.keymap.set("n", "<C-l>", function()
if vim.snippet then
vim.snippet.stop()
end
return "<cmd>nohlsearch<cr><cmd>diffupdate<cr><C-l>"
end, { expr = true })
vim.keymap.set({ "i", "s" }, "<C-n>", function()
if vim.snippet.active({ direction = 1 }) then
vim.snippet.jump(1)
end
end)
vim.keymap.set({ "i", "s" }, "<C-p>", function()
if vim.snippet.active({ direction = -1 }) then
vim.snippet.jump(-1)
end
end)
vim.cmd("autocmd FileType qf setl nolist")
vim.api.nvim_create_autocmd('TextYankPost', {
group = vim.api.nvim_create_augroup("HighlightYank", { clear = true }),
desc = "highlight on yank",
callback = function()
vim.highlight.on_yank({
higroup = 'Visual',
timeout = 200,
})
end,
})
vim.g.zig_fmt_autosave = 0
vim.g.omni_sql_no_default_maps = 1
vim.g.clipboard = {
name = 'OSC 52',
copy = {
['+'] = require('vim.ui.clipboard.osc52').copy('+'),
['*'] = require('vim.ui.clipboard.osc52').copy('*'),
},
paste = {
['+'] = require('vim.ui.clipboard.osc52').paste('+'),
['*'] = require('vim.ui.clipboard.osc52').paste('*'),
},
}

View File

@@ -1,98 +0,0 @@
local previewers = require("telescope.previewers")
local pickers = require("telescope.pickers")
local finders = require("telescope.finders")
local make_entry = require "telescope.make_entry"
local utils = require "telescope.utils"
local putils = require "telescope.previewers.utils"
local from_entry = require "telescope.from_entry"
local conf = require("telescope.config").values
local actions = require "telescope.actions"
local action_state = require "telescope.actions.state"
local function map(t, f)
local t1 = {}
for i = 1, #t do
t1[i] = f(t[i])
end
return t1
end
local git_file_show = function(opts)
return previewers.new_buffer_previewer {
title = "Git File Diff Preview",
get_buffer_by_name = function(_, entry)
return entry.value
end,
define_preview = function(self, entry, status)
if entry.status and (entry.status == "??" or entry.status == "A ") then
local p = from_entry.path(entry, true)
if p == nil or p == "" then
return
end
conf.buffer_previewer_maker(p, self.state.bufnr, {
bufname = self.state.bufname,
winid = self.state.winid,
})
else
putils.job_maker({ "git", "--no-pager", "show", opts.ref, entry.value }, self.state.bufnr, {
value = entry.value,
bufname = self.state.bufname,
cwd = opts.cwd,
callback = function(bufnr)
if vim.api.nvim_buf_is_valid(bufnr) then
putils.regex_highlighter(bufnr, "diff", opts)
end
end,
})
end
end,
}
end
local git_show = function(opts)
opts = opts or {}
opts.cwd = opts.cwd or vim.loop.cwd()
opts.ref = opts.ref or "HEAD"
local gen_new_finder = function()
local git_cmd = { "git", "show", "--name-status", '--pretty=tformat:', opts.ref }
local output = utils.get_os_command_output(git_cmd, opts.cwd)
-- We convert {StatusInOneChar}\t{Path} to {StatusInOneChar}{NoStatusInOneChar} {Path} where NoStatusInOneChar is a space.
-- This is to conform to git status --porcelaine=v1
output = map(output, function(x) return string.gsub(x, "\t", " ", 1) end)
return finders.new_table {
results = output,
entry_maker = make_entry.gen_from_git_status(opts),
}
end
local initial_finder = gen_new_finder()
if not initial_finder then
return
end
pickers
.new(opts, {
prompt_title = "Git show " .. opts.ref,
finder = initial_finder,
previewer = git_file_show(opts),
attach_mappings = function(prompt_bufnr, _)
actions.select_default:replace(function()
actions.close(prompt_bufnr)
local selection = action_state.get_selected_entry()
-- Run git show {opts.ref} {selection.value}
end)
return true
end,
})
:find()
end
return require("telescope").register_extension {
setup = function() end,
exports = {
git_show = git_show
},
}

View File

@@ -1,71 +0,0 @@
Lucca
epitech
includegraphics
lucca
toc
Lucca's
acrfull
acrshort
Pagga
Silae's
Gls
gls
KPI
dotnet's
kubernetess
RabbitMQ
Redis
Kyoo
transmuxing
HLS
mp4
m3u8
ffmpeg
h264
hls
br
th
png
paintjs
tv
copyts
config
postgres
meilisearch's
api
backend
sha1
mimetype
ex
BCP
IETF
fmp4
m4s
onboarding
Talos
movflags
ss
param
keyframe
keyframes
muxdelay
noaccurate
transmux
loglevel
nostats
goroutines
RLock
isSegmentReady
getMinEncoderDistance
EXTINF
IsDone
stdout
json
av01
av1
hvc1
hevc
h265
avc1
mediainfo
gameboy

100
modules/cli/tools/git.nix Normal file
View File

@@ -0,0 +1,100 @@
{lib, ...}: {
options.git = {
useRsa = lib.mkEnableOption "Use rsa instead of ed25519";
};
config.programs.git = {
enable = true;
ignores = [".envrc"];
signing = {
signByDefault = true;
key =
if true #config.git.useRsa
then "~/.ssh/id_rsa.pub"
else "~/.ssh/id_ed25519.pub";
};
# maintenance = {
# enable = false;
# # TODO: figure out a way to specify all repositories in ~/projects & ~/work at run time
# repositories = [];
# };
settings = {
user = {
name = "Zoe Roux";
email = "zoe.roux@zoriya.dev";
};
alias = {
master =
#bash
''
!git symbolic-ref --short refs/remotes/$(git remote | head -n 1)/HEAD | sed 's@.*/@@'
'';
cleanup =
#bash
''
!git branch --merged | grep -vE "^([+*]|\s*($(git master))\s*$)" | xargs git branch --delete 2>/dev/null
'';
nuke =
#bash
''
!git reset --hard HEAD && git clean -df .
'';
};
gpg = {
format = "ssh";
ssh.allowedSignersFile = "~/.ssh/allowed_signers";
};
fetch = {
prune = true;
pruneTags = true;
all = true;
};
push = {
default = "upstream";
autoSetupRemote = true;
};
pull.ff = "only";
init.defaultBranch = "master";
branch.sort = "-committerdate";
tag.sort = "version:refname";
advice = {
diverging = false;
skippedCherryPicks = false;
};
rerere = {
enabled = true;
autoupdate = true;
};
rebase = {
updateRefs = true;
autoStash = true;
autoSquash = true;
};
diff = {
# newer & better diff algo, why is this not the default?
algorithm = "histogram";
colorMoved = "plain";
renames = true;
# use actually understandable prefixes (c/, i/ & w/) instead of a/ b/
mnemonicPrefix = true;
};
# show diff in commit window
commit.verbose = true;
core = {
# Disable hooks (i think i need to run it on each repo too, idk)
hookspath = "/dev/null";
fsmonitor = true;
untrackedCache = true;
};
# Break compat with older versions of git (and systems that doesn't support mtime) to have better performances
feature.manyFiles = true;
clean.requireForce = false;
url = {
"ssh://git@github.com" = {
insteadOf = "https://github.com";
};
};
};
};
}

View File

@@ -0,0 +1,22 @@
{...}: {
programs.jujutsu = {
enable = true;
settings = {
user = {
name = "Zoe Roux";
email = "zoe.roux@zoriya.dev";
};
signing = {
behavior = "own";
backend = "ssh";
allowed-signers = "~/.ssh/allowed_signers";
};
git = {
auto-local-bookmark = true;
};
core = {
fsmonitor = "watchman";
};
};
};
}

View File

@@ -21,7 +21,8 @@ fi
current_session=$(tmux display-message -p "#S")
if ! tmux has-session "-t=$selected_name" 2> /dev/null; then
tmux new-session -ds "$selected_name" -c "$selected"
tmux new-session -ds "$selected_name" -c "$selected" -e "CMD=$EDITOR ."
tmux new-window -dt "$selected_name:1" -c "$selected" -e "CMD="
fi
tmux switch-client -t "$selected_name"

View File

@@ -0,0 +1,64 @@
{pkgs, ...}: {
home.packages = [
(pkgs.writeShellScriptBin "tmux-sessionizer" (builtins.readFile ./tmux-sessionizer.sh))
];
programs.tmux = {
enable = true;
terminal = "tmux-256color";
mouse = true;
focusEvents = true;
aggressiveResize = true;
clock24 = true;
historyLimit = 50000;
# default is 500 which makes vim's esc slow, we do not want 0 because it won't be able to read osc
escapeTime = 50;
keyMode = "vi";
prefix = "C-t";
plugins = with pkgs.tmuxPlugins; [fzf-tmux-url];
extraConfig =
#tmux
''
set -g status off
set -s set-clipboard on
# request clipboard from parent terminal instead of using tmux's internal buffer
set -s get-clipboard request
set -g extended-keys on
# from tmux-sensible
set -g display-time 4000
set -g status-interval 5
bind-key v copy-mode
bind-key -T copy-mode-vi i send -X cancel
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi V send -X select-line
bind-key -T copy-mode-vi y send -X copy-selection -- -x
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-selection -- -x
bind-key -T copy-mode-vi Y send -X copy-end-of-line -- -x
bind-key -T copy-mode-vi p { refresh-client -l; run -d0.05; paste-buffer; send -X cancel }
bind-key [ copy-mode \; send-keys -X previous-prompt
bind-key ] copy-mode \; send-keys -X next-prompt
bind-key -T copy-mode-vi [ send-keys -X previous-prompt
bind-key -T copy-mode-vi ] send-keys -X next-prompt
bind-key f run-shell "tmux neww tmux-sessionizer"
bind-key C-h run-shell "tmux-sessionizer ~/projects/kyoo"
bind-key C-t run-shell "tmux-sessionizer ~/projects/snow"
bind-key C-s run-shell "tmux-sessionizer ~/projects/flake"
bind-key C-n run-shell "tmux-sessionizer ~/projects/blog"
# suspend inner tmux (to allow nested sessions)
bind @ { set prefix None; set key-table off }
# NOTE: C-@ doesn't work since v3.5a (since tmux doesn't support kitty keyboard protocol)
# Instead, we bind f11 and use kitty to remap C-@ to f11.
bind -T off f11 { set -u prefix; set -u key-table }
'';
};
}

View File

@@ -1,8 +1,3 @@
# used by kubectl plugin & maybe some other oh-my-zsh plugins
export ZSH_CACHE_DIR="$HOME/.cache/zsh";
mkdir -p "$ZSH_CACHE_DIR/completions"
fpath+="$ZSH_CACHE_DIR/completions"
# default ls colors
LS_COLORS=${LS_COLORS:-'di=34:ln=35:so=32:pi=33:ex=31:bd=36;01:cd=33;01:su=31;40;07:sg=36;40;07:tw=32;40;07:ow=33;40;07:'}

View File

@@ -1,175 +1,15 @@
{
pkgs,
config,
lib,
...
}: {
home.packages = with pkgs;
[
eza
viu
htop-vim
tldr
fd
duf
ncdu
ripgrep
fzf
nix-your-shell
unzip
sshfs-fuse
zip
scc
bc
glow
gh
yq
alejandra
nodePackages.http-server
nodePackages.live-server
]
++ lib.optionals pkgs.stdenv.isLinux [
usbutils
pciutils
psmisc
];
programs.atuin = {
enable = true;
flags = ["--disable-up-arrow"];
settings = {
update_check = false;
show_preview = true;
};
};
programs.bat = {
enable = true;
config.theme = "base16";
};
programs.command-not-found.enable = false;
programs.nix-index = {
enable = true;
enableZshIntegration = true;
};
programs.less.enable = true;
programs.starship = {
enable = true;
settings = {
add_newline = false;
format = lib.concatStrings [
"$fill"
"$hostname"
"$python"
"$nix_shell"
"$line_break"
"$directory"
"[(\\($git_branch$git_commit$git_status$git_state\\) )](green)"
"$shlvl"
"$character"
];
right_format = lib.concatStrings [
"$cmd_duration"
"$status"
"$jobs"
];
fill = {
symbol = "·";
style = "fg:#808080";
};
directory = {
truncate_to_repo = false;
fish_style_pwd_dir_length = 1;
style = "bold fg:#00AFFF";
};
git_branch = {
format = "([($branch(: $remote_branch))]($style))";
only_attached = true;
style = "green";
};
git_commit = {
format = "[($hash$tag)]($style)";
style = "green";
only_detached = true;
tag_disabled = false;
};
git_status = {
format = "([$all_status$ahead_behind]($style))";
style = "yellow";
ahead = " $count";
behind = " $count";
diverged = "";
conflicted = " =$count";
untracked = " ?$count";
stashed = " *$count";
modified = " !$count";
staged = " +$count";
deleted = "";
renamed = "";
};
git_state = {
format = "( [$state( $progress_current/$progress_total)]($style))";
};
status = {
format = " [($symbol$status(-$signal_name))]($style)";
pipestatus_format = "[$symbol$pipestatus]($style)";
pipestatus_segment_format = "[($signal_name )$status]($style)";
symbol = "x";
pipestatus = true;
disabled = false;
};
cmd_duration = {
format = " [$duration]($style)";
};
jobs = {
symbol = "&";
format = " [$symbol$number]($style)";
};
python = {
format = "[( \($virtualenv\))]($style)";
};
nix_shell = {
format = "[\( $name\) nix]($style)";
style = "cyan";
heuristic = true;
};
hostname = {
format = "[ $ssh_symbol$hostname]($style)";
};
shlvl = {
disabled = false;
format = "[$symbol]($style)";
repeat = true;
symbol = "";
repeat_offset = 1;
threshold = 0;
};
};
};
programs.zsh = {
enable = true;
autocd = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
dotDir = ".config/zsh";
dotDir = "${config.xdg.configHome}/zsh";
shellAliases = {
# ls/exa stuff
l = "ls -l";
@@ -182,29 +22,82 @@
ls = "exa";
lt = "exa --tree";
tree = "exa --tree";
cat = "\bat -pp";
bat = "bat -p";
# git stuff
s = "git status";
gs = "git status";
gl = "git log";
gu = "git pull";
gur = "git pull --rebase";
gum = "git pull origin $(git master)";
gdm = "git diff origin/$(git master)";
gurm = "git pull --rebase origin $(git master)";
gswm = "git switch $(git master)";
grbm = "git rebase origin/$(git master)";
grbmi = "git rebase origin/$(git master) -i";
grhhm = "grhh origin/$(git master)";
grhsm = "grhs origin/$(git master)";
grhho = "grhh @{u}";
gmm = "git merge origin $(git master)";
gcam = "git commit --amend";
gcamn = "git commit --amend --no-edit";
gcpf = "gaa && gcamn && gpf";
gcpfn = "gcamn && gpf";
# Misc
dc = "docker-compose";
dcd = "docker-compose -f docker-compose.dev.yml";
# k8s
k = "kubectl";
op = "xdg-open";
py = "python3 2> /dev/null || nix shell nixpkgs#python3 -c python3";
kubectl = "kubecolor";
kctx = "FZF_DEFAULT_OPTS='--height 10' kubectx";
kns = "kubens";
knsc = "kubectl config set-context --current --namespace ''";
kg = "k get";
kga = "kg $(k api-resources --verbs=list --namespaced -o name | paste -sd ,)";
# use custom function to decode secrets data instead of a simple alias for kgy
# kgy = "k get -o yaml";
kgw = "k get -w";
kd = "k describe";
ka = "k apply";
kaf = "k apply -f";
ke = "k edit";
kl = "k logs";
kp = "k patch";
kc = "k create";
kcy = "kc -o yaml --dry-run=client";
kr = "k rollout";
krr = "k rollout restart";
kpf = "k port-forward";
kdel = "k delete";
kdelf = "k delete -f";
kcleanup = "kdel pod --field-selector status.phase==Failed -A; kdel pod --field-selector status.phase==Succeeded -A";
# Misc
dc = "docker compose";
dcd = "docker compose -f $(setopt extendedglob; echo (../)#docker-compose.dev.yml)";
op =
if pkgs.stdenv.isLinux
then "xdg-open"
else "open";
py = "python3 2> /dev/null || , python3";
jctl = "sudo journalctl -n 1000 -fu";
sloc = "scc";
mi = "mediainfo";
# habits & prevent conflicts with gnu-rename
prename = "rename";
# add labels, replace type by fstype, use a single mountpoint
lsblk = "lsblk -o name,label,size,rm,ro,fstype,uuid,mountpoint";
dr = "direnv reload";
nixos-option = "nixos-option --flake ~/projects/flake";
# i will never remember those flags
ss =
if pkgs.stdenv.isLinux
then "ss -tlpun"
else "netstat -anvp tcp | awk 'NR<3 || /LISTEN/'";
# viu doesn't work with tmux, icat does. using that while waiting
viu = "kitty +kitten icat";
icat = "kitty +kitten icat";
n = "$EDITOR";
vim = "$EDITOR";
vi = "$EDITOR";
@@ -233,29 +126,45 @@
src = pkgs.oh-my-zsh;
file = "share/oh-my-zsh/plugins/git/git.plugin.zsh";
}
{
name = "clipcopy"; # dependency of copypath & copyfile
src = pkgs.oh-my-zsh;
file = "share/oh-my-zsh/lib/clipboard.zsh";
}
{
name = "copypath";
src = pkgs.oh-my-zsh;
file = "share/oh-my-zsh/plugins/copypath/copypath.plugin.zsh";
}
{
name = "copyfile";
src = pkgs.oh-my-zsh;
file = "share/oh-my-zsh/plugins/copyfile/copyfile.plugin.zsh";
}
];
initExtraFirst = ''
completionInit =
#bash
''
# disable zsh-autocomplete plugin compatibility (from zsh-completion-sync)
zstyle ':completion-sync:compinit:compat:zsh-autocomplete' enabled false
# The globbing is a little complicated here:
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct.
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error)
# - '.' matches "regular files"
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours.autoload -Uz compinit
autoload -Uz compinit
source ${./zsh-completion-sync.plugin.zsh}
if [[ -n $ZSH_CACHE_DIR/.zcompdump(#qN.mh+24) ]]; then
compinit;
else
compinit -C;
fi;
# fix kubecolors completions
# this needs to be executed BEFORE completions, contrary to what is done on nix's package:
# https://github.com/NixOS/nixpkgs/blob/20fd9f95cede54a97eef269c80616a86dec213c9/pkgs/by-name/ku/kubecolor/package.nix#L50
compdef kubecolor=kubectl
'';
initContent = let
tmuxInit =
#bash
''
if command -v tmux > /dev/null; then
# Create a new tmux session (with a random name) and attach.
if [[ -z "$TMUX" ]]; then
exec tmux -u new-session -s "#$(hexdump -n 4 -v -e '/1 "%02X"' /dev/urandom)"
elif [[ $SHLVL -eq 1 ]]; then
session=$(tmux display-message -p "#S")
# kill current sesion if we are quiting the only pane
# kill current session if we are quitting the only pane
function __onExit {
if [[ $(tmux list-panes -s -t $session | wc -l) == 1 ]]; then
tmux kill-session -t $session
@@ -263,22 +172,46 @@
}
trap __onExit EXIT
fi
# execute arbitrary commands on startup since `zsh -sc` is not a real option :c
if [[ -n CMD ]]; then
# unset the cmd before executing it (for long processes)
cmd=$CMD
unset CMD
if [[ -n $TMUX ]]; then
tmux set-environment -r CMD
fi
eval $cmd
fi
fi
'';
initExtraBeforeCompInit = builtins.readFile ./comp.zsh;
completionInit = ''
# The globbing is a little complicated here:
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct.
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error)
# - '.' matches "regular files"
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours.autoload -Uz compinit
autoload -Uz compinit
if [[ -n $ZSH_CACHE_DIR/.zcompdump(#qN.mh+24) ]]; then
compinit;
else
compinit -C;
fi;
'';
initExtra = builtins.readFile ./init.zsh;
in
lib.mkMerge [
(lib.mkBefore tmuxInit)
(lib.mkOrder 535 (builtins.readFile ./keymap.zsh))
(lib.mkOrder 550 (builtins.readFile ./comp.zsh))
(lib.mkOrder 901
#bash
''
unset HISTFILE
setopt rm_star_silent
setopt interactivecomments
setopt autopushd
# disable space between right prompt and end of line
ZLE_RPROMPT_INDENT=0
'')
(lib.mkOrder 950 "source ${pkgs.gitstatus}/share/gitstatus/gitstatus.prompt.zsh")
(lib.mkOrder 951 (builtins.readFile ./prompt.zsh))
(lib.mkOrder 1000 (builtins.readFile ./init.zsh))
(lib.mkOrder 1400 ''
# only start atuin if it's in the path (fix distrobox or other temp fs issues)
if command -v atuin > /dev/null && [[ $options[zle] = on ]]; then
eval "$(atuin init zsh ${lib.escapeShellArgs config.programs.atuin.flags})"
fi
'')
(lib.mkOrder 1410 "${lib.getExe pkgs.nix-your-shell} zsh | source /dev/stdin")
];
envExtra = ''
# disable /etc/zshrc & co (nixos one is really bad)
@@ -299,4 +232,130 @@
EDITOR = "nvim";
VISUAL = EDITOR;
};
programs.atuin = {
enable = true;
enableZshIntegration = false;
flags = ["--disable-up-arrow"];
settings = {
update_check = false;
show_preview = true;
style = "full";
inline_height = 0;
sync_address = "https://atuin.sdg.moe";
};
};
programs.distrobox = {
enable = pkgs.stdenv.isLinux; # this is not supported on macos
};
xdg.configFile."distrobox/distrobox.conf".text = ''
container_name_default="archlinux"
container_image_default="quay.io/toolbx/arch-toolbox:latest"
container_additional_volumes="/nix/store:/nix/store:ro /etc/profiles/per-user/zoriya:/etc/profiles/per-user/zoriya:ro"
'';
programs.bat = {
enable = true;
themes = {
catppuccin-latte = {
src = pkgs.catppuccin.override {
variant = "latte";
themeList = ["bat"];
};
file = "bat/Catppuccin Latte.tmTheme";
};
catppuccin-mocha = {
src = pkgs.catppuccin.override {
variant = "mocha";
themeList = ["bat"];
};
file = "bat/Catppuccin Mocha.tmTheme";
};
};
config = {
theme-light = "catppuccin-latte";
theme-dark = "catppuccin-mocha";
};
};
programs.k9s = {
enable = true;
settings = {
k9s = {
ui = {
skin = "transparent";
};
};
};
skins = {
transparent = ./k9s-transparent.yaml;
};
};
programs.less.enable = true;
programs.direnv = {
enable = true;
stdlib =
#bash
''
: "''${XDG_CACHE_HOME:=$HOME/.cache}"
declare -A direnv_layout_dirs
direnv_layout_dir() {
echo "''${direnv_layout_dirs[$PWD]:=$(
local hash="$(sha1sum - <<<"$PWD" | cut -c-7)"
local path="''${PWD//[^a-zA-Z0-9]/-}"
echo "$XDG_CACHE_HOME/direnv/layouts/$hash$path"
)}"
}
'';
nix-direnv.enable = true;
config = {warn_timeout = "500h";};
};
xdg.configFile."gfold.toml".text = ''
display_mode = "Classic"
'';
home.packages = with pkgs;
[
eza
viu
htop-vim
tldr
fd
duf
ncdu
ripgrep
fzf
unzip
sshfs-fuse
zip
scc
bc
glow
gh
yq
nmap # also for ncat
nodePackages.http-server
nvim
rename # this is perl-rename
gfold
lsof
kubectl
kubecolor
kubectx
usql
rsync
moreutils
osc
# bitwarden-cli
]
++ lib.optionals pkgs.stdenv.isLinux [
usbutils
pciutils
psmisc
];
}

View File

@@ -1,16 +1,9 @@
if [[ -n $GHOSTTY_RESOURCES_DIR ]]; then
autoload -Uz -- "$GHOSTTY_RESOURCES_DIR"/shell-integration/zsh/ghostty-integration
ghostty-integration
unfunction ghostty-integration
fi
# This speeds up pasting w/ autosuggest
# https://github.com/zsh-users/zsh-autosuggestions/issues/238
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
}
pastefinish() {
zle -N self-insert $OLD_SELF_INSERT
}
@@ -19,72 +12,20 @@ zstyle :bracketed-paste-magic paste-finish pastefinish
# https://github.com/zsh-users/zsh-autosuggestions/issues/351
ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(bracketed-paste)
# Make sure the terminal is in application mode, when zle is
# active. Only then are the values from $terminfo valid.
if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then
autoload -Uz add-zle-hook-widget
function zle_application_mode_start { echoti smkx }
function zle_application_mode_stop { echoti rmkx }
add-zle-hook-widget -Uz zle-line-init zle_application_mode_start
add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop
fi
# setup keys
typeset -g -A key
key[Home]="${terminfo[khome]}"
key[End]="${terminfo[kend]}"
key[Insert]="${terminfo[kich1]}"
key[Backspace]="${terminfo[kbs]}"
key[Delete]="${terminfo[kdch1]}"
key[Up]="${terminfo[kcuu1]}"
key[Down]="${terminfo[kcud1]}"
key[Left]="${terminfo[kcub1]}"
key[Right]="${terminfo[kcuf1]}"
key[PageUp]="${terminfo[kpp]}"
key[PageDown]="${terminfo[knp]}"
key[Shift-Tab]="${terminfo[kcbt]}"
key[Control-Left]="${terminfo[kLFT5]}"
key[Control-Right]="${terminfo[kRIT5]}"
# start with base emacs commands
bindkey -e
bindkey "${key[Home]}" beginning-of-line
bindkey "${key[End]}" end-of-line
bindkey "${key[Insert]}" overwrite-mode
bindkey "${key[Backspace]}" backward-delete-char
bindkey "${key[Delete]}" delete-char
bindkey "${key[Left]}" backward-char
bindkey "${key[Right]}" forward-char
bindkey "${key[PageUp]}" beginning-of-buffer-or-history
bindkey "${key[PageDown]}" end-of-buffer-or-history
bindkey "${key[Shift-Tab]}" reverse-menu-complete
bindkey "${key[Control-Left]}" backward-word
bindkey "${key[Control-Right]}" forward-word
autoload -Uz up-line-or-beginning-search down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey "${key[Up]}" up-line-or-beginning-search
bindkey "${key[Down]}" down-line-or-beginning-search
# ^Z when a job is suspended runs it in the foreground.
foreground() {
fg
}
zle -N foreground
bindkey ^Z foreground
eval "$(nix-your-shell zsh)"
setopt rm_star_silent
setopt interactivecomments
setopt autopushd
bindkey '^Z' foreground
(whence -w run-help | grep -q alias) && unalias run-help
autoload run-help
autoload edit-command-line
zle -N edit-command-line
bindkey '^Xe' edit-command-line
# Allow customization per client.
[[ -f ~/.config/zsh/custom.zsh ]] && source ~/.config/zsh/custom.zsh
@@ -98,11 +39,6 @@ push() {
git add -A && git commit -m "$*" && git push
}
git-branch-clear() {
git fetch --prune origin
git branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -D
}
nixify() {
if [ ! -e ./.envrc ]; then
echo "use nix" > .envrc
@@ -144,28 +80,38 @@ dotenv() {
fi
}
robot_install() {
robot=$(\where -p robot)
if [[ $? -eq 1 ]]; then
pyt=$(\where -p python3)
if [[ $? -eq 1 ]]; then
nix-shell -p python3
fi
python3 -m venv /tmp/robot
source /tmp/robot/bin/activate
pip3 install robotframework RESTinstance
fi
}
touchp() {
mkdir -p "$(dirname "$1")" && touch "$1"
}
proxy() {
echo "Proxying port $1 to http://proxy.sdg.moe"
ssh -NR "5000:localhost:$1" ssh.sdg.moe
s() {
git status 2>/dev/null
if [[ $? -ne 0 ]]; then
gfold
fi
}
# disable space between right prompt and end of line
ZLE_RPROMPT_INDENT=0
# keep yq's output in yaml & colorizes it
yq() {
# if `-r` is in the arguments, do not add the -Y flag because it breaks yq.
if ! (( $argv[(I)-r] )); then
argv+=(-Y)
fi
command yq "${argv[@]}" | bat -ppl yaml
}
kgy() {
kubectl get -o yaml "$@" | yq 'if .kind == "Secret" then .stringData = (.data | with_entries(.value |= @base64d)) else . end'
}
_kgy() {
words="kubectl get -o yaml ${words[@]:1}"
_kubectl
}
compdef _kgy kgy
alias copyfile="osc copy"
copypath() {
local file="${1:-.}"
[[ $file = /* ]] || file="$PWD/$file"
print -n "${file:a}" | osc copy || return 1
}

View File

@@ -0,0 +1,76 @@
# Simply copy-pasted from https://github.com/derailed/k9s/blob/master/skins/kiss.yaml
# -----------------------------------------------------------------------------
# K9s Kiss Skin
# Author: [@beejeebus](justin.p.randell@gmail.com)
# -----------------------------------------------------------------------------
# Skin...
k9s:
body:
fgColor: default
bgColor: default
logoColor: default
prompt:
fgColor: default
bgColor: default
suggestColor: default
info:
fgColor: default
sectionColor: default
dialog:
fgColor: default
bgColor: default
buttonFgColor: default
buttonBgColor: default
buttonFocusFgColor: default
buttonFocusBgColor: default
labelFgColor: default
fieldFgColor: default
frame:
border:
fgColor: default
focusColor: default
menu:
fgColor: default
keyColor: default
numKeyColor: default
crumbs:
fgColor: default
bgColor: default
activeColor: default
status:
newColor: default
modifyColor: default
addColor: default
errorColor: default
highlightColor: default
killColor: default
completedColor: default
title:
fgColor: default
bgColor: default
highlightColor: default
counterColor: default
filterColor: default
views:
table:
fgColor: default
bgColor: default
cursorFgColor: default
cursorBfColor: default
header:
fgColor: default
bgColor: default
sorterColor: default
yaml:
keyColor: default
colonColor: default
valueColor: default
logs:
fgColor: default
bgColor: default
indicator:
fgColor: default
bgColor: default
toggleOnColor: default
toggleOffColor: default

View File

@@ -0,0 +1,54 @@
# Make sure the terminal is in application mode, when zle is
# active. Only then are the values from $terminfo valid.
if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then
autoload -Uz add-zle-hook-widget
function zle_application_mode_start { echoti smkx; }
function zle_application_mode_stop { echoti rmkx; }
add-zle-hook-widget -Uz zle-line-init zle_application_mode_start
add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop
fi
# setup keys
typeset -g -A key
key[Home]="${terminfo[khome]}"
key[End]="${terminfo[kend]}"
key[Insert]="${terminfo[kich1]}"
key[Backspace]="${terminfo[kbs]}"
key[Delete]="${terminfo[kdch1]}"
key[Up]="${terminfo[kcuu1]}"
key[Down]="${terminfo[kcud1]}"
key[Left]="${terminfo[kcub1]}"
key[Right]="${terminfo[kcuf1]}"
key[PageUp]="${terminfo[kpp]}"
key[PageDown]="${terminfo[knp]}"
key[Shift-Tab]="${terminfo[kcbt]}"
key[Control-Left]="${terminfo[kLFT5]}"
key[Control-Right]="${terminfo[kRIT5]}"
# start with base emacs commands
bindkey -e
bindkey "${key[Home]}" beginning-of-line
bindkey "${key[End]}" end-of-line
bindkey "${key[Insert]}" overwrite-mode
bindkey "${key[Backspace]}" backward-delete-char
bindkey "${key[Delete]}" delete-char
bindkey "${key[Left]}" backward-char
bindkey "${key[Right]}" forward-char
bindkey "${key[PageUp]}" beginning-of-buffer-or-history
bindkey "${key[PageDown]}" end-of-buffer-or-history
bindkey "${key[Shift-Tab]}" reverse-menu-complete
bindkey "${key[Control-Left]}" backward-word
bindkey "${key[Control-Right]}" forward-word
autoload -Uz up-line-or-beginning-search down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey "${key[Up]}" up-line-or-beginning-search
bindkey "${key[Down]}" down-line-or-beginning-search
# sometimes, terminfo is not well maintained so we still need to use ansi sequences
bindkey "^[[A" up-line-or-beginning-search
bindkey "^[[B" down-line-or-beginning-search

View File

@@ -0,0 +1,57 @@
setopt promptsubst
zmodload zsh/datetime
zmodload zsh/mathfunc
zmodload zsh/stat
timer_preexec() {
timer=$EPOCHREALTIME
}
add-zsh-hook preexec timer_preexec
timer_precmd() {
if [ -z $timer ]; then
EXEC_TIME=""
return
fi
local d_s=$((EPOCHREALTIME - timer))
local s=$((int(rint(d_s % 60))))
local m=$((int(rint( (d_s / 60) % 60 ))))
local h=$((int(rint(d_s / 3600))))
if ((h > 0)); then EXEC_TIME=${h}h${m}m
elif ((m > 0)); then EXEC_TIME=${m}m${s}s
elif ((s > 0)); then EXEC_TIME=${s}s
else unset EXEC_TIME
fi
unset timer
}
add-zsh-hook precmd timer_precmd
kube_check_time=0
kube_precmd() {
local mtime=$(zstat +mtime ${KUBECONFIG-~/.kube/config})
if [[ $mtime -gt $kube_check_time ]]; then
KCTX=$(kubectl config current-context)
KNS=$(kubectl config view --minify --output 'jsonpath={..namespace}')
kube_check_time=$EPOCHREALTIME
fi
}
add-zsh-hook precmd kube_precmd
FILL='%F{#808080}${(l.$COLUMNS..·.)}%f'
NEWLINE=$'\n'
WORKDIR='%B%F{blue}%~%b%f'
RO='%F{red}$([ -w . ] || echo ':ro")%f"
# from gitstatusd, sourced before this prompt script
GIT='${GITSTATUS_PROMPT:+ ($GITSTATUS_PROMPT)}'
KUBE='%F{cyan}$KCTX${KNS:+/$KNS}%f'
PROMPT_SHLVL='%(?.%F{green}.%F{red})$(printf "%.0s" {1..$SHLVL})%f'
EXEC_TIME=""
EXIT_CODE='%(?.. %F{red}x${(j[|])pipestatus}%f)'
JOBS='%F{cyan}%(1j. &%j.)%f'
export PROMPT="${FILL}${NEWLINE}${WORKDIR}$RO$GIT $KUBE $PROMPT_SHLVL "
export RPROMPT="\${EXEC_TIME}${EXIT_CODE}${JOBS}"

View File

@@ -0,0 +1,372 @@
# stolen from https://github.com/BronzeDeer/zsh-completion-sync/blob/master/zsh-completion-sync.plugin.zsh
_completion_sync:debug_log(){
if zstyle -t "$1" debug; then
echo "completion sync: $2"
fi
}
_completion_sync:delete_first_from_fpath(){
# There might be multiple instances of the same path on the fpath
# We will only delete the first instance to "reset" the priority order
# but leave later occurences
local idx="$fpath[(Ie)$1]"
if (( $idx != 0 )); then
_completion_sync:debug_log ':completion-sync:fpath:delete' "deleting '$1' from FPATH at index '$idx'"
fpath[$idx]=()
fi
}
_completion_sync:fpath_maybe_add_xdg(){
# There are two valid paths in an XDG_DATA_DIR, one from the zsh install and one from third party
# It is unclear if would ever make sense to add the ones from the zsh install,
# since they should be always on the fpath, but for now we test for both
local p="$1/zsh/$ZSH_VERSION/functions"
if [[ -d $p ]]; then
_completion_sync:debug_log ':completion-sync:xdg:add' "Added '$p' to FPATH"
fpath=("$p" $fpath)
fi
p="$1/zsh/site-functions"
if [[ -d $p ]]; then
_completion_sync:debug_log ':completion-sync:xdg:add' "Added '$p' to FPATH"
fpath=("$p" $fpath)
fi
}
_completion_sync:functions_from_xdg_data(){
local a=($(echo "$XDG_DATA_DIRS" | tr ':' "\n" | xargs -I{} realpath -e "{}/zsh/site-functions" "\n" realpath -e "{}/zsh/$ZSH_VERSION/functions" "\n" realpath -e "{}/zsh/vendor-completions" 2>/dev/null | tr "\n" ' '))
# unique the directories
echo "${(u)a[@]}"
}
# This function directly reads into the completion_sync_fpaths_from_path variable to avoid a subshell invocation
_completion_sync:find_fpaths_from_path(){
local rel_paths=()
if ! zstyle -g rel_paths ':completion-sync:path' rel_paths; then
rel_paths=("../share/zsh/$ZSH_VERSION/functions" '../share/zsh/site-functions')
fi
completion_sync_fpaths_from_path=()
for p in $path; do
for rp in $rel_paths; do
local maybe_fpath="$p/$rp"
# This is the equivalent of using readlink on the path (i.e. canonicalize it, and resolve symlinks)
_completion_sync:debug_log ':completion-sync:path:path2fpath:candidate' "fpath candidate: $maybe_fpath"
maybe_fpath=${maybe_fpath:A}
_completion_sync:debug_log ':completion-sync:path:path2fpath:candidate:canonicalize' "fpath candidate (canonicalized): $maybe_fpath"
if [[ -d "$maybe_fpath" ]]; then
_completion_sync:debug_log ':completion-sync:path:path2fpath' "found fpath on path: $maybe_fpath"
completion_sync_fpaths_from_path=("$maybe_fpath" $completion_sync_fpaths_from_path)
fi
done
done
# unique the directories
_completion_sync:debug_log ':completion-sync:path:path2fpath:unique' "fpaths on path (non-unique):\n${(F)completion_sync_fpaths_from_path}\n"
completion_sync_fpaths_from_path=(${(u)completion_sync_fpaths_from_path[@]})
_completion_sync:debug_log ':completion-sync:path:path2fpath:unique' "fpaths on path (unique):\n${(F)completion_sync_fpaths_from_path}\n"
}
_completion_sync:custom_compinit_isenabled(){
zstyle -t ':completion-sync:compinit:custom' enabled
return
}
_completion_sync:zsh_autocomplete_compat_isenabled(){
# set return code to !custom_isenabled && compat:zsh-autocomplete enabled
_completion_sync:custom_compinit_isenabled
if [[ $? -ne 0 ]]; then
zstyle -T ':completion-sync:compinit:compat:zsh-autocomplete' enabled
return
else
return 1
fi
}
_completion_sync:zsh_autocomplete_compat_disable(){
zstyle ':completion-sync:compinit:compat:zsh-autocomplete' enabled false
}
_completion_sync:zsh_autocomplete_compat_reload(){
# If zsh-autocomplete is loaded, it will either be in the fully initiliazed state, or the pre-initialized state
# In the pre-initilaized state, a precmd hook is waiting to execute, which will setup the plugin and among other things reload compinit and define a named-directory
# Instead of waiting for the pre-cmd hook to fire, we want it to execute right now.
# Find the autocomplete hook if present
local precmd=${(M)precmd_functions:#.autocomplete*precmd}
# If the plugin is already fully initialized, then the relevant functions have been undefined and we need to re-initialize it from the start.
if [[ -z $precmd ]]; then
# In this case the named directory "~zsh-autocomplete" will be present, which we can use to reload regardless of install location
if [[ ! -v nameddirs[zsh-autocomplete] ]]; then
_completion_sync:debug_log ':completion-sync:compinit:compat:zsh-autocomplete' "compat: zsh-autocomplete: unable to detect plugin setup functions or named directory, disabling compat"
_completion_sync:zsh_autocomplete_compat_disable
return 1
else
# Since the named directory exists we can source the plugin again, which will put the precmd hook back in the array
_completion_sync:debug_log ':completion-sync:compinit:compat:zsh-autocomplete' "compat: zsh-autocomplete: re-initializing zsh-autocomplete via 'source ~zsh-autocomplete/zsh-autocomplete.plugin.zsh'"
source ~zsh-autocomplete/zsh-autocomplete.plugin.zsh
precmd=${(M)precmd_functions:#.autocomplete*precmd}
if [[ -z $precmd ]]; then
echo "completion-sync: compat: zsh-autocomplete: unable to detect plugin setup functions even after reinitializing, disabling compat"
_completion_sync:zsh_autocomplete_compat_disable
return 1
fi
fi
fi
# Execute the precmd hook, this will re-initialize the compsys (since we are handling the zcompdump file)
_completion_sync:debug_log ':completion-sync:compinit:compat:zsh-autocomplete' "compat: zsh-autocomplete: executing precmd hook '$precmd' now"
_completion_sync:debug_log ':completion-sync:compinit:compat:zsh-autocomplete:diff' "compat: zsh-autocomplete: precmd hooks before"
_completion_sync:debug_log ':completion-sync:compinit:compat:zsh-autocomplete:diff' "$precmd_functions"
$precmd
_completion_sync:debug_log ':completion-sync:compinit:compat:zsh-autocomplete:diff' "compat: zsh-autocomplete: precmd hooks after"
_completion_sync:debug_log ':completion-sync:compinit:compat:zsh-autocomplete:diff' "$precmd_functions"
}
# Take a path (as first arg) to a zstyle which has two leaf keys "enabled" and "command"
# if enabled is true, eval the string inside command
_completion_sync:run_hook_if_enabled(){
local style="$1"
if zstyle -t "$style" enabled; then
local hook
zstyle -s "$style" command hook
eval "$hook"
fi
}
_completion_sync:compsys_reload(){
# Delete current cache
rm -rf "$_per_shell_compdump"
_completion_sync:run_hook_if_enabled ':completion-sync:compinit:custom:pre-hook'
if _completion_sync:custom_compinit_isenabled ; then
local custom
zstyle -s ':completion-sync:compinit:custom' command custom
_completion_sync:debug_log ':completion-sync:compinit:custom' "compinit: using custom command instead of compinit: ${(q)custom}"
eval $custom
elif _completion_sync:zsh_autocomplete_compat_isenabled ; then
# Reload will either reload zsh-autocomplete or disable the compat if it is not present
if ! _completion_sync:zsh_autocomplete_compat_reload; then
# zsh_autocomplete_compat could not properly reload, the plugin is likely not present, disable compat
_completion_sync:zsh_autocomplete_compat_disable
# Re-run the compsys logic with zac compat disabled
_completion_sync:compsys_reload
fi
else
# Ensure that we call compinit provided from the fpath (default: off)
if zstyle -t ':completion-sync:compinit:builtin-compinit' enabled; then
# Allow us to restore the previous compinit, to be a good citizen
functions -c compinit compinit_orig
# Remove the current compinit to allow for reloading
unfunction compinit
# restore original compinit
autoload +X compinit
_completion_sync:debug_log ':completion-sync:compinit:builtin-compinit' "previous compinit: $(whence -v compinit_orig)"
_completion_sync:debug_log ':completion-sync:compinit:builtin-compinit' "loaded compinit: $(whence -v compinit)"
fi
_completion_sync:debug_log ':completion-sync:compinit' "invoking compinit as 'compinit -d \"$_per_shell_compdump\"'"
compinit -d "$_per_shell_compdump"
if zstyle -t ':completion-sync:compinit:builtin-compinit' enabled; then
# restore original function
functions -c compinit_orig compinit
_completion_sync:debug_log ':completion-sync:compinit:builtin-compinit' "restored compinit: $(whence -v compinit)"
fi
fi
_completion_sync:run_hook_if_enabled ':completion-sync:compinit:custom:post-hook'
}
_completion_sync:path_hook(){
if [[ ! -v COMPLETION_SYNC_OLD_PATH ]]; then
_completion_sync:debug_log ':completion-sync:path:init' "Detecting FPATHs from PATH enabled"
_completion_sync:debug_log ':completion-sync:path:init:diff' "from path: old FPATH\n${(F)fpath}\n"
# Detect current fpaths from path and read it into the variable
_completion_sync:find_fpaths_from_path
# Prepend in reverse order to maintain their order in the final path
for idx in {${#completion_sync_fpaths_from_path}..1} ; do
local elem=${completion_sync_fpaths_from_path[$idx]}
# First time around, only add relevant XDG_DATA_DIRs, which are not on the FPATH yet
if (( ! ${fpath[(I)"$elem"]} )); then
_completion_sync:debug_log ':completion-sync:path:init:diff' "from path: $elem"
fpath=($elem $fpath)
completion_sync_fpath_changed_during_init=true
fi
done
_completion_sync:debug_log ':completion-sync:path:init:diff' "from path: new FPATH\n${(F)fpath}\n"
elif [[ "$COMPLETION_SYNC_OLD_PATH" != "$PATH" ]]; then
_completion_sync:debug_log ':completion-sync:path:onchange' "PATH CHANGED"
# Check if the fpath dirs changed
local completion_sync_old_fpaths_from_path=( "${(@f)completion_sync_fpaths_from_path}" )
if [[ "$completion_sync_old_fpaths_from_path" != "$completion_sync_fpaths_from_path" ]]; then
_completion_sync:debug_log ':completion-sync:path:onchange' "Need to update FPATH from PATH!"
local diff=( "${(@)$(diff <(echo "${(F)completion_sync_fpaths_from_path}") <( echo "${(F)completion_sync_old_fpaths_from_path}") | grep -E "<|>")}" )
_completion_sync:debug_log ':completion-sync:path:diff' "$diff"
# TODO: Generalize without subshell
# Prepend in reverse order to maintain their order in the final path
for idx in {${#diff}..1} ; do
local p=$diff[$idx]
case "${p[1]}" in
\<)
# path got added
local p_path="${p:2}"
_completion_sync:debug_log ':completion-sync:path:onchange:add' "Adding path '$p_path'"
_completion_sync:debug_log ':completion-sync:fpath:add' "Adding '$p_path' to FPATH"
fpath=("$p_path" $fpath)
;;
\>)
# path got removed
local p_path="${p:2}"
_completion_sync:debug_log ':completion-sync:path:onchange:delete' "Removing path '$p_path'"
_completion_sync:delete_first_from_fpath "$p_path"
;;
*)
# This should not happen
_completion_sync:debug_log ':completion-sync:path:onchange' "Invalid diff line $p"
_completion_sync:debug_log ':completion-sync:path:onchange' "Tried to match on character ${p[1]}"
;;
esac
done
else
_completion_sync:debug_log ':completion-sync:path:onchange' "No FPATH change needed"
fi
fi
COMPLETION_SYNC_OLD_PATH="$PATH"
}
_completion_sync:hook(){
if zstyle -t ':completion-sync:path' enabled; then
_completion_sync:path_hook
fi
if zstyle -T ':completion-sync:xdg' enabled; then
if [[ ! -v COMPLETION_SYNC_OLD_XDG_DATA_DIRS ]]; then
_completion_sync:debug_log ':completion-sync:xdg:init' "Syncing XDG_DATA_DIRS into FPATH enabled"
_completion_sync:debug_log ':completion-sync:xdg:init:diff' "old FPATH\n${(F)fpath}"
# First time around, only add relevant XDG_DATA_DIRs, which are not on the FPATH yet
# Find XDG_DATA_DIRS which have $ZSH function dirs under them
completion_sync_old_xdg_fpaths=( $(_completion_sync:functions_from_xdg_data) )
_completion_sync:debug_log ':completion-sync:xdg:init:diff' "adding from XDG"
# Prepend in reverse order to maintain their order in the final path
for idx in {${#completion_sync_old_xdg_fpaths}..1} ; do
local elem="${completion_sync_old_xdg_fpaths[$idx]}"
if (( ! ${fpath[(I)$elem]} )); then
_completion_sync:debug_log ':completion-sync:xdg:init:diff' $elem
fpath=($elem $fpath)
completion_sync_fpath_changed_during_init=true
fi
done
_completion_sync:debug_log ':completion-sync:xdg:init:diff' "New FPATH\n${(F)fpath}"
elif [[ "$COMPLETION_SYNC_OLD_XDG_DATA_DIRS" != "$XDG_DATA_DIRS" ]]; then
_completion_sync:debug_log ':completion-sync:xdg:onchange' "XDG_DATA_DIRS CHANGED"
# Check if the fpath dirs changed
local new_paths=( $(_completion_sync:functions_from_xdg_data) )
if [[ "$completion_sync_old_xdg_fpaths" != "$new_paths" ]]; then
_completion_sync:debug_log ':completion-sync:xdg:onchange' "Need to update FPATH from XDG_DATA_DIRS!"
local diff=( "${(f)$(diff <(echo "${(F)new_paths}") <( echo "${(F)completion_sync_old_xdg_fpaths}") | grep -E "<|>")}" )
_completion_sync:debug_log ':completion-sync:xdg:diff' "$diff"
# Prepend in reverse order to maintain their order in the final path
for idx in {${#diff}..1} ; do
local p=$diff[$idx]
case "${p[1]}" in
\<)
# path got added
local p_path="${p:2}"
_completion_sync:debug_log ':completion-sync:xdg:onchange:add' "Adding path '$p_path'"
_completion_sync:debug_log ':completion-sync:fpath:add' "Adding '$p_path' to FPATH"
fpath=("$p_path" $fpath)
;;
\>)
# path got removed
local p_path="${p:2}"
_completion_sync:debug_log ':completion-sync:xdg:onchange:delete' "Removing path '$p_path'"
_completion_sync:delete_first_from_fpath "$p_path"
;;
*)
# This should not happen
_completion_sync:debug_log ':completion-sync:xdg:onchange' "Invalid diff line $p"
_completion_sync:debug_log ':completion-sync:xdg:onchange' "Tried to match on character ${p[1]}"
;;
esac
done
completion_sync_old_xdg_fpaths=( "${(@f)new_paths}" )
else
_completion_sync:debug_log ':completion-sync:xdg:onchange' "No FPATH change needed"
fi
fi
COMPLETION_SYNC_OLD_XDG_DATA_DIRS="$XDG_DATA_DIRS"
fi
if [[ ! -v completion_sync_old_fpath ]]; then
_completion_sync:debug_log ':completion-sync:fpath:init' "Syncing completions to fpath enabled"
# Do not re-init the first time around unless other init code extended FPATH
if [[ "$completion_sync_fpath_changed_during_init" == "true" ]]; then
_completion_sync:debug_log ':completion-sync:fpath:init' "FPATH Changed during init, reloading compsys!"
_completion_sync:compsys_reload
fi
elif [[ "$completion_sync_old_fpath" != "$fpath" ]]; then
_completion_sync:debug_log ':completion-sync:fpath:onchange' "FPATH Changed!"
if zstyle -t ':completion-sync:fpath:onchange:diff' debug; then
diff <(echo "${(F)fpath}" | sort ) <(echo "${(F)completion_sync_old_fpath}" | sort) | grep -E "<|>"
fi
_completion_sync:compsys_reload
fi
completion_sync_old_fpath=( "${(@f)fpath}" )
}
local compDumpDir="${TMPDIR:-/tmp}/per-shell-zcompdumps"
mkdir -p $compDumpDir
# Create a specific zcompdump for this pid. This allows us to use a zcompdump per shell and identify it later if desired
_per_shell_compdump="$compDumpDir/$$.zcompdump"
# Set the relevant env vars for compdump location, various plugins/mechanisms will create the compdump there
ZSH_COMPDUMP="$_per_shell_compdump"
_comp_dumpfile="$_per_shell_compdump"
typeset -ag precmd_functions
if (( ! ${precmd_functions[(I)_completion_sync:hook]} )); then
# Add our hook last to go after _direnv_hook
precmd_functions=($precmd_functions _completion_sync:hook)
fi
typeset -ag chpwd_functions
if (( ! ${chpwd_functions[(I)_completion_sync:hook]} )); then
# Add our hook last to go after _direnv_hook
chpwd_functions=($chpwd_functions _completion_sync:hook)
fi

View File

@@ -1,151 +1,28 @@
{
config,
pkgs,
zen-browser,
lib,
...
}: let
# When editing this, don't forget to edit home.sessionVariables.
browser = "zen.desktop";
editor = "nvim.desktop";
pdf = "org.pwmt.zathura.desktop";
player = "mpv.desktop";
in {
imports = [
./ghostty.nix
./kitty.nix
./gtk.nix
}: {
environment.systemPackages = with pkgs;
lib.optionals pkgs.stdenv.isx86_64 [
wineWowPackages.stable
wineWowPackages.waylandFull
winetricks
];
home.packages = with pkgs; [
google-chrome
firefox
zen-browser.packages.${pkgs.system}.default
vesktop
mpv
xdg-utils
zathura
libreoffice
qbittorrent
youtube-music
wl-clipboard
wlr-randr
alsa-utils
playerctl
postman
programs.gamescope = {
enable = true;
capSysNice = true;
args = [
"--steam"
"--hdr-enabled"
"--adaptive-sync"
"--fullscreen"
"--expose-wayland"
];
};
hardware.steam-hardware.enable = true;
services.flatpak.enable = true;
home.sessionVariables = rec {
TERMINAL = "ghostty";
BROWSER = "zen";
DEFAULT_BROWSER = BROWSER;
# For rider
FLATPAK_ENABLE_SDK_EXT = "*";
};
xdg = {
enable = true;
mime.enable = true;
mimeApps = {
enable = true;
defaultApplications = {
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
"x-scheme-handler/about" = browser;
"x-scheme-handler/unknown" = browser;
"x-scheme-handler/magnet" = browser;
"application/oxps" = pdf;
"application/pdf" = pdf;
"application/epub+zip" = pdf;
"application/x-fictionbook+xml" = pdf;
"text/tcl" = editor;
"text/html" = editor;
"text/x-makefile" = editor;
"text/vbscript" = editor;
"text/spreadsheet" = editor;
"text/x-tex" = editor;
"text/x-c++hdr" = editor;
"text/x-pascal" = editor;
"text/x-moc" = editor;
"text/x-chdr" = editor;
"text/tab-separated-values" = editor;
"text/x-python" = editor;
"text/x-csrc" = editor;
"text/x-c++src" = editor;
"text/x-java" = editor;
"text/plain" = editor;
"text/csv" = editor;
"video/x-flic" = player;
"video/mpeg" = player;
"video/x-ms-wmv" = player;
"video/vnd.rn-realvideo" = player;
"video/x-theora+ogg" = player;
"video/dv" = player;
"video/webm" = player;
"video/ogg" = player;
"video/quicktime" = player;
"video/x-flv" = player;
"video/x-ogm+ogg" = player;
"video/3gpp2" = player;
"video/mp2t" = player;
"video/x-msvideo" = player;
"video/3gpp" = player;
"video/x-matroska" = player;
"video/vnd.mpegurl" = player;
"video/mp4" = player;
"audio/aac" = player;
"audio/ac3" = player;
"audio/x-wavpack" = player;
"audio/webm" = player;
"audio/x-ms-wma" = player;
"audio/flac" = player;
"audio/x-scpls" = player;
"audio/mpeg" = player;
"audio/x-mpegurl" = player;
"audio/x-ms-asx" = player;
"audio/vnd.rn-realaudio" = player;
"audio/x-wav" = player;
"audio/vnd.dts" = player;
"audio/x-adpcm" = player;
"audio/x-vorbis+ogg" = player;
"audio/mp4" = player;
"audio/x-tta" = player;
"audio/x-musepack" = player;
"audio/AMR" = player;
"audio/x-matroska" = player;
"audio/x-ape" = player;
"audio/x-aiff" = player;
"audio/vnd.dts.hd" = player;
"audio/ogg" = player;
"audio/mp2" = player;
};
};
userDirs = {
enable = true;
download = "${config.home.homeDirectory}/downloads";
desktop = config.home.homeDirectory;
documents = "${config.home.homeDirectory}/stuff";
music = "${config.home.homeDirectory}/stuff";
templates = "${config.home.homeDirectory}/stuff";
videos = "${config.home.homeDirectory}/stuff";
pictures = "${config.home.homeDirectory}/stuff";
publicShare = "${config.home.homeDirectory}/stuff";
};
};
home.file.".face".source = ../../face.png;
# Allow gsettings to work
xdg.systemDirs.data = [
"${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}"
"${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}"
];
xdg.configFile."autostart/vesktop.desktop".text = ''
[Desktop Entry]
Type=Application
Name=Vesktop
Comment=Vesktop autostart script
Exec="${pkgs.vesktop}/bin/vesktop"
StartupNotify=false
Terminal=false
'';
# i lost way too much time understanding why my local server/app can't be reached
networking.firewall.enable = false;
}

View File

@@ -1,45 +0,0 @@
# disable ligatures
font-feature = -calt
theme = light:catppuccin-latte,dark:catppuccin-mocha
cursor-style-blink = false
unfocused-split-opacity = 1
keybind = clear
keybind = ctrl+shift+c=copy_to_clipboard
keybind = ctrl+shift+v=paste_from_clipboard
keybind = ctrl+plus=increase_font_size:1
keybind = ctrl+equal=increase_font_size:1
keybind = ctrl+minus=decrease_font_size:1
keybind = ctrl+zero=reset_font_size
keybind = ctrl+backspace=reset_font_size
keybind = ctrl+shift+comma=reload_config
keybind = ctrl+shift+i=inspector:toggle
window-padding-x = 0
window-padding-y = 0
window-padding-balance = true
window-decoration = false
clipboard-read = allow
clipboard-write = allow
clipboard-trim-trailing-spaces = true
copy-on-select = false
confirm-close-surface = false
quit-after-last-window-closed = true
resize-overlay = never
auto-update = off
# we manually configure it
shell-integration = none
# disabling cursor because it sets it to blink and i hate that
shell-integration-features = no-cursor,sudo,title
window-padding-color = extend
# vim: ft=conf

View File

@@ -1,12 +1,61 @@
{
ghostty,
pkgs,
lib,
...
}: {
xdg.configFile."ghostty/config".source = ./ghostty.config;
{pkgs, ...}: {
programs.ghostty = {
enable = true;
package =
if pkgs.stdenv.isLinux
then pkgs.ghostty
else pkgs.ghostty-bin;
enableZshIntegration = true;
clearDefaultKeybinds = true;
settings = {
font-size = 12;
font-feature = "-calt";
freetype-load-flags = false;
font-style = "semibold";
home.packages = lib.optionals pkgs.stdenv.isLinux [
ghostty.packages.${pkgs.system}.default
theme = "light:Catppuccin Latte,dark:Catppuccin Mocha";
# disabling cursor because it sets it to blink and i hate that
shell-integration-features = "no-cursor,sudo,title";
cursor-style-blink = false;
maximize = true;
window-padding-x = 0;
window-padding-y = 0;
window-padding-balance = true;
window-padding-color = "extend";
window-decoration = false;
app-notifications = false;
confirm-close-surface = false;
resize-overlay = "never";
# avoid dreadfully long startup times
gtk-single-instance = true;
auto-update = "off";
unfocused-split-opacity = 1;
clipboard-read = "allow";
copy-on-select = false;
# make alt-d work
macos-option-as-alt = true;
keybind = [
"ctrl+shift+c=copy_to_clipboard"
"ctrl+shift+v=paste_from_clipboard"
"cmd+c=copy_to_clipboard"
"cmd+v=paste_from_clipboard"
# "XF86Copy=copy_to_clipboard"
# "XF86Paste=paste_from_clipboard"
"ctrl+plus=increase_font_size:1"
"ctrl+equal=increase_font_size:1"
"ctrl+minus=decrease_font_size:1"
"ctrl+zero=reset_font_size"
"ctrl+backspace=reset_font_size"
"ctrl+shift+comma=reload_config"
"ctrl+shift+i=inspector:toggle"
];
};
};
}

181
modules/gui/home.nix Normal file
View File

@@ -0,0 +1,181 @@
{
config,
lib,
pkgs,
zen-browser,
...
}: let
# When editing this, don't forget to edit home.sessionVariables.
browser = "zen.desktop";
editor = "nvim.desktop";
pdf = "org.pwmt.zathura.desktop";
player = "mpv.desktop";
in {
imports = [
./ghostty.nix
./kitty.nix
./gtk.nix
];
home.packages = with pkgs;
[
firefox
zen-browser.packages.${pkgs.system}.default
vesktop
freecad
kicad
xdg-utils
zathura
libreoffice
qbittorrent
youtube-music
wl-clipboard
wlr-randr
alsa-utils
playerctl
]
++ lib.optionals pkgs.stdenv.isx86_64 [google-chrome];
home.sessionVariables = rec {
TERMINAL = "kitty";
BROWSER = "zen";
DEFAULT_BROWSER = BROWSER;
};
programs.mpv = {
enable = true;
config = {
hwdec = "auto";
};
scripts = with pkgs.mpvScripts; [
mpris
];
};
xdg = {
enable = true;
mime.enable = true;
mimeApps = {
enable = true;
defaultApplications = {
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
"x-scheme-handler/about" = browser;
"x-scheme-handler/unknown" = browser;
"x-scheme-handler/magnet" = browser;
"application/oxps" = pdf;
"application/pdf" = pdf;
"application/epub+zip" = pdf;
"application/x-fictionbook+xml" = pdf;
"text/tcl" = editor;
"text/html" = editor;
"text/x-makefile" = editor;
"text/vbscript" = editor;
"text/spreadsheet" = editor;
"text/x-tex" = editor;
"text/x-c++hdr" = editor;
"text/x-pascal" = editor;
"text/x-moc" = editor;
"text/x-chdr" = editor;
"text/tab-separated-values" = editor;
"text/x-python" = editor;
"text/x-csrc" = editor;
"text/x-c++src" = editor;
"text/x-java" = editor;
"text/plain" = editor;
"text/csv" = editor;
"video/x-flic" = player;
"video/mpeg" = player;
"video/x-ms-wmv" = player;
"video/vnd.rn-realvideo" = player;
"video/x-theora+ogg" = player;
"video/dv" = player;
"video/webm" = player;
"video/ogg" = player;
"video/quicktime" = player;
"video/x-flv" = player;
"video/x-ogm+ogg" = player;
"video/3gpp2" = player;
"video/mp2t" = player;
"video/x-msvideo" = player;
"video/3gpp" = player;
"video/x-matroska" = player;
"video/vnd.mpegurl" = player;
"video/mp4" = player;
"audio/aac" = player;
"audio/ac3" = player;
"audio/x-wavpack" = player;
"audio/webm" = player;
"audio/x-ms-wma" = player;
"audio/flac" = player;
"audio/x-scpls" = player;
"audio/mpeg" = player;
"audio/x-mpegurl" = player;
"audio/x-ms-asx" = player;
"audio/vnd.rn-realaudio" = player;
"audio/x-wav" = player;
"audio/vnd.dts" = player;
"audio/x-adpcm" = player;
"audio/x-vorbis+ogg" = player;
"audio/mp4" = player;
"audio/x-tta" = player;
"audio/x-musepack" = player;
"audio/AMR" = player;
"audio/x-matroska" = player;
"audio/x-ape" = player;
"audio/x-aiff" = player;
"audio/vnd.dts.hd" = player;
"audio/ogg" = player;
"audio/mp2" = player;
};
};
userDirs = {
enable = true;
download = "${config.home.homeDirectory}/downloads";
desktop = config.home.homeDirectory;
documents = "${config.home.homeDirectory}/stuff";
music = "${config.home.homeDirectory}/stuff";
templates = "${config.home.homeDirectory}/stuff";
videos = "${config.home.homeDirectory}/stuff";
pictures = "${config.home.homeDirectory}/stuff";
publicShare = "${config.home.homeDirectory}/stuff";
};
};
home.file.".face".source = ../../face.png;
xdg.configFile."autostart/vesktop.desktop".text = ''
[Desktop Entry]
Type=Application
Name=Vesktop
Comment=Vesktop autostart script
Exec="${pkgs.vesktop}/bin/vesktop"
StartupNotify=false
Terminal=false
'';
# override to start with gamescope
xdg.desktopEntries."com.valvesoftware.Steam.desktop" = let
start-steam = pkgs.writeShellScriptBin "start-steam" ''
CMD="flatpak run --branch=stable --arch=x86_64 --command=/app/bin/steam --file-forwarding com.valvesoftware.Steam @@u %U @@"
# gamescope doesn't detect output size
# other args are defined in programs.gamescope.args
${lib.getExe pkgs.gamescope} \
"-W" "$(niri msg -j focused-output | jq -r '.modes.[.current_mode].width')" \
"-w" "$(niri msg -j focused-output | jq -r '.modes.[.current_mode].width')" \
"-H" "$(niri msg -j focused-output | jq -r '.modes.[.current_mode].height')" \
"-h" "$(niri msg -j focused-output | jq -r '.modes.[.current_mode].height')" \
-- $CMD
'';
in {
name = "Steam (gamescope)";
comment = "Application for managing and playing games on Steam";
exec = lib.getExe start-steam;
icon = "com.valvesoftware.Steam";
terminal = false;
type = "Application";
categories = ["Network" "FileTransfer" "Game"];
mimeType = ["x-scheme-handler/steam" "x-scheme-handler/steamlink"];
};
}

View File

@@ -1,53 +1,40 @@
{ pkgs, ... }: {
{pkgs, ...}: {
programs.kitty = {
enable = true;
settings = {
font_size = 12;
cursor_shape = "beam";
hide_window_decorations = "yes";
enable_audio_bell = false;
cursor_blink_interval = 0;
confirm_os_window_close = 0;
disable_ligatures = "always";
#placement_strategy bottom-center
placement_strategy = "bottom";
tab_bar_min_tabs = 3;
tab_bar_style = "separator";
tab_bar_edge = "top";
dynamic_background_opacity = true;
paste_actions = "quote-urls-at-prompt,replace-dangerous-control-codes";
clipboard_control = "write-clipboard read-clipboard write-primary read-primary";
};
# Use ghostty one instead
shellIntegration.enableZshIntegration = false;
extraConfig = ''
font_size 12
clear_all_shortcuts yes
kitty_mod alt
map ctrl+shift+c copy_to_clipboard
map ctrl+shift+v paste_from_clipboard
map XF86Copy copy_to_clipboard
map XF86Paste paste_from_clipboard
map ctrl+equal change_font_size current +1.0
map ctrl+plus change_font_size current +1.0
map ctrl+minus change_font_size current -1.0
map ctrl+0 change_font_size current 0
map ctrl+backspace change_font_size current 0
map kitty_mod+e scroll_line_up
map kitty_mod+y scroll_line_down
map kitty_mod+o scroll_to_prompt -1
map kitty_mod+i scroll_to_prompt 1
map kitty_mod+space show_last_command_output
cursor_shape beam
include light.conf
include theme.conf
# this is used to map
map ctrl+@ send_key f11
'';
};
xdg.configFile."kitty/light.conf".source = "${pkgs.kitty-themes}/share/kitty-themes/themes/Catppuccin-Latte.conf";
xdg.configFile."kitty/dark.conf".source = "${pkgs.kitty-themes}/share/kitty-themes/themes/Catppuccin-Mocha.conf";
# programs.zsh.shellAliases = {
# ssh = "kitty +kitten ssh";
# };
xdg.configFile."kitty/light-theme.auto.conf".source = "${pkgs.kitty-themes}/share/kitty-themes/themes/Catppuccin-Latte.conf";
xdg.configFile."kitty/dark-theme.auto.conf".source = "${pkgs.kitty-themes}/share/kitty-themes/themes/Catppuccin-Mocha.conf";
xdg.configFile."kitty/no-preference-theme.auto.conf".source = "${pkgs.kitty-themes}/share/kitty-themes/themes/Catppuccin-Mocha.conf";
}

View File

@@ -1,8 +1,4 @@
{
pkgs,
astal,
...
}: let
{pkgs, ...}: let
covercolors = pkgs.stdenv.mkDerivation {
name = "covercolors";
dontUnpack = true;
@@ -16,12 +12,11 @@
installPhase = "install -Dm755 ${./covercolors.py} $out/bin/covercolors";
};
# systemdTarget = "graphical-session.target";
ags = pkgs.ags.overrideAttrs (_: prev: {
ags = pkgs.ags_1.overrideAttrs (_: prev: {
buildInputs =
prev.buildInputs
++ [
pkgs.libdbusmenu-gtk3
astal.packages.${pkgs.system}.river
];
});
in {

View File

@@ -19,16 +19,16 @@ export const Bar = (monitor) =>
anchor: ["top", "left", "right"],
layer: "bottom",
child: Widget.CenterBox({
startWidget: Widget.Box({
children: [
wm.Tags({
monitor,
labels: ["一", "二", "三", "四", "五", "六", "七", "八", "九"],
}),
wm.Layout({ monitor }),
wm.ClientLabel({ monitor }),
],
}),
// startWidget: Widget.Box({
// children: [
// wm.Tags({
// monitor,
// labels: ["一", "二", "三", "四", "五", "六", "七", "八", "九"],
// }),
// wm.Layout({ monitor }),
// wm.ClientLabel({ monitor }),
// ],
// }),
centerWidget: Widget.Box({
hpack: "center",
children: [

View File

@@ -1,99 +1,96 @@
import Gdk from "gi://Gdk?version=3.0";
import AstalRiver from "gi://AstalRiver";
const river = AstalRiver.River.get_default();
const display = Gdk.Display.get_default();
/** @param {number} monitor */
const getOutput = (monitor) => {
const monitorName = display
.get_default_screen()
.get_monitor_plug_name(monitor);
return river.get_output(monitorName);
};
/** @param {{monitor: number, labels: string[]} & import("types/widgets/box").BoxProps} props */
export const Tags = ({ monitor, labels, ...props }) =>
Widget.Box(props).hook(
river,
(self) => {
const output = getOutput(monitor);
if (!output) return;
const focused = output.focused_tags;
const occupied = output.occupied_tags;
const urgent = output.urgent_tags;
self.children = Array.from({ length: 9 }, (_, i) => i).map((i) =>
TagItem({
output,
occupied: !!(occupied & (1 << i)),
selected: !!(focused & (1 << i)),
urgent: !!(urgent & (1 << i)),
i,
label: labels[i],
}),
);
self.children.forEach((button, i) => {
// We need to set this here because assigning children to self calls show_all() and ignore visibility
// @ts-ignore
button.visible = button.attribute;
});
},
"changed",
);
/** @param {{
* occupied: boolean,
* selected: boolean,
* urgent: boolean,
* i: number,
* output: any,
* label: string
* }} props */
const TagItem = ({ occupied, selected, urgent, i, output, label }) =>
Widget.EventBox({
classNames: [selected ? "accent" : "", urgent ? "secondary" : ""],
attribute: occupied || selected,
onPrimaryClickRelease: () => {
river.run_command_async(["set-focused-tags", `${1 << i}`], null);
},
onSecondaryClickRelease: () => {
const tags = output.get_focused_tags() ^ (1 << i);
river.run_command_async(["set-focused-tags", `${tags}`], null);
},
onMiddleClickRelease: () => {
river.run_command_async(["set-view-tags", `${1 << i}`], null);
},
child: Widget.Label({ label, className: "tags" }),
});
/** @param {{monitor: number } & import("types/widgets/label").LabelProps} props */
export const Layout = ({ monitor, ...props }) =>
Widget.Label({
className: "module",
...props,
}).hook(
river,
(self) => {
const output = getOutput(monitor);
if (!output) return;
self.label = output.layout_name;
},
"changed",
);
/** @param {{monitor: number, fallback?: string} & import("types/widgets/label").LabelProps} props */
export const ClientLabel = ({ monitor, fallback = "", ...props }) =>
Widget.Label({
truncate: "end",
maxWidthChars: 25,
className: "module",
...props,
}).hook(
river,
(self) => {
const output = getOutput(monitor);
if (!output) return;
self.label = output.focused_view || fallback;
},
"changed",
);
// const hyprland = await Service.import("hyprland");
//
// const display = Gdk.Display.get_default();
// /** @param {number} monitor */
// const getMonitorName = (monitor) => {
// return display.get_default_screen().get_monitor_plug_name(monitor);
// };
//
// /** @type {Record<number, boolean>} */
// const urgents = {}
//
// /** @param {{monitor: number, labels: string[]} & import("types/widgets/box").BoxProps} props */
// export const Tags = ({ monitor, labels, ...props }) => {
// const monName = getMonitorName(monitor);
// // @ts-ignore
// return Widget.Box({
// ...props,
// children: Array.from({ length: 9 }, (_, i) => i).map((i) =>
// Widget.EventBox({
// child: Widget.Label({ label: labels[i], className: "tags" }),
// attribute: i + 1,
// onPrimaryClickRelease: () => {
// hyprland.message(`dispatch workspace ${i + 1}`);
// },
// }),
// ),
// setup: (self) => {
// self.hook(hyprland, (_, address) => {
// const client = hyprland.getClient(address);
// if (!client) return;
// const ws = client.workspace.id;
// urgents[ws] = true;
// }, "urgent-window");
//
// self.hook(hyprland, () =>
// self.children.forEach((btn) => {
// const mon = hyprland.monitors.find((x) => x.name === monName);
// const ws = hyprland.workspaces.find((x) => x.id === btn.attribute);
//
// const occupied = (ws?.windows ?? 0) > 0;
// const selected = mon?.activeWorkspace?.id === btn.attribute;
// if (selected) urgents[btn.attribute] = false;
// const urgent = urgents[btn.attribute];
//
// btn.visible = occupied || selected;
// btn.class_names = [
// selected ? "accent" : "",
// urgent ? "secondary" : "",
// ];
// }),
// );
// },
// });
// };
//
// /** @param {{monitor: number } & import("types/widgets/label").LabelProps} props */
// export const Layout = ({ monitor, ...props }) => {
// const monName = getMonitorName(monitor);
// return Widget.Label({
// className: "module",
// ...props,
// }).hook(
// hyprland,
// (self) => {
// const mon = hyprland.monitors.find((x) => x.name === monName);
// const ws = hyprland.workspaces.find(
// (x) => x.id === mon?.activeWorkspace?.id,
// );
// self.label = ws?.windows ? `[${ws?.windows}]` : "";
// },
// "changed",
// );
// }
//
// /** @param {{monitor: number, fallback?: string} & import("types/widgets/label").LabelProps} props */
// export const ClientLabel = ({ monitor, fallback = "", ...props }) => {
// const monName = getMonitorName(monitor);
// return Widget.Label({
// truncate: "end",
// maxWidthChars: 25,
// className: "module",
// ...props,
// }).hook(
// hyprland,
// (self) => {
// const mon = hyprland.monitors.find((x) => x.name === monName);
// const ws = hyprland.workspaces.find(
// (x) => x.id === mon?.activeWorkspace?.id,
// );
// self.label = ws?.lastwindowtitle || fallback;
// },
// "changed",
// );
// };

View File

@@ -1,6 +0,0 @@
{pkgs ? import <nixpkgs> {}}:
pkgs.mkShell {
packages = with pkgs; [
biome
];
}

View File

@@ -1 +1 @@
/nix/store/bvbfvg7s1n35wv0afs7krkvppj6dx538-ags-1.8.2/share/com.github.Aylur.ags/types
/nix/store/g5s50dy9za9inrw5zps05s7kh4ypnbpa-ags-1.8.2/share/com.github.Aylur.ags/types

View File

@@ -1,6 +1,9 @@
{pkgs, ...}: {
imports = [
./fonts.nix
];
networking.networkmanager.enable = true;
hardware.pulseaudio.enable = false;
hardware.bluetooth = {
enable = true;
settings = {
@@ -18,48 +21,35 @@
pulse.enable = true;
};
# See https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2669
services.pipewire.wireplumber.extraConfig = {
"10-disable-camera" = {
"wireplumber.profiles" = {
main = {
"monitor.libcamera" = "disabled";
};
};
};
};
powerManagement = {
powerDownCommands = ''
for device_wu in /sys/bus/usb/devices/*/power/wakeup; do
echo enabled > $device_wu
done
${pkgs.util-linux}/bin/rfkill block bluetooth
# allow keyboard to wakeup from suspend
services.udev.extraRules = ''
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="615e", ATTR{power/wakeup}="enabled"
'';
powerUpCommands = ''
${pkgs.util-linux}/bin/rfkill unblock bluetooth
'';
};
services.printing.enable = true;
services.power-profiles-daemon.enable = true;
security.polkit.enable = true;
security.rtkit.enable = true;
services.upower.enable = true;
services.gvfs.enable = true;
services.udisks2.enable = true;
services.libinput.enable = true;
services.colord.enable = true;
services.system-config-printer.enable = true;
services.gnome.glib-networking.enable = true;
services.gnome.gnome-settings-daemon.enable = true;
services.avahi.enable = true;
environment.systemPackages = with pkgs; [
gnome-bluetooth
polkit_gnome
];
security.pam.services.hyprlock = {};
# Allow gsettings to work
environment.sessionVariables.XDG_DATA_DIRS = [
"${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}"
"${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}"
];
services.sunshine = {
enable = true;
capSysAdmin = true;
};
}

59
modules/wm/fcitx5.nix Normal file
View File

@@ -0,0 +1,59 @@
{pkgs, ...}: {
i18n.inputMethod = {
enable = true;
type = "fcitx5";
fcitx5 = {
addons = with pkgs; [
fcitx5-mozc
fcitx5-gtk
];
waylandFrontend = true;
};
};
systemd.user.services.fcitx5-daemon = {
Unit = {
After = ["graphical-session.target"];
};
};
xdg.configFile."fcitx5/config" = {
force = true;
text = ''
[Hotkey/TriggerKeys]
0=Super+a
[Behavior]
ShowInputMethodInformation=False
CompactInputMethodInformation=False
ShowFirstInputMethodInformation=False
'';
};
xdg.configFile."fcitx5/profile" = {
force = true;
text = ''
[Groups/0]
Name=Default
Default Layout=us
DefaultIM=mozc
[Groups/0/Items/0]
Name=keyboard-us
Layout=
[Groups/0/Items/1]
Name=mozc
Layout=
[GroupOrder]
0=Default
'';
};
xdg.dataFile."fcitx5/themes/catppuccin-latte-pink".source = "${pkgs.catppuccin-fcitx5}/share/fcitx5/themes/catppuccin-latte-pink";
xdg.configFile."fcitx5/conf/classicui.conf" = {
force = true;
text = ''
Theme=catppuccin-latte-pink
'';
};
}

View File

@@ -1,6 +1,6 @@
{
pkgs,
config,
# config,
...
}: {
console = {
@@ -47,21 +47,21 @@
};
# Create an FHS mount to support flatpak host icons/fonts
system.fsPackages = [pkgs.bindfs];
fileSystems = let
mkRoSymBind = path: {
device = path;
fsType = "fuse.bindfs";
options = ["ro" "resolve-symlinks" "x-gvfs-hide"];
};
aggregatedFonts = pkgs.buildEnv {
name = "system-fonts";
paths = config.fonts.packages;
pathsToLink = ["/share/fonts"];
};
in {
# icons don't work, don't know why, don't care
# "/usr/share/icons" = mkRoSymBind (config.system.path + "/share/icons");
"/usr/share/fonts" = mkRoSymBind (aggregatedFonts + "/share/fonts");
};
# system.fsPackages = [pkgs.bindfs];
# fileSystems = let
# mkRoSymBind = path: {
# device = path;
# fsType = "fuse.bindfs";
# options = ["ro" "resolve-symlinks" "x-gvfs-hide"];
# };
# aggregatedFonts = pkgs.buildEnv {
# name = "system-fonts";
# paths = config.fonts.packages;
# pathsToLink = ["/share/fonts"];
# };
# in {
# # icons don't work, don't know why, don't care
# # "/usr/share/icons" = mkRoSymBind (config.system.path + "/share/icons");
# "/usr/share/fonts" = mkRoSymBind (aggregatedFonts + "/share/fonts");
# };
}

View File

@@ -1,6 +1,6 @@
{
pkgs,
user,
lib,
...
}: let
wallpaper = pkgs.writeShellScriptBin "wallpaper" ''
@@ -12,17 +12,47 @@
${pkgs.wbg}/bin/wbg "$WP" > /dev/null 2> /dev/null & disown
echo "$WP"
'';
screenshot = pkgs.writeShellApplication {
name = "screenshot";
runtimeInputs = [pkgs.slurp pkgs.grim];
text = ''
grim -g "$(slurp -b 00000000 -s 61616140)" - | wl-copy
'';
};
screenshot-freeze = pkgs.writeShellApplication {
name = "screenshot-freeze";
runtimeInputs = [pkgs.slurp pkgs.grim pkgs.wayfreeze];
text = ''
# shellcheck disable=SC2016
wayfreeze --after-freeze-cmd ''\'grim -g "$(slurp -b 00000000 -s 61616140)" - | wl-copy; killall wayfreeze''\'
'';
};
record = pkgs.writeShellApplication {
name = "record";
runtimeInputs = [pkgs.slurp pkgs.wf-recorder];
text = ''
pkill wf-recorder && exit
wf-recorder -g "$(slurp -b 00000000 -s 61616140)" -f "$HOME/rec-$(date +%Y-%m-%d_%H:%M:%S).mp4"
'';
};
in {
imports = [
./rofi
./ags
./fcitx5.nix
./hyprlock.nix
];
home.packages = [
wallpaper
screenshot
screenshot-freeze
record
];
services.darkman = let
genTheme = theme: {
"0-transition" = "${lib.getExe pkgs.niri} msg action do-screen-transition";
color-scheme = "${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface color-scheme prefer-${theme}";
gtk3 = let
suffix =
@@ -30,10 +60,13 @@ in {
then ""
else "-dark";
in "${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface gtk-theme adw-gtk3${suffix}";
kit = ''
${pkgs.coreutils}/bin/ln -sf $XDG_CONFIG_HOME/kitty/${theme}.conf $XDG_CONFIG_HOME/kitty/theme.conf
${pkgs.procps}/bin/pkill -USR1 kitty
'';
kubecolor = "echo 'preset: ${theme}' > ~/.kube/color.yaml";
usql = let
suffix =
if theme == "light"
then "latte"
else "mocha";
in "echo 'init: \set SYNTAX_HL_STYLE catppuccin-${suffix}' > ~/.config/usql/config.yaml";
};
in {
enable = true;
@@ -44,143 +77,16 @@ in {
darkModeScripts = genTheme "dark";
};
programs.hyprlock = {
enable = true;
settings = {
general = {
grace = 3;
ignore_empty_input = true;
immediate_render = true;
};
background = {
monitor = "";
path = "/home/${user}/.cache/current-wallpaper";
};
input-field = {
monitor = "";
size = "250, 50";
outline_thickness = 0;
dots_size = 0.26;
dots_spacing = 0.64;
dots_center = true;
fade_on_empty = true;
placeholder_text = "<i>Password...</i>";
hide_input = false;
check_color = "rgb(40, 200, 250)";
position = "0, 50";
halign = "center";
valign = "bottom";
};
label = [
{
monitor = "";
text = ''cmd[update:1000] echo "<b><big> $(${pkgs.coreutils}/bin/date +"%H:%M") </big></b>"'';
services.cliphist.enable = true;
font_size = 64;
font_family = "monospace";
position = "0, -70";
halign = "center";
valign = "center";
}
{
monitor = "";
text = ''cmd[update:18000000] echo "<b> "$(${pkgs.coreutils}/bin/date +'%A, %-d %B %Y')" </b>"'';
font_size = 24;
font_family = "monospace";
position = "0, -120";
halign = "center";
valign = "center";
}
];
dconf.settings = {
"org/gnome/desktop/interface" = {
cursor-blink = false;
};
# Disable close/resize buttons on GTK windows that really want CSD.
# gsettings set org.gnome.desktop.wm.preferences button-layout ""
"org/gnome/desktop/wm/preferences" = {
button-layout = "";
};
services.hypridle = {
enable = true;
settings = {
general = {
lock_cmd = "${pkgs.procps}/bin/pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock";
before_sleep_cmd = "${pkgs.systemd}/bin/loginctl lock-session";
};
listener = [
{
timeout = 900; # 15min
on-timeout = "${pkgs.procps}/bin/pidof hyprlock && ${pkgs.systemd}/bin/systemctl suspend";
}
];
};
};
# Default target is graphical-session-pre.target which comes too early to work.
systemd.user.services.hypridle.Unit.After = ["graphical-session.target"];
systemd.user.services.polkit-gnome-authentication-agent-1 = {
Unit = {
Description = "polkit-gnome-authentication-agent-1";
Wants = ["graphical-session.target"];
After = ["graphical-session.target"];
};
Install = {
WantedBy = ["graphical-session.target"];
};
Service = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
i18n.inputMethod = {
enabled = "fcitx5";
fcitx5 = {
addons = with pkgs; [
fcitx5-mozc
fcitx5-gtk
];
};
};
systemd.user.services.fcitx5-daemon = {
Unit = {
After = ["graphical-session.target"];
};
};
xdg.configFile."fcitx5/config" = {
force = true;
text = ''
[Hotkey/TriggerKeys]
0=Super+space
[Behavior]
ShowInputMethodInformation=False
CompactInputMethodInformation=False
ShowFirstInputMethodInformation=False
'';
};
xdg.configFile."fcitx5/profile" = {
force = true;
text = ''
[Groups/0]
Name=Default
Default Layout=us
DefaultIM=mozc
[Groups/0/Items/0]
Name=keyboard-us
Layout=
[Groups/0/Items/1]
Name=mozc
Layout=
[GroupOrder]
0=Default
'';
};
}

77
modules/wm/hyprlock.nix Normal file
View File

@@ -0,0 +1,77 @@
{
pkgs,
user,
...
}: {
programs.hyprlock = {
enable = true;
settings = {
general = {
grace = 3;
ignore_empty_input = true;
immediate_render = true;
};
background = {
monitor = "";
path = "/home/${user}/.cache/current-wallpaper";
};
input-field = {
monitor = "";
size = "250, 50";
outline_thickness = 0;
dots_size = 0.26;
dots_spacing = 0.64;
dots_center = true;
fade_on_empty = true;
placeholder_text = "<i>Password...</i>";
hide_input = false;
check_color = "rgb(40, 200, 250)";
position = "0, 50";
halign = "center";
valign = "bottom";
};
label = [
{
monitor = "";
text = ''cmd[update:1000] echo "<b><big> $(${pkgs.coreutils}/bin/date +"%H:%M") </big></b>"'';
font_size = 64;
font_family = "monospace";
position = "0, -70";
halign = "center";
valign = "center";
}
{
monitor = "";
text = ''cmd[update:18000000] echo "<b> "$(${pkgs.coreutils}/bin/date +'%A, %-d %B %Y')" </b>"'';
font_size = 24;
font_family = "monospace";
position = "0, -120";
halign = "center";
valign = "center";
}
];
};
};
services.hypridle = {
enable = true;
settings = {
general = {
lock_cmd = "${pkgs.procps}/bin/pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock";
before_sleep_cmd = "${pkgs.systemd}/bin/loginctl lock-session";
};
listener = [
{
timeout = 900; # 15min
on-timeout = "${pkgs.procps}/bin/pidof hyprlock && ${pkgs.systemd}/bin/systemctl suspend";
}
];
};
};
}

View File

@@ -1,7 +1,4 @@
{
pkgs,
...
}: {
{pkgs, ...}: {
xdg.configFile."rofi/base16.rasi".text = with {
base00 = "1e1e2e"; # base
base01 = "181825"; # mantle
@@ -41,7 +38,7 @@
/* vim:ft=css
'';
home.packages = with pkgs; [rofi-wayland];
home.packages = with pkgs; [rofi];
xdg.configFile."rofi" = {
source = ./.;
recursive = true;

View File

@@ -0,0 +1,23 @@
return {
settings = {
basedpyright = {
analysis = {
diagnosticMode = "workspace",
diagnosticSeverityOverrides = {
reportUnannotatedClassAttribute = "false",
enableTypeIgnoreComments = "true",
reportIgnoreCommentWithoutRule = "false",
reportUnknownArgumentType = "false",
reportUnknownVariableType = "false",
reportMissingParameterType = "false",
reportUnknownParameterType = "false",
reportUnknownMemberType = "false",
reportAny = "false",
reportExplicitAny = "false",
reportMissingTypeStubs = "false",
reportUnknownLambdaType = "false",
}
},
}
}
}

View File

@@ -0,0 +1,3 @@
return {
filetypes = { "sh", "zsh", "make" },
}

23
nvim/after/lsp/biome.lua Normal file
View File

@@ -0,0 +1,23 @@
vim.api.nvim_create_autocmd('LspAttach', {
callback = function(args)
local client_id = args.data.client_id
local client = assert(vim.lsp.get_client_by_id(client_id))
if client.name == 'biome' then
vim.lsp.on_type_formatting.enable(false, { client_id = client_id })
end
end,
})
return {
-- Disable lunching from node_modules (no nix binary)
cmd = { "biome", "lsp-proxy" },
-- Inline package.json (remove check for biome installed)
root_dir = function(_, on_dir)
-- To support monorepos, biome recommends starting the search for the root from cwd
-- https://biomejs.dev/guides/big-projects/#use-multiple-configuration-files
local cwd = vim.fn.getcwd()
local root_files = { 'biome.json', 'biome.jsonc', 'package.json', 'package.json5' }
local root_dir = vim.fs.dirname(vim.fs.find(root_files, { path = cwd, upward = true })[1])
on_dir(root_dir)
end,
}

View File

@@ -0,0 +1,9 @@
return {
settings = {
json = {
schemas = require('schemastore').json.schemas(),
format = { enable = true },
validate = { enable = true },
},
},
}

19
nvim/after/lsp/sqls.lua Normal file
View File

@@ -0,0 +1,19 @@
return {
settings = {
sqls = {
lowercaseKeywords = true,
connections = {
{
driver = "postgresql",
dataSourceName = os.getenv("DATABASEURL"),
proto = "tcp",
user = os.getenv("PGUSER"),
passwd = os.getenv("PGPASSWORD"),
host = os.getenv("PGHOST"),
port = 5432,
dbName = os.getenv("PGDATABASE"),
},
},
},
},
}

11
nvim/after/lsp/ts_ls.lua Normal file
View File

@@ -0,0 +1,11 @@
-- use biome for formatting
return {
---@param client vim.lsp.Client
on_init = function(client, _)
if client.server_capabilities then
client.server_capabilities["documentFormattingProvider"] = false
client.server_capabilities["documentRangeFormattingProvider"] = false
client.server_capabilities["documentOnTypeFormattingProvider"] = false
end
end,
}

View File

@@ -0,0 +1,10 @@
;extends
(call
function: (attribute attribute: (identifier) @id (#match? @id "execute|read_sql"))
arguments: (argument_list
(string (string_content) @injection.content (#set! injection.language "sql"))))
(string
(string_content) @injection.content
(#match? @injection.content "^\n*\\s*(SELECT|CREATE|DROP|INSERT|UPDATE|ALTER|DELETE|select|create|drop|insert|update|alter|delete)\\W+")
(#set! injection.language "sql"))

View File

@@ -1,10 +1,6 @@
require("catppuccin").setup({
compile_path = vim.env.out .. "/lua/colors",
integrations = {
telescope = {
enabled = true,
style = "nvchad"
},
blink_cmp = true,
harpoon = true,
nvim_surround = true,
@@ -12,5 +8,22 @@ require("catppuccin").setup({
navic = true,
leap = true,
noice = true,
snacks = {
enabled = true,
},
},
custom_highlights = function(C)
return {
SnacksPickerMatch = { fg = C.mauve, style = { 'italic' } },
SnacksPickerInput = { fg = C.text, bg = C.crust },
SnacksPickerInputTitle = { fg = C.crust, bg = C.mauve },
SnacksPickerInputBorder = { fg = C.text, bg = C.crust },
SnacksPickerList = { bg = C.base },
SnacksPickerListCursorLine = { bg = C.crust },
SnacksPickerListBorder = { fg = C.base, bg = C.base },
SnacksPickerPreview = { bg = C.mantle },
SnacksPickerPreviewBorder = { fg = C.mantle, bg = C.mantle },
SnacksPickerPreviewTitle = { fg = C.mantle, bg = C.red },
}
end
})

View File

@@ -1,21 +1,19 @@
{
pkgs,
lib,
neovim-nightly,
lz-nvim,
vim-lumen,
...
}: let
mkNvim = pkgs.callPackage ./nix/mknvim.nix {inherit pkgs;};
mkPlugin = src: pname:
pkgs.vimUtils.buildVimPlugin {
inherit pname src;
version = src.lastModifiedDate;
};
mkNvim = import ./nix/mknvim.nix {inherit pkgs lib;};
# mkPlugin = src: pname:
# (pkgs.vimUtils.buildVimPlugin
# {
# inherit pname src;
# version = src.lastModifiedDate;
# })
# .overrideAttrs {doCheck = false;};
in
mkNvim {
name = "nvim";
withNodeJs = false;
withRuby = false;
withPython3 = false;
@@ -56,28 +54,28 @@ in
in
with pkgs.vimPlugins; {
start = [
(mkPlugin lz-nvim "lz-n")
lz-n
catppuccin-nvim
(mkPlugin vim-lumen "vim-lumen")
nvim-treesitter.withAllGrammars
ts-comments-nvim
nvim-lspconfig
blink-cmp
(blink-cmp.overrideAttrs {
# clashes with oil
postPatch = "rm -rf doc/";
})
SchemaStore-nvim
nvim-lint
roslyn-nvim
(conform-nvim.overrideAttrs {
# clashes with oil
postPatch = "rm doc/recipes.md";
})
oil-nvim
telescope-fzf-native-nvim
harpoon2
gitsigns-nvim
vim-fugitive
vim-rhubarb
git-conflict-nvim
nvim-surround
@@ -88,24 +86,32 @@ in
leap-nvim
flit-nvim
(snacks-nvim.overrideAttrs {
postPatch = "rm -rf queries";
})
quicker-nvim
sniprun
vim-helm
vim-sleuth
auto-save-nvim
undotree
noice-nvim
statuscol-nvim
mini-icons
which-key-nvim
nvim-colorizer-lua
nvim-pqf
lualine-nvim
nvim-navic
virt-column-nvim
indent-blankline-nvim
codecompanion-nvim
# enable this just to signin (used by the chat plugin above)
# (copilot-vim.overrideAttrs {
# postPatch = "rm doc/copilot.txt";
# })
];
opt = [
telescope-nvim
vim-illuminate
nvim-treesitter-textobjects
];
@@ -121,21 +127,37 @@ in
haskell-language-server
rust-analyzer
clang-tools
omnisharp-roslyn
pyright
roslyn-ls
basedpyright
typescript-language-server
nil
gopls
vscode-langservers-extracted # html, jsonls
yaml-language-server
marksman
ltex-ls
texlab
helm-ls
zls
lua-language-server
bash-language-server
sqls
biome
# Give access to gdbus for color-scheme detection (vim-lumen).
glib
# gopls also needs go /shame
gopls
go
# yaml-ls needs node /shame
yaml-language-server
nodejs
# haskell-language-server needs ghc /shame
ghc
# formatter
alejandra
pgformatter
csharpier
ruff
# repl
usql
mono
];
}

View File

@@ -18,7 +18,7 @@ return {
return false
end
local ft = vim.fn.getbufvar(buf, "&filetype")
return ft ~= "oil" and ft ~= "harpoon"
return ft ~= "oil" and ft ~= "harpoon" and ft ~= "qf"
end,
},
beforeAll = function()

View File

@@ -5,10 +5,13 @@ return {
opts = {
keymap = {
preset = "default",
['<C-space>'] = { 'show', },
['<C-h>'] = { 'select_and_accept' },
['<Tab>'] = {},
['<S-Tab>'] = {},
["<C-space>"] = { "show", },
["<C-e>"] = { "cancel" },
["<C-h>"] = { "select_and_accept" },
["<Up>"] = { "select_prev", "fallback" },
["<Down>"] = { "select_next", "fallback" },
["<Tab>"] = {},
["S-Tab"] = {},
},
completion = {
trigger = {
@@ -22,16 +25,37 @@ return {
auto_show = true,
auto_show_delay_ms = 0,
},
menu = {
max_height = 15,
auto_show = false,
},
accept = {
auto_brackets = {
enabled = false,
},
},
},
fuzzy = {
prebuilt_binaries = {
download = false,
},
},
sources = {
default = function()
local success, node = pcall(vim.treesitter.get_node)
if success and node and string.find(node:type(), "comment") then
return { "lsp", "path", "buffer" }
end
return { "lsp" }
end,
per_filetype = {
codecompanion = { "codecompanion" },
}
},
},
after = function(plug)
require("blink-cmp").setup(plug.opts)
vim.lsp.config("*", { capabilities = require("blink.cmp").get_lsp_capabilities() })
end,
},
}

View File

@@ -1,7 +1,6 @@
return {
{
"conform.nvim",
cmd = "ConformInfo",
keys = {
{
"<leader>e",
@@ -13,35 +12,22 @@ return {
},
},
opts = {
default_format_opts = { async = true, lsp_format = "fallback" },
default_format_opts = { async = true },
formatters_by_ft = {
python = function(bufnr)
if require("conform").get_formatter_info("ruff_format", bufnr).available then
return { "ruff_format" }
else
return { "isort", "black" }
end
end,
javascript = { "biome", "prettierd", "prettier", stop_after_first = true },
typescript = { "biome", "prettierd", "prettier", stop_after_first = true },
javascriptreact = { "biome", "prettierd", "prettier", stop_after_first = true },
typescriptreact = { "biome", "prettierd", "prettier", stop_after_first = true },
json = { "biome", "prettierd", "prettier", stop_after_first = true },
css = { "biome", "prettierd", "prettier", stop_after_first = true },
html = { "biome", "prettierd", "prettier", stop_after_first = true },
python = { "ruff_format", "ruff_organize_imports" },
sql = { "pg_format" },
cs = { "csharpier" },
nix = { "alejandra" },
-- ["_"] = { "injected", lsp_format = "last" },
["*"] = { "injected" }
["*"] = { "injected" },
["_"] = { "injected", lsp_format = "last" },
},
formatters = {
biome = {
-- disable node module search since native binaries can't be run from nix
command = "biome",
},
csharpier = function()
return {
command = "csharpier",
args = { "format" },
stdin = true,
--- @diagnostic disable: param-type-mismatch
cwd = require("conform.util").root_file(function(name)
return name:match('.*%.sln$') or name:match('.*%.csproj$')
end),

View File

@@ -0,0 +1,49 @@
return {
{
"codecompanion",
keys = {
{
"<leader>l",
"<cmd>CodeCompanionChat Toggle<cr>",
desc = "Copilot",
mode = { "n", "v" },
}
},
opts = {
display = {
diff = {
enabled = false,
},
chat = {
window = {
opts = {
conceallevel = 3,
},
},
},
},
strategies = {
chat = {
adapter = "copilot",
model = "claude-3-7-sonnet",
start_in_insert_mode = true,
keymaps = {
send = {
modes = { n = "<C-s>", i = "<C-s>" },
},
close = {
modes = { n = "q", i = "<C-d>" },
},
},
},
inline = {
adapter = "copilot",
model = "claude-3-7-sonnet",
},
},
},
after = function(plug)
require("codecompanion").setup(plug.opts)
end,
},
}

View File

@@ -1,3 +1,27 @@
-- fugitive keybinds
vim.keymap.set("n", "<leader>gA", "<cmd>Git add -A<CR>", { desc = "Git add all" })
vim.keymap.set("n", "<leader>gc", "<cmd>Git commit<CR>", { desc = "Git commit" })
vim.keymap.set("n", "<leader>gC", "<cmd>Git commit --amend<CR>", { desc = "Git commit amend" })
vim.keymap.set("n", "<leader>gp", "<cmd>Git! push<CR>", { desc = "Git push" })
vim.keymap.set("n", "<leader>gP", "<cmd>Git! push --force-with-lease --force-if-includes<CR>",
{ desc = "Git push force" })
vim.keymap.set("n", "<leader>gb", "<cmd>Git blame<cr>", { desc = "Git fugitive status" })
vim.keymap.set("n", "<leader>gg", vim.cmd.Git, { desc = "Git fugitive status" })
vim.api.nvim_create_autocmd("FileType", {
desc = "Fix fold method",
group = vim.api.nvim_create_augroup("git-fold-method", { clear = true }),
callback = function(evt)
-- this seems to trigger a bit late & we need to :e to make it work. idk why
if evt.match == "git" then
vim.wo.foldmethod = "syntax"
else
vim.wo.foldmethod = "expr"
end
end,
})
return {
{
"gitsigns.nvim",
@@ -21,16 +45,18 @@ return {
vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc })
end
map('n', ']h', function() gs.nav_hunk('next') end, "Next Hunk")
map('n', '[h', function() gs.nav_hunk('prev') end, "Prev Hunk")
map({ "n", "v" }, "<leader>ga", ":Gitsigns stage_hunk<CR>", "Add Hunk")
map({ "n", "v" }, "<leader>gr", ":Gitsigns reset_hunk<CR>", "Reset Hunk")
map("n", "<leader>gu", gs.undo_stage_hunk, "Unstage Hunk")
map("n", "<leader>gA", gs.stage_buffer, "Add buffer")
map('n', ']h', function() gs.nav_hunk("next", { target = "all" }) end, "Next Hunk")
map('n', '[h', function() gs.nav_hunk("prev", { target = "all" }) end, "Prev Hunk")
map({ "n", "v" }, "<leader>ha", gs.stage_hunk, "Add Hunk")
map({ "n", "v" }, "<leader>hr", gs.reset_hunk, "Reset Hunk")
map("n", "<leader>hp", gs.preview_hunk, "Preview Hunk")
map("n", "<leader>ga", gs.stage_buffer, "Add buffer")
map("n", "<leader>gR", gs.reset_buffer, "Reset Buffer")
map("n", "<leader>gp", gs.preview_hunk, "Preview Hunk")
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", "Git Select Hunk")
map({ "o", "x" }, "ah", ":<C-U>Gitsigns select_hunk<CR>", "Git Select Hunk")
map({ "o", "x" }, "ih", gs.select_hunk, "Git Select Hunk")
map({ "o", "x" }, "ah", gs.select_hunk, "Git Select Hunk")
end,
},
after = function(plug)
@@ -40,17 +66,18 @@ return {
{
"git-conflict.nvim",
lazy = false,
keys = {
{ "<leader>gxo", "<Plug>(git-conflict-ours)", desc = "Accept ours" },
{ "<leader>gxt", "<Plug>(git-conflict-theirs)", desc = "Accept theirs" },
{ "<leader>gxb", "<Plug>(git-conflict-both)", desc = "Accept both" },
{ "<leader>gx0", "<Plug>(git-conflict-none)", desc = "Accept none" },
{ "[x", "<Plug>(git-conflict-prev-conflict)", desc = "Previous conflict" },
{ "]x", "<Plug>(git-conflict-next-conflict)", desc = "Next conflict" },
},
-- load on enter to detect + highlight conflicts
-- lazy loading make it not work, idk why
-- event = { "BufReadPost", "BufWritePost", "BufNewFile" },
opts = {
default_mappings = false,
default_mappings = {
ours = 'c<',
theirs = 'c>',
none = 'cd',
both = 'c=',
next = ']x',
prev = '[x',
},
},
after = function(plug)
require("git-conflict").setup(plug.opts)

View File

@@ -3,7 +3,7 @@ return {
"harpoon2",
keys = {
{ "<leader>a", '<cmd>lua require("harpoon"):list():add()<CR>', desc = "Mark file" },
{ "<leader>h", '<cmd>lua require("harpoon").ui:toggle_quick_menu(require("harpoon"):list())<CR>', desc = "Harpoon menu" },
{ "<leader>m", '<cmd>lua require("harpoon").ui:toggle_quick_menu(require("harpoon"):list())<CR>', desc = "Harpoon menu" },
{ "<A-h>", '<cmd>lua require("harpoon"):list():select(1)<CR>', desc = "Navigate to harpoon 1" },
{ "<A-t>", '<cmd>lua require("harpoon"):list():select(2)<CR>', desc = "Navigate to harpoon 2" },
{ "<A-n>", '<cmd>lua require("harpoon"):list():select(3)<CR>', desc = "Navigate to harpoon 3" },
@@ -17,10 +17,11 @@ return {
opts = {
settings = {
save_on_toggle = true,
sync_on_ui_close = true,
},
},
after = function(plug)
require("harpoon"):setup(plug.otps)
require("harpoon"):setup(plug.opts)
end,
},
}

View File

@@ -1,19 +1,7 @@
return {
{
"nvim-navic",
opts = {
highlight = true,
lsp = {
auto_attach = true,
},
},
after = function(plug)
require("nvim-navic").setup(plug.opts)
end,
},
{
"lualine.nvim",
event = "DeferredUIEnter",
opts = {
options = {
theme = "auto",
@@ -75,7 +63,7 @@ return {
separator = '>',
path = 0,
symbols = {
modified = '[+]',
modified = '',
readonly = '[-]',
unnamed = '[No Name]',
},
@@ -103,8 +91,6 @@ return {
tabline = {},
extensions = {
"quickfix",
"lazy",
"trouble",
"oil",
},
},
@@ -113,4 +99,18 @@ return {
require("lualine").setup(plug.opts)
end,
},
{
"nvim-navic",
event = "DeferredUIEnter",
opts = {
highlight = true,
lsp = {
auto_attach = true,
},
},
after = function(plug)
require("nvim-navic").setup(plug.opts)
end,
},
}

View File

@@ -1,35 +0,0 @@
return {
{
"nvim-lint",
event = { "BufReadPost", "BufWritePost", "BufNewFile" },
opts = {
javascript = { "biomejs", "eslint_d" },
typescript = { "biomejs", "eslint_d" },
javascriptreact = { "biomejs", "eslint_d" },
typescriptreact = { "biomejs", "eslint_d" },
},
after = function(plug)
local override_severity = function(linter)
local old_parser = linter.parser;
linter.parser = function(output)
local diags = old_parser(output);
for _, d in pairs(diags) do
d.severity = vim.diagnostic.severity.HINT
end
return diags
end
end
override_severity(require("lint").linters.eslint_d)
override_severity(require("lint").linters.biomejs)
require("lint").linters_by_ft = plug.opts
vim.api.nvim_create_autocmd({ "BufWritePost", "BufEnter" }, {
desc = "Lint buf",
group = vim.api.nvim_create_augroup("nvim-lint", { clear = true }),
callback = function()
require("lint").try_lint(nil, { ignore_errors = true })
end,
})
end,
}
}

View File

@@ -1,67 +1,55 @@
return {
{
"lsp",
event = { "BufReadPost", "BufWritePost", "BufNewFile" },
load = function() end,
after = function()
-- see https://github.com/neovim/nvim-lspconfig/issues/3494
require("lspconfig").lua_ls.setup({})
require("lspconfig").hls.setup({})
require("lspconfig").rust_analyzer.setup({})
require("lspconfig").clangd.setup({})
require("lspconfig").omnisharp.setup({})
require("lspconfig").pyright.setup({})
require("lspconfig").nil_ls.setup({})
require("lspconfig").ts_ls.setup({})
require("lspconfig").yamlls.setup({})
require("lspconfig").marksman.setup({})
require("lspconfig").ltex.setup({})
require("lspconfig").texlab.setup({})
require("lspconfig").html.setup({})
require("lspconfig").helm_ls.setup({})
require("lspconfig").zls.setup({})
vim.lsp.enable({
"lua_ls",
"hls",
"rust_analyzer",
"clangd",
"basedpyright",
"nil_ls",
"ts_ls",
"yamlls",
"marksman",
"texlab",
"html",
"cssls",
"helm_ls",
"zls",
"gopls",
"bashls",
"jsonls",
"biome",
"sqls",
-- "roslyn_ls", we use roslyn.nvim plugin instead.
})
require("lspconfig").jsonls.setup({
on_new_config = function(new_config)
new_config.settings.json.schemas = new_config.settings.json.schemas or {}
vim.list_extend(new_config.settings.json.schemas, require("schemastore").json.schemas())
vim.lsp.on_type_formatting.enable()
vim.api.nvim_create_autocmd("LspAttach", {
desc = "Custom lsp attach",
group = vim.api.nvim_create_augroup("lsp-setup", { clear = true }),
callback = function(args)
vim.lsp.document_color.enable(true, args.buf, { style = "virtual" })
end,
settings = {
json = {
format = {
enable = true,
},
validate = { enable = true },
},
},
})
})
require("lspconfig").gopls.setup({
settings = {
-- https://go.googlesource.com/vscode-go/+/HEAD/docs/settings.md#settings-for
gopls = {
analyses = {
nilness = true,
unusedparams = true,
unusedwrite = true,
useany = true
return {
-- see https://github.com/seblyng/roslyn.nvim/pull/178
{
"roslyn.nvim",
ft = { "cs", "vb" },
opts = {
broad_search = true,
},
after = function(plug)
vim.lsp.config("roslyn", {
cmd = {
'Microsoft.CodeAnalysis.LanguageServer',
'--logLevel',
'Information',
'--extensionLogDirectory',
vim.fs.joinpath(vim.uv.os_tmpdir(), 'roslyn_ls/logs'),
'--stdio',
},
experimentalPostfixCompletions = true,
gofumpt = true,
staticcheck = true,
usePlaceholders = true,
hints = {
assignVariableTypes = true,
compositeLiteralFields = true,
compositeLiteralTypes = true,
constantValues = true,
functionTypeParameters = true,
parameterNames = true,
rangeVariableTypes = true
}
}
}
})
require("roslyn").setup(plug.opts)
end,
},
}

View File

@@ -1,6 +1,7 @@
return {
{
"mini.icons",
enabled = vim.g.have_nerd_font,
after = function()
require("mini.icons").setup();
MiniIcons.mock_nvim_web_devicons()
@@ -38,5 +39,8 @@ return {
join = 'gJ',
},
},
after = function(plug)
require("mini.splitjoin").setup(plug.opts)
end
},
}

View File

@@ -1,6 +1,7 @@
return {
{
"nvim-surround",
event = "DeferredUIEnter",
after = function()
require("nvim-surround").setup({})
end,
@@ -17,18 +18,12 @@ return {
{ "agw", "<plug>WordMotion_aw", desc = "a small word (with white-space)", mode = { "x", "o" } },
},
before = function()
-- This never gets applied (ordering issue with wordmotion's autoload)
-- This is also set in `settings.lua` but kept here for documentation purposes
vim.g.wordmotion_nomap = true
end,
},
{
"increment-activator",
keys = {
{ "<C-A>", desc = "Increment" },
{ "<C-X>", desc = "Decrement" },
},
},
{
"leap.nvim",
keys = {

View File

@@ -1,10 +1,13 @@
return {
{
"noice.nvim",
event = "DeferredUIEnter",
keys = {
{ "<leader>zl", "<cmd>Noice<cr>", desc = "List messages" },
},
opts = {
presets = {
command_palette = true,
inc_rename = true,
},
lsp = {
signature = {
@@ -27,11 +30,12 @@ return {
kind = "progress",
cond = function(message)
local client = vim.tbl_get(message.opts, "progress", "client")
return client == "ltex"
return client == "ltex" or client == "lua_ls"
end,
},
opts = { skip = true },
},
},
},
after = function(plug)

View File

@@ -13,10 +13,13 @@ return {
},
keymaps = {
["<BS>"] = "actions.parent",
["~"] = false,
["%"] = "actions.yank_entry",
},
},
after = function(plug)
require("oil").setup(plug.opts)
vim.cmd.cabbr({ args = { "<expr>", "%", "&filetype == 'oil' ? bufname('%')[6:] : '%'" } })
end
}
}

View File

@@ -0,0 +1,17 @@
local function scratch()
local fts = vim.fn.getcompletion("", "filetype")
vim.ui.select(fts, {
prompt = "Scratch ft",
}, function(ft)
if ft == nil then
return
end
local buf = vim.api.nvim_create_buf(false, true)
vim.api.nvim_set_option_value("filetype", ft, { buf = buf })
vim.api.nvim_set_current_buf(buf)
end)
end
vim.keymap.set("n", "<leader>s", scratch, { desc = "Scratch" })
return {}

Some files were not shown because too many files have changed in this diff Show More