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
Toggleterm improvements
bwc9876.dev
8 months ago
d0032410
f12160cf
verified
This commit was signed with the committer's
known signature
.
bwc9876.dev
SSH Key Fingerprint:
SHA256:DanMEP/RNlSC7pAVbnXO6wzQV00rqyKj053tz4uH5gQ=
+184
-119
8 changed files
expand all
collapse all
unified
split
flake.nix
nixosModules
dev
misc.nix
nvim.nix
dev+graphics
nvim.nix
graphics
apps.nix
floorp.nix
hypr.nix
xdg.nix
+4
-3
flake.nix
···
63
"*.nix" = "alejandra .";
64
"*.sh" = "shfmt -w .";
65
};
66
-
packages =
67
-
nixpkgs.lib.genAttrs ["wayland-mpris-idle-inhibit" "nu_plugin_dbus"]
68
-
(i: {pkgs}: inputs.${i}.packages.${pkgs.system}.default);
0
69
nixDir = ./.;
70
nixDirAliases = {
71
nixosConfigurations = ["systemConfigs"];
···
63
"*.nix" = "alejandra .";
64
"*.sh" = "shfmt -w .";
65
};
66
+
67
+
packages = nixpkgs.lib.genAttrs ["wayland-mpris-idle-inhibit" "nu_plugin_dbus"] (
68
+
i: {pkgs}: inputs.${i}.packages.${pkgs.system}.default
69
+
);
70
nixDir = ./.;
71
nixDirAliases = {
72
nixosConfigurations = ["systemConfigs"];
+5
-1
nixosModules/dev+graphics/nvim.nix
···
1
-
{pkg, ...}: {
0
0
0
0
2
home-manager.users.bean = {
3
wayland.windowManager.hyprland.settings.bind = [
4
"SUPER,D,exec,neovide"
···
1
+
{pkgs, ...}: {
2
+
environment.systemPackages = with pkgs; [
3
+
neovide
4
+
];
5
+
6
home-manager.users.bean = {
7
wayland.windowManager.hyprland.settings.bind = [
8
"SUPER,D,exec,neovide"
+1
nixosModules/dev/misc.nix
···
31
enableBashIntegration = true;
32
enableNushellIntegration = true;
33
nix-direnv.enable = true;
0
34
};
35
}
···
31
enableBashIntegration = true;
32
enableNushellIntegration = true;
33
nix-direnv.enable = true;
34
+
silent = true;
35
};
36
}
+77
-53
nixosModules/dev/nvim.nix
···
10
fd
11
];
12
13
-
# TODO: Wish list
14
-
# - https://github.com/al1-ce/just.nvim
15
-
# - DAP Setup? If not just get rid of the plugin...
16
-
# - Proper Start screen / projects
17
-
# - On project open with no session saved, show a little screen or smth?
18
-
# - Neovide let me paste from system clipboard in insert mode
19
-
# - Fix hex stuff, working hex editor please
20
-
# - Image viewer would be cool
21
-
# - More customization of toggleterm, tabs would be really nice
22
-
# - Switch project combo if not already present
23
-
# - Neotree look nicer
24
-
# - Bufferline color "Neovim" in space, im thinking logo in green bold and text in normal green
25
-
26
home-manager.users.bean = {
27
imports = [inputs.nixvim.homeManagerModules.nixvim];
28
···
33
viAlias = true;
34
vimAlias = true;
35
36
-
dependencies.direnv.enable = true;
0
0
37
38
nixpkgs.pkgs = pkgs;
39
···
46
no_underline = false;
47
no_bold = false;
48
no_italics = false;
0
49
# transparent_background = true;
50
integrations = {
51
alpha = true;
···
98
},
99
},
100
})
0
0
101
'';
102
103
autoGroups = {
···
169
170
keymaps = [
171
{
172
-
action = ''"+y'';
173
-
key = "<C-S-C>";
174
-
options.desc = "Copy to System Clipboard";
175
-
}
176
-
{
177
-
action = ''"+p'';
178
-
key = "<C-S-V>";
179
-
options.desc = "Paste from System Clipboard";
180
-
}
181
-
{
182
-
action = ''"+x'';
183
-
key = "<C-S-X>";
184
-
options.desc = "Cut to System Clipboard";
185
-
}
186
-
{
187
action = "<cmd>Lspsaga code_action code_action<cr>";
188
key = "<C-.>a";
189
options.desc = "Code Actions";
···
434
saved_terminal = term.get(termid)
435
end,
436
post_open = function(opts)
437
-
if opts.is_blocking and saved_terminal then
438
saved_terminal:close()
439
else
440
vim.api.nvim_set_current_win(opts.winnr)
···
465
})
466
'';
467
settings = {
0
468
open_mapping = "[[<C-x>]]";
469
direction = "horizontal";
470
start_in_insert = true;
471
insert_mappings = true;
472
terminal_mappings = true;
0
0
0
0
0
0
0
0
473
};
474
};
475
···
487
illuminate.enable = true;
488
cursorline.enable = true;
489
490
-
neoscroll = {
491
-
enable = true;
492
-
settings.easing_function = "cubic";
493
-
};
494
scrollview.enable = true;
495
496
navbuddy = {
···
514
515
bufferline = {
516
enable = true;
0
0
0
517
settings.options = {
518
indicator.style = "none";
519
close_icon = "";
···
521
offsets = [
522
{
523
filetype = "neo-tree";
0
524
text = " Neovim";
525
text_align = "center";
526
-
separator = true;
527
}
528
];
529
separator_style = "slant";
···
546
547
statuscol = {
548
enable = true;
549
-
settings.segments = [
0
0
0
0
0
0
0
0
550
{
551
click = "v:lua.ScSa";
0
0
0
552
text = [
553
"%s"
554
];
555
}
556
{
557
click = "v:lua.ScLa";
0
558
text = [
559
{
560
__raw = "require('statuscol.builtin').lnumfunc";
···
564
{
565
click = "v:lua.ScFa";
566
condition = [
567
-
true
568
{
569
__raw = "require('statuscol.builtin').not_empty";
570
}
···
579
];
580
};
581
582
-
dropbar.enable = true;
0
0
0
0
0
0
583
584
nvim-ufo = {
585
enable = true;
586
};
587
gitsigns.enable = true;
588
589
-
dap = {
590
-
enable = true;
591
-
};
592
-
593
-
dap-virtual-text.enable = true;
594
-
595
lualine = {
596
enable = true;
597
settings = {
···
603
options = {
604
theme = "catppuccin";
605
disabled_filetypes = ["neo-tree"];
0
606
};
607
};
608
};
···
616
617
neo-tree = {
618
enable = true;
0
619
addBlankLineAtTop = true;
620
-
window.width = 30;
0
0
0
0
0
0
0
0
0
621
closeIfLastWindow = true;
0
0
0
0
0
0
0
0
0
0
0
0
622
};
623
624
# image.enable = true;
···
640
enable = true;
641
settings.notification = {
642
window = {
0
0
0
643
align = "top";
644
winblend = 0;
645
};
···
649
none-ls = {
650
enable = true;
651
sources.formatting = {
652
-
alejandra.enable = true;
653
prettier = {
654
enable = true;
655
disableTsServerFormatter = true;
···
692
lspkind.enable = true;
693
# jupytext.enable = true;
694
695
-
hex = {
696
-
enable = true;
697
-
settings = {
698
-
assemble_cmd = "xxd -r";
699
-
dump_cmd = "xxd -g 1 -u";
700
-
};
701
-
};
0
702
703
lspsaga = {
704
enable = true;
···
10
fd
11
];
12
0
0
0
0
0
0
0
0
0
0
0
0
0
13
home-manager.users.bean = {
14
imports = [inputs.nixvim.homeManagerModules.nixvim];
15
···
20
viAlias = true;
21
vimAlias = true;
22
23
+
dependencies = {
24
+
direnv.enable = true;
25
+
};
26
27
nixpkgs.pkgs = pkgs;
28
···
35
no_underline = false;
36
no_bold = false;
37
no_italics = false;
38
+
term_colors = true;
39
# transparent_background = true;
40
integrations = {
41
alpha = true;
···
88
},
89
},
90
})
91
+
vim.g.neovide_cursor_vfx_mode = "pixiedust"
92
+
93
'';
94
95
autoGroups = {
···
161
162
keymaps = [
163
{
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
164
action = "<cmd>Lspsaga code_action code_action<cr>";
165
key = "<C-.>a";
166
options.desc = "Code Actions";
···
411
saved_terminal = term.get(termid)
412
end,
413
post_open = function(opts)
414
+
if saved_terminal then
415
saved_terminal:close()
416
else
417
vim.api.nvim_set_current_win(opts.winnr)
···
442
})
443
'';
444
settings = {
445
+
size = 20;
446
open_mapping = "[[<C-x>]]";
447
direction = "horizontal";
448
start_in_insert = true;
449
insert_mappings = true;
450
terminal_mappings = true;
451
+
# winbar = {
452
+
# enabled = true;
453
+
# # name_formatter.__raw = ''
454
+
# # function(term)
455
+
# # return term:_display_name() .. " (" .. tostring(term.id) .. ")"
456
+
# # end
457
+
# # '';
458
+
# };
459
};
460
};
461
···
473
illuminate.enable = true;
474
cursorline.enable = true;
475
0
0
0
0
476
scrollview.enable = true;
477
478
navbuddy = {
···
496
497
bufferline = {
498
enable = true;
499
+
settings.highlights.__raw = ''
500
+
require("catppuccin.groups.integrations.bufferline").get()
501
+
'';
502
settings.options = {
503
indicator.style = "none";
504
close_icon = "";
···
506
offsets = [
507
{
508
filetype = "neo-tree";
509
+
highlight = "String";
510
text = " Neovim";
511
text_align = "center";
512
+
# separator = true;
513
}
514
];
515
separator_style = "slant";
···
532
533
statuscol = {
534
enable = true;
535
+
settings.segments = let
536
+
dispCond = {
537
+
__raw = ''
538
+
function(ln)
539
+
return vim.bo.filetype ~= "neo-tree"
540
+
end
541
+
'';
542
+
};
543
+
in [
544
{
545
click = "v:lua.ScSa";
546
+
condition = [
547
+
dispCond
548
+
];
549
text = [
550
"%s"
551
];
552
}
553
{
554
click = "v:lua.ScLa";
555
+
condition = [dispCond];
556
text = [
557
{
558
__raw = "require('statuscol.builtin').lnumfunc";
···
562
{
563
click = "v:lua.ScFa";
564
condition = [
565
+
dispCond
566
{
567
__raw = "require('statuscol.builtin').not_empty";
568
}
···
577
];
578
};
579
580
+
dropbar = {
581
+
enable = true;
582
+
settings = {
583
+
bar.padding.right = 5;
584
+
bar.padding.left = 1;
585
+
};
586
+
};
587
588
nvim-ufo = {
589
enable = true;
590
};
591
gitsigns.enable = true;
592
0
0
0
0
0
0
593
lualine = {
594
enable = true;
595
settings = {
···
601
options = {
602
theme = "catppuccin";
603
disabled_filetypes = ["neo-tree"];
604
+
ignore_focus = ["neo-tree"];
605
};
606
};
607
};
···
615
616
neo-tree = {
617
enable = true;
618
+
hideRootNode = false;
619
addBlankLineAtTop = true;
620
+
defaultComponentConfigs = {
621
+
container.rightPadding = 2;
622
+
name.trailingSlash = true;
623
+
indent = {
624
+
indentSize = 2;
625
+
withExpanders = true;
626
+
};
627
+
};
628
+
window.width = 40;
629
+
autoCleanAfterSessionRestore = true;
630
closeIfLastWindow = true;
631
+
extraOptions = {
632
+
filesystem.components.name.__raw = ''
633
+
function(config, node, state)
634
+
local components = require('neo-tree.sources.common.components')
635
+
local name = components.name(config, node, state)
636
+
if node:get_depth() == 1 then
637
+
name.text = vim.fs.basename(vim.loop.cwd() or "") .. "/"
638
+
end
639
+
return name
640
+
end
641
+
'';
642
+
};
643
};
644
645
# image.enable = true;
···
661
enable = true;
662
settings.notification = {
663
window = {
664
+
y_padding = 2;
665
+
x_padding = 2;
666
+
zindex = 50;
667
align = "top";
668
winblend = 0;
669
};
···
673
none-ls = {
674
enable = true;
675
sources.formatting = {
0
676
prettier = {
677
enable = true;
678
disableTsServerFormatter = true;
···
715
lspkind.enable = true;
716
# jupytext.enable = true;
717
718
+
# Broken
719
+
# hex = {
720
+
# enable = true;
721
+
# settings = {
722
+
# assemble_cmd = "xxd -r";
723
+
# dump_cmd = "xxd -g 1 -u";
724
+
# };
725
+
# };
726
727
lspsaga = {
728
enable = true;
-2
nixosModules/graphics/apps.nix
···
148
'';
149
};
150
151
-
environment.variables.NIXOS_OZONE_WL = "1";
152
-
153
environment.systemPackages = with pkgs; [
154
chromium
155
···
148
'';
149
};
150
0
0
151
environment.systemPackages = with pkgs; [
152
chromium
153
+9
nixosModules/graphics/floorp.nix
···
7
floorp
8
];
9
0
0
0
0
0
0
0
0
0
10
home-manager.users.bean.programs.floorp = {
11
enable = true;
12
policies = {
···
7
floorp
8
];
9
10
+
networking.stevenblack = {
11
+
enable = true;
12
+
block = [
13
+
"fakenews"
14
+
"gambling"
15
+
"porn"
16
+
];
17
+
};
18
+
19
home-manager.users.bean.programs.floorp = {
20
enable = true;
21
policies = {
+19
-8
nixosModules/graphics/hypr.nix
···
4
hyprpicker
5
uwsm
6
];
0
0
0
0
0
0
0
0
0
0
7
};
8
9
xdg.portal.extraPortals = with pkgs; [xdg-desktop-portal-gtk];
···
86
mod,
87
dispatch,
88
}:
89
-
builtins.genList
90
-
(i: let
91
-
num = builtins.toString i;
92
-
in "${mod},${num},${dispatch},${
93
-
if num == "0"
94
-
then "10"
95
-
else num
96
-
}")
0
97
10;
98
in
99
[
···
4
hyprpicker
5
uwsm
6
];
7
+
variables = {
8
+
NIXOS_OZONE_WL = "1";
9
+
_JAVA_AWT_WM_NONEREPARENTING = "1";
10
+
GDK_BACKEND = "wayland,x11";
11
+
ANKI_WAYLAND = "1";
12
+
MOZ_ENABLE_WAYLAND = "1";
13
+
XDG_SESSION_TYPE = "wayland";
14
+
SDL_VIDEODRIVER = "wayland";
15
+
CLUTTER_BACKEND = "wayland";
16
+
};
17
};
18
19
xdg.portal.extraPortals = with pkgs; [xdg-desktop-portal-gtk];
···
96
mod,
97
dispatch,
98
}:
99
+
builtins.genList (
100
+
i: let
101
+
num = builtins.toString i;
102
+
in "${mod},${num},${dispatch},${
103
+
if num == "0"
104
+
then "10"
105
+
else num
106
+
}"
107
+
)
108
10;
109
in
110
[
+69
-52
nixosModules/graphics/xdg.nix
···
1
-
{config, ...}: {
0
0
0
0
2
home-manager.users.bean.xdg = {
3
enable = true;
4
-
userDirs = with config.home-manager.users.bean.home; {
0
0
5
enable = true;
6
createDirectories = true;
7
desktop = "${homeDirectory}/Desktop";
···
16
mimeApps = {
17
enable = true;
18
defaultApplications = let
19
-
textEditors = ["neovide.desktop"];
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
20
browsers = [
21
"floorp.desktop"
22
"chromium.desktop"
23
];
24
-
imageViewers = [
25
-
"org.gnome.Loupe.desktop"
26
-
"gimp.desktop"
27
-
];
28
-
videoPlayers = [
29
-
"QMPlay2.desktop"
30
-
];
31
-
in {
32
-
"inode/directory" = ["org.kde.dolphin.desktop"];
33
-
"text/plain" = textEditors;
34
-
"text/markdown" = textEditors;
35
-
"text/xml" = textEditors;
36
-
"text/x-markdown" = textEditors;
37
-
"text/x-readme" = textEditors;
38
-
"text/x-changelog" = textEditors;
39
-
"text/x-copying" = textEditors;
40
-
"text/x-install" = textEditors;
41
-
"text/html" = browsers;
42
-
"image/png" = imageViewers;
43
-
"image/webp" = imageViewers;
44
-
"image/jpeg" = imageViewers;
45
-
"image/gif" = browsers;
46
-
"image/bmp" = imageViewers;
47
-
"image/x-portable-pixmap" = imageViewers;
48
-
"image/x-portable-bitmap" = imageViewers;
49
-
"image/x-portable-graymap" = imageViewers;
50
-
"image/x-portable-anymap" = imageViewers;
51
-
"image/svg+xml" = imageViewers;
52
-
"video/mp4" = videoPlayers;
53
-
"video/AV1" = videoPlayers;
54
-
"video/m4a" = videoPlayers;
55
-
"video/mpeg" = videoPlayers;
56
-
"video/3gpp" = videoPlayers;
57
-
"x-terminal-emulator" = ["wezterm.desktop"];
58
-
"x-scheme-handler/http" = browsers;
59
-
"x-scheme-handler/https" = browsers;
60
-
"x-scheme-handler/chrome" = browsers;
61
-
"x-scheme-handler/vscode" = ["code-url-handler.desktop"];
62
-
"x-scheme-handler/x-github-client" = ["github-desktop.desktop"];
63
-
"x-scheme-handler/x-github-desktop-auth" = ["github-desktop.desktop"];
64
-
"application/x-extension-htm" = browsers;
65
-
"application/x-extension-html" = browsers;
66
-
"application/x-extension-shtml" = browsers;
67
-
"application/x-extension-xht" = browsers;
68
-
"application/x-extension-xhtml" = browsers;
69
-
"application/xhtml+xml" = browsers;
70
-
"application/xml" = browsers;
71
-
"application/pdf" = browsers;
72
-
};
73
};
74
};
75
}
···
1
+
{
2
+
config,
3
+
lib,
4
+
...
5
+
}: {
6
home-manager.users.bean.xdg = {
7
enable = true;
8
+
userDirs = let
9
+
inherit (config.home-manager.users.bean.home) homeDirectory;
10
+
in {
11
enable = true;
12
createDirectories = true;
13
desktop = "${homeDirectory}/Desktop";
···
22
mimeApps = {
23
enable = true;
24
defaultApplications = let
25
+
types = {
26
+
browser = [
27
+
"text/html"
28
+
"application/pdf"
29
+
"x-scheme-handler/http"
30
+
"x-scheme-handler/https"
31
+
"x-scheme-handler/ftp"
32
+
"x-scheme-handler/about"
33
+
"x-scheme-handler/unknown"
34
+
];
35
+
code = [
36
+
"application/json"
37
+
"application/xml"
38
+
"application/yaml"
39
+
"text/english"
40
+
"text/plain"
41
+
"text/x-makefile"
42
+
"text/x-c++hdr"
43
+
"text/x-c++src"
44
+
"text/x-chdr"
45
+
"text/x-csrc"
46
+
"text/x-java"
47
+
"text/x-moc"
48
+
"text/x-pascal"
49
+
"text/x-tcl"
50
+
"text/x-tex"
51
+
"text/x-rust"
52
+
"application/x-shellscript"
53
+
"text/x-c"
54
+
"text/x-c++"
55
+
];
56
+
image = ["image/*"];
57
+
av = [
58
+
"video/*"
59
+
"audio/*"
60
+
];
61
+
dir = ["inode/directory"];
62
+
};
63
+
fileBrowsers = ["org.kde.dolphin.desktop"];
64
+
textEditors = [
65
+
"neovide.desktop"
66
+
"nvim.desktop"
67
+
];
68
browsers = [
69
"floorp.desktop"
70
"chromium.desktop"
71
];
72
+
imageViewers =
73
+
[
74
+
"org.gnome.Loupe.desktop"
75
+
"gimp.desktop"
76
+
]
77
+
++ browsers;
78
+
avPlayers =
79
+
[
80
+
"QMPlay2.desktop"
81
+
]
82
+
++ browsers;
83
+
genTypeHandler = type: handlers: lib.genAttrs type (_: handlers);
84
+
in
85
+
(genTypeHandler types.code textEditors)
86
+
// (genTypeHandler types.av avPlayers)
87
+
// (genTypeHandler types.image imageViewers)
88
+
// (genTypeHandler types.dir fileBrowsers)
89
+
// (genTypeHandler types.browser browsers);
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
90
};
91
};
92
}