tangled
alpha
login
or
join now
bwc9876.dev
/
nixos-config
1
fork
atom
Flake for my NixOS devices
1
fork
atom
overview
issues
pulls
pipelines
More Nvim!! Also switch to kitty
bwc9876.dev
1 year ago
b85119e9
f916bd28
verified
This commit was signed with the committer's
known signature
.
bwc9876.dev
SSH Key Fingerprint:
SHA256:DanMEP/RNlSC7pAVbnXO6wzQV00rqyKj053tz4uH5gQ=
+82
-104
12 changed files
expand all
collapse all
unified
split
res
news-open.nu
rofi
rofi-code.nu
rofi-zoxide.nu
theming
kdeglobals
roles
dev
nvim.nix
graphics
apps.nix
foot.nix
hypr.nix
kitty.nix
theming.nix
waybar.nix
xdg.nix
+2
-2
res/news-open.nu
···
15
15
if ($type == "image/svg+xml") {
16
16
xdg-open $url
17
17
} else if ($type | str starts-with "image/") {
18
18
-
http get $url | img2sixel
18
18
+
http get $url | kitten icat
19
19
input "Press enter to close the image viewer"
20
20
} else if ($type | str starts-with "video/") or ($url =~ $YT_REGEX) {
21
21
qmplay2 --open $url
22
22
} else if ($type | str starts-with "text/html") {
23
23
-
let w3m_opts = $"-sixel -no-cookie -o confirm_qq=FALSE -o display_link_number=TRUE -o extbrowser=($env.CURRENT_FILE)";
23
23
+
let w3m_opts = $"-no-cookie -o confirm_qq=FALSE -o display_link_number=TRUE -o extbrowser=($env.CURRENT_FILE)";
24
24
let w3m_cmd = $"w3m ($w3m_opts)";
25
25
let s = (term size).columns;
26
26
stty cols 90;
-20
res/rofi/rofi-code.nu
···
1
1
-
#!/usr/bin/env nu
2
2
-
3
3
-
let paths = ls ~/.config/Code/User/workspaceStorage/*/workspace.json
4
4
-
| get name
5
5
-
| each {|it| open $it | get folder | str substring 7..};
6
6
-
7
7
-
let paths_display = $paths | each {|it| $it | str replace $"/home/($env.USER)" " " | str replace " /Documents/GitHub" " "};
8
8
-
9
9
-
let res = $paths_display | str join "\n" | rofi -dmenu -i -p "VSCode" | complete;
10
10
-
11
11
-
if $res.exit_code == 1 {
12
12
-
echo "Cancelled"
13
13
-
} else {
14
14
-
let choice = $res.stdout | str trim;
15
15
-
let idx = $paths_display | enumerate | where {|it| $it.item == $choice} | first | get index;
16
16
-
let path = $paths | get $idx;
17
17
-
echo $"Opening ($path)"
18
18
-
code $path
19
19
-
}
20
20
-
+1
-1
res/rofi/rofi-zoxide.nu
···
10
10
echo "Cancelled"
11
11
} else {
12
12
let dir = $res.stdout | split row " <span color=\"#A2A2A2\"><i><small>(" | get 1 | split row ")</small>" | get 0
13
13
-
foot -D ($dir | str replace "~" $"/home/($env.USER)")
13
13
+
kitty -d ($dir | str replace "~" $"/home/($env.USER)")
14
14
}
+2
-2
res/theming/kdeglobals
···
2
2
ShowDeleteCommand=false
3
3
4
4
[General]
5
5
-
TerminalApplication=foot
5
5
+
TerminalApplication=kitty
6
6
7
7
[KFileDialog Settings]
8
8
Allow Expansion=false
···
25
25
View Style=DetailTree
26
26
27
27
[PreviewSettings]
28
28
-
MaximumRemoteSize=0
28
28
+
MaximumRemoteSize=0
+51
-12
roles/dev/nvim.nix
···
15
15
16
16
programs.nixvim = {
17
17
enable = true;
18
18
+
enableMan = false;
18
19
defaultEditor = true;
19
20
viAlias = true;
20
21
vimAlias = true;
···
36
37
cursorline = true;
37
38
showtabline = 2;
38
39
breakindent = true;
39
39
-
foldenable = true;
40
40
+
# fillchars.__raw = "[[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]";
41
41
+
# foldcolumn = "1";
40
42
};
41
43
42
44
autoCmd = [
···
75
77
76
78
keymaps = [
77
79
{
80
80
+
action = ''"+y'';
81
81
+
key = "<C-S-C>";
82
82
+
options.desc = "Copy to System Clipboard";
83
83
+
}
84
84
+
{
85
85
+
action = ''"+p'';
86
86
+
key = "<C-S-V>";
87
87
+
options.desc = "Paste from System Clipboard";
88
88
+
}
89
89
+
{
90
90
+
action = ''"+x'';
91
91
+
key = "<C-S-X>";
92
92
+
options.desc = "Cut to System Clipboard";
93
93
+
}
94
94
+
{
78
95
action = "<cmd>Lspsaga code_action code_action<cr>";
79
96
key = "<C-.>a";
80
97
options.desc = "Code Actions";
···
141
158
}
142
159
];
143
160
144
144
-
extraPlugins = with pkgs.vimPlugins; [{plugin = nvim-scrollview;} {plugin = tiny-devicons-auto-colors-nvim;}];
161
161
+
extraPlugins = with pkgs.vimPlugins; [{plugin = tiny-devicons-auto-colors-nvim;}];
145
162
146
163
plugins = {
147
164
telescope = {
···
248
265
++ (lib.intersperse pad [
249
266
(let
250
267
banner = pkgs.runCommand "nvim-banner" {} ''${pkgs.toilet}/bin/toilet " NIXVIM " -f mono12 -F border > $out'';
251
251
-
bannerText = builtins.readFile banner;
268
268
+
# bannerText = builtins.readFile banner;
252
269
in
253
270
cmd {
254
271
command = ''mut i = 1; loop { let s = (open ${banner}) | ${pkgs.lolcat}/bin/lolcat -f -S $i; clear; print -n -r $s; sleep 50ms; $i += 3; }'';
255
255
-
width = (builtins.stringLength (lib.trim (builtins.elemAt (lib.splitString "\n" bannerText) 1))) - 3;
256
256
-
height = (builtins.length (lib.splitString "\n" bannerText)) - 1;
272
272
+
# Hardcoding to prevent IFD
273
273
+
width = 83; #(builtins.stringLength (lib.trim (builtins.elemAt (lib.splitString "\n" bannerText) 1))) - 3;
274
274
+
height = 12; #(builtins.length (lib.splitString "\n" bannerText)) - 1;
257
275
})
258
276
(grp [
259
277
(btn {
···
296
314
enable = true;
297
315
settings = {
298
316
highlight.enable = true;
299
299
-
folding.enable = true;
300
317
};
301
318
};
302
319
303
320
illuminate.enable = true;
304
321
cursorline.enable = true;
322
322
+
323
323
+
scrollview.enable = true;
305
324
306
325
navbuddy = {
307
326
enable = true;
···
338
357
enable = true;
339
358
};
340
359
360
360
+
# nvim-ufo.enable = true;
341
361
gitsigns.enable = true;
342
362
343
363
dap = {
···
352
372
"trouble"
353
373
"toggleterm"
354
374
];
375
375
+
# sections.lualine_c = ["lsp_progress"];
355
376
};
356
377
};
357
378
···
360
381
enableTelescope = true;
361
382
};
362
383
384
384
+
# image.enable = true;
363
385
web-devicons.enable = true;
364
386
365
387
guess-indent.enable = true;
···
370
392
settings = {
371
393
show_help = true;
372
394
preset = "modern";
395
395
+
win.wo.winblend = 8;
396
396
+
};
397
397
+
};
398
398
+
399
399
+
fidget = {
400
400
+
enable = true;
401
401
+
notification = {
402
402
+
overrideVimNotify = true;
403
403
+
window.align = "top";
373
404
};
374
405
};
375
406
···
382
413
disableTsServerFormatter = true;
383
414
};
384
415
yamlfmt.enable = true;
416
416
+
markdownlint.enable = true;
417
417
+
};
418
418
+
sources.diagnostics = {
419
419
+
markdownlint.enable = true;
385
420
};
386
421
};
387
422
···
413
448
preview.enable = true;
414
449
415
450
lsp-format.enable = true;
416
416
-
lsp-status.enable = true;
417
451
lspkind.enable = true;
418
452
# jupytext.enable = true;
419
453
hex.enable = true;
···
438
472
codeAction.keys.quit = "<ESC>";
439
473
};
440
474
441
441
-
rustaceanvim.enable = true;
475
475
+
# rustaceanvim.enable = true;
442
476
vim-css-color.enable = true;
443
477
444
478
lsp = {
···
450
484
denols.enable = true;
451
485
ts_ls.enable = true;
452
486
html.enable = true;
487
487
+
marksman.enable = true;
453
488
cssls.enable = true;
454
489
tailwindcss.enable = true;
455
490
jsonls.enable = true;
456
491
yamlls.enable = true;
457
492
pylsp.enable = true;
458
458
-
nixd.enable = true;
493
493
+
nixd = lib.fix (self: {
494
494
+
enable = true;
495
495
+
settings.options.nixos.expr = ''(builtins.getFlake "${inputs.self}").nixosConfigurations.${config.networking.hostName}.options'';
496
496
+
settings.options.home-manager.expr = ''${self.settings.options.nixos.expr}.home-manager.users.type.getSubOptions []'';
497
497
+
});
459
498
csharp_ls.enable = true;
460
499
bashls.enable = true;
461
500
nushell.enable = true;
462
501
taplo.enable = true;
463
463
-
#rust_analyzer.enable = true;
464
464
-
#rust_analyzer.installCargo = false;
465
465
-
#rust_analyzer.installRustc = false;
502
502
+
rust_analyzer.enable = true;
503
503
+
rust_analyzer.installCargo = false;
504
504
+
rust_analyzer.installRustc = false;
466
505
lemminx.enable = true;
467
506
};
468
507
};
+2
-1
roles/graphics/apps.nix
···
4
4
[Desktop Entry]
5
5
Type=Application
6
6
Name=Htop
7
7
-
Exec=foot --title="Htop" --app-id="htop" htop
7
7
+
Exec=kitty --title="Htop" --app-id="htop" htop
8
8
Icon=htop
9
9
'';
10
10
···
24
24
25
25
environment.systemPackages = with pkgs; [
26
26
chromium
27
27
+
kitty
27
28
28
29
# Office
29
30
libreoffice-qt6
-52
roles/graphics/foot.nix
···
1
1
-
{pkgs, ...}: {
2
2
-
environment.systemPackages = with pkgs; [
3
3
-
libsixel
4
4
-
];
5
5
-
6
6
-
programs.foot = {
7
7
-
enable = true;
8
8
-
settings = {
9
9
-
main = {
10
10
-
title = "Terminal (Foot)";
11
11
-
term = "xterm-256color";
12
12
-
font = "monospace:size=18";
13
13
-
};
14
14
-
bell = {
15
15
-
visual = true;
16
16
-
};
17
17
-
cursor = {
18
18
-
style = "beam";
19
19
-
blink = true;
20
20
-
color = "11111b f5e0dc";
21
21
-
};
22
22
-
colors = {
23
23
-
foreground = "cdd6f4";
24
24
-
background = "1e1e2e";
25
25
-
regular0 = "45475a";
26
26
-
regular1 = "f38ba8";
27
27
-
regular2 = "a6e3a1";
28
28
-
regular3 = "f9e2af";
29
29
-
regular4 = "89b4fa";
30
30
-
regular5 = "f5c2e7";
31
31
-
regular6 = "94e2d5";
32
32
-
regular7 = "bac2de";
33
33
-
bright0 = "585b70";
34
34
-
bright1 = "f38ba8";
35
35
-
bright2 = "a6e3a1";
36
36
-
bright3 = "f9e2af";
37
37
-
bright4 = "89b4fa";
38
38
-
bright5 = "f5c2e7";
39
39
-
bright6 = "94e2d5";
40
40
-
bright7 = "a6adc8";
41
41
-
"16" = "fab387";
42
42
-
"17" = "f5e0dc";
43
43
-
selection-foreground = "cdd6f4";
44
44
-
selection-background = "414356";
45
45
-
search-box-no-match = "11111b f38ba8";
46
46
-
search-box-match = "cdd6f4 313244";
47
47
-
jump-labels = "11111b fab387";
48
48
-
urls = "89b4fa";
49
49
-
};
50
50
-
};
51
51
-
};
52
52
-
}
+2
-3
roles/graphics/hypr.nix
···
71
71
# };
72
72
misc = {
73
73
enable_swallow = true;
74
74
-
# swallow_regex = "^(foot)$";
75
74
disable_hyprland_logo = true;
76
75
disable_splash_rendering = true;
77
76
focus_on_activate = true;
···
79
78
key_press_enables_dpms = true;
80
79
};
81
80
env = [
82
82
-
"TERMINAL,foot"
81
81
+
"TERMINAL,kitty"
83
82
];
84
83
windowrulev2 = [
85
84
"workspace 1 silent,class:(.*)vesktop(.*),title:(.*)[Vv]esktop(.*)"
···
87
86
];
88
87
submap = "reset";
89
88
bind = let
90
90
-
openTerminal = "foot";
89
89
+
openTerminal = "kitty";
91
90
forEachWorkspace = {
92
91
mod,
93
92
dispatch,
+16
roles/graphics/kitty.nix
···
1
1
+
{...}: {
2
2
+
home-manager.users.bean.programs.kitty = {
3
3
+
enable = true;
4
4
+
font = {
5
5
+
name = "monospace";
6
6
+
size = 18;
7
7
+
};
8
8
+
keybindings = {
9
9
+
"ctrl+shift+o" = "open_url_with_hints";
10
10
+
};
11
11
+
settings = {
12
12
+
cursor_shape = "beam";
13
13
+
background_opacity = 0.92;
14
14
+
};
15
15
+
};
16
16
+
}
-1
roles/graphics/theming.nix
···
45
45
"XCURSOR_THEME,Sweet-cursors"
46
46
"XCURSOR_SIZE,${cursorSize}"
47
47
"GRIMBLAST_EDITOR,swappy -f "
48
48
-
"TERMINAL,foot"
49
48
];
50
49
exec-once = [
51
50
''dconf write /org/gnome/desktop/interface/cursor-theme "Sweet-cursors"''
+3
-3
roles/graphics/waybar.nix
···
291
291
exec = "${pkgs.nushell}/bin/nu ${inputs.self}/res/custom_waybar_modules/newsboat.nu";
292
292
exec-on-event = true;
293
293
format = "{}";
294
294
-
on-click = "pidof -q newsboat && hyprctl dispatch focuswindow newsboat || foot --title=\"Newsboat\" --app-id=\"newsboat\" newsboat; pkill -SIGRTMIN+6 waybar";
294
294
+
on-click = "pidof -q newsboat && hyprctl dispatch focuswindow newsboat || kitty --title=\"Newsboat\" --app-id=\"newsboat\" newsboat; pkill -SIGRTMIN+6 waybar";
295
295
on-click-right = "pkill waybar -SIGRTMIN+6";
296
296
restart-interval = 1800;
297
297
return-type = "json";
···
419
419
{
420
420
cpu = {
421
421
format = " {usage}";
422
422
-
on-click = "foot --title=\"Htop\" --app-id=\"htop\" htop --sort-key=PERCENT_CPU";
422
422
+
on-click = "kitty --title=\"Htop\" --app-id=\"htop\" htop --sort-key=PERCENT_CPU";
423
423
states = {
424
424
critical = 95;
425
425
warning = 80;
···
432
432
layer = "top";
433
433
memory = {
434
434
format = " {} ({used:0.1f}/{total:0.1f} GiB)";
435
435
-
on-click = "foot --title=\"Htop\" --app-id=\"htop\" htop --sort-key=PERCENT_MEM";
435
435
+
on-click = "kitty --title=\"Htop\" --app-id=\"htop\" htop --sort-key=PERCENT_MEM";
436
436
states = {
437
437
critical = 90;
438
438
warning = 70;
+3
-7
roles/graphics/xdg.nix
···
1
1
-
{
2
2
-
pkgs,
3
3
-
config,
4
4
-
...
5
5
-
}: {
1
1
+
{config, ...}: {
6
2
home-manager.users.bean.xdg = {
7
3
enable = true;
8
4
userDirs = with config.home-manager.users.bean.home; {
···
20
16
mimeApps = {
21
17
enable = true;
22
18
defaultApplications = let
23
23
-
textEditors = ["code.desktop"];
19
19
+
textEditors = ["neovide.desktop"];
24
20
browsers = ["firefox-devedition.desktop" "firefox.desktop" "chromium.desktop"];
25
21
imageViewers = ["gimp.desktop"];
26
22
in {
···
43
39
"image/x-portable-graymap" = imageViewers;
44
40
"image/x-portable-anymap" = imageViewers;
45
41
"image/svg+xml" = imageViewers;
46
46
-
"x-terminal-emulator" = ["foot"];
42
42
+
"x-terminal-emulator" = ["kitty"];
47
43
"x-scheme-handler/http" = browsers;
48
44
"x-scheme-handler/https" = browsers;
49
45
"x-scheme-handler/chrome" = browsers;