sorta refactor

This commit is contained in:
2025-12-25 23:41:24 +02:00
parent 68f7fe03e7
commit 063e32aa73
52 changed files with 1159 additions and 1996 deletions
+44
View File
@@ -0,0 +1,44 @@
{
config,
pkgs,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption getExe;
in {
programs = {
atuin = {
enable = true;
flags = [
"--disable-up-arrow"
];
};
fish = {
enable = true; # friendly interactive shell in rust
shellAliases = {
cd = "z";
ed = "$EDITOR";
jf = "jj-fzf"; # think of jeff
jo = "joshuto"; # think of josh
l = "ls -lah";
la = "ls -ah";
ll = "ls -lh";
p = "pueue";
s = "systemctl";
stui = "systemctl-tui";
};
shellAbbrs = {
pa = "pueue add --";
pl = "pueue log";
};
interactiveShellInit = ''
bind \e\[3\;5~ kill-word
bind \cH backward-kill-word
set fish_greeting
set fish_cursor_default block blink
# ${getExe pkgs.bat-extras.batman} --export-env | source
if test -e ~/.profile; source ~/.profile; end
'';
};
};
}
+18
View File
@@ -0,0 +1,18 @@
{
config,
lib,
perSystem,
...
}: {
programs.ghostty = {
enable = true;
package = perSystem.ghostty.ghostty;
settings = {
gtk-single-instance = true;
window-decoration = "client";
keybind = [
"ctrl+shift+f=close_surface"
];
};
};
}
+180
View File
@@ -0,0 +1,180 @@
{
pkgs,
config,
lib,
...
}: let
inherit (lib) getExe;
in {
programs.helix = {
enable = true; # vim-like editor in rust
defaultEditor = true;
settings = {
editor = {
bufferline = "multiple";
cursorline = true;
inline-diagnostics.cursor-line = "warning";
line-number = "relative";
lsp = {
display-messages = true;
display-inlay-hints = true;
};
cursor-shape = {
insert = "bar";
normal = "block";
select = "underline";
};
statusline = {
left = ["mode" "spinner" "version-control"];
center = ["file-name"];
right = ["diagnostics" "selections" "position" "file-encoding" "file-line-ending" "file-type"];
separator = "|";
};
soft-wrap = {
enable = true;
max-wrap = 25;
max-indent-retain = 0;
wrap-indicator = "";
};
};
keys = {
insert.C-c = "normal_mode";
normal = {
esc = ["collapse_selection" "keep_primary_selection"];
space = {
space = "file_picker";
w = ":w";
q = ":q";
x = ":x";
n = ":n";
"," = "goto_previous_buffer";
"." = "goto_next_buffer";
l = ":reflow";
};
};
};
};
languages = {
language-server = {
# markdown-oxide.command = getExe pkgs.markdown-oxide;
# nixd.command = getExe pkgs.nixd;
# pyright = {
# command = getExe pkgs.pyright;
# args = ["-"];
# };
# rust-analyzer.command = getExe pkgs.rust-analyzer;
# texlab.command = getExe pkgs.texlab;
bash-language-server = {
command = getExe pkgs.bash-language-server;
environment = {
"SHELLCHECK_PATH" = getExe pkgs.shellcheck;
"SHFMT_PATH" = getExe pkgs.shfmt;
};
};
clangd.command = "${pkgs.clang-tools}/bin/clangd";
# fsac = {
# command = getExe pkgs.fsautocomplete;
# config = {
# editor.formatOnSave = true;
# AutomaticWorkspaceInit = true;
# FSharp.ExternalAutocomplete = true;
# FSharp.linting.fsharplint.enabled = true;
# FSharp.linting.fsharplint.configFile = "fsharplint.json";
# FSharp.formatting.fantomas.enabled = true;
# };
# };
nil = {
command = getExe pkgs.nil;
config = {
formatting.command = [(getExe pkgs.alejandra)];
};
};
ruff = {
command = getExe pkgs.ruff;
args = ["server"];
};
tinymist.command = getExe pkgs.tinymist;
vscode-json-language-server.command = getExe pkgs.nodePackages.vscode-json-languageserver;
yaml-language-server.command = getExe pkgs.yaml-language-server;
zk = {
command = getExe pkgs.zk;
args = ["lsp"];
};
};
language = [
{
name = "nix";
auto-format = true;
language-servers = ["nil"];
}
{
name = "typst";
auto-format = true;
formatter.command = getExe pkgs.typstyle;
language-servers = ["tinymist"];
}
{
name = "markdown";
# auto-format = true;
language-servers = ["zk" "markdown-oxide"];
}
{
name = "c";
auto-format = true;
# formatter.command = "${pkgs.clang-tools}/bin/clang-format";
}
{
name = "cpp";
auto-format = true;
# formatter.command = "${pkgs.clang-tools}/bin/clang-format";
}
# {
# name = "fsharp";
# auto-format = true;
# language-servers = ["fsac"];
# scope = "source.fs";
# roots = ["fsproj" "sln" ".git"];
# }
# {
# name = "rust";
# auto-format = true;
# language-servers = ["rust-analyzer"];
# formatter.command = getExe pkgs.rustfmt;
# }
{
name = "json";
auto-format = true;
formatter.command = getExe pkgs.jq;
language-servers = ["vscode-json-language-server"];
}
{
name = "yaml";
auto-format = true;
formatter.command = getExe pkgs.yamlfmt;
formatter.args = ["-"];
language-servers = ["yaml-language-server"];
}
{
name = "bash";
auto-format = true;
# formatter.command = getExe pkgs.shfmt;
# formatter.args = ["-"];
}
{
name = "python";
auto-format = true;
language-servers = [
{
name = "ruff";
# only-features = ["format" "diagnostics"];
}
# {
# name = "pyright";
# except-features = ["format" "diagnostics"];
# }
];
}
];
};
};
}
+15
View File
@@ -0,0 +1,15 @@
{
config,
lib,
...
}: {
programs.kitty = {
enable = true;
settings = {
tab_bar_edge = "bottom";
tab_bar_align = "left";
tab_bar_style = "fade";
# tab_separator = " ";
};
};
}
+123
View File
@@ -0,0 +1,123 @@
{
config,
lib,
...
}: {
programs.oh-my-posh = {
enable = true;
settings = {
# version = 2;
final_space = true;
shell_integration = true;
console_title_template = "{{ .Shell }} in {{ .Folder }}";
blocks = [
{
type = "prompt";
alignment = "left";
overflow = "hidden";
segments = [
{
type = "path";
style = "plain";
background = "transparent";
foreground = "blue";
template = "{{ .Path }}";
properties = {
style = "full";
};
}
{
type = "text";
style = "plain";
background = "transparent";
template = "{{ if .Env.BW_SESSION }} 󰞀{{ end }}";
}
{
type = "nix-shell";
style = "plain";
background = "transparent";
template = "{{ if ne .Type \"unknown\" }} {{ end }}";
}
{
type = "git";
style = "plain";
foreground = "p:grey";
background = "transparent";
template = " {{ .HEAD }}{{ if or (.Working.Changed) (.Staging.Changed) }}*{{ end }} <cyan>{{ if gt .Behind 0 }}{{ end }}{{ if gt .Ahead 0 }}{{ end }}</>";
properties = {
branch_icon = "";
commit_icon = "@";
fetch_status = true;
};
}
];
}
{
type = "prompt";
alignment = "right";
segments = [
{
type = "session";
style = "plain";
foreground = "white";
background = "transparent";
template = "{{ if .SSHSession }} {{ .UserName }}@{{ .HostName }}{{ end }}";
}
{
style = "plain";
foreground = "white";
background = "transparent";
properties = {
charged_icon = "󰁹";
charging_icon = "󱟡";
discharging_icon = "󱟟";
};
template = "{{ if not .Error }} {{ .Icon }} {{ .Percentage }}%{{ end }}";
type = "battery";
}
];
}
{
type = "rprompt";
overflow = "hidden";
segments = [
{
type = "executiontime";
style = "plain";
foreground = "yellow";
background = "transparent";
template = "{{.FormattedMs}}";
properties = {
threshold = 5000;
};
}
];
}
{
type = "prompt";
alignment = "left";
newline = true;
segments = [
{
type = "text";
style = "plain";
foreground_templates = ["{{if gt .Code 0}}red{{end}}" "{{if eq .Code 0}}magenta{{end}}"];
background = "transparent";
template = ">";
}
];
}
];
transient_prompt = {
foreground_templates = ["{{if gt .Code 0}}red{{end}}" "{{if eq .Code 0}}magenta{{end}}"];
background = "transparent";
template = "> ";
};
secondary_prompt = {
foreground = "magenta";
background = "transparent";
template = "-> ";
};
};
};
}
+192
View File
@@ -0,0 +1,192 @@
{
config,
# inputs,
# pkgs,
lib,
...
}: {
programs.wezterm = {
enable = true;
# package = inputs.wezterm.packages.${pkgs.system}.default;
extraConfig = let
arrows = {
left = "LeftArrow";
down = "DownArrow";
up = "UpArrow";
right = "RightArrow";
};
homerow-arrows = {
left = "n";
down = "e";
up = "i";
right = "o";
};
genNavigation = keys: ''
{ key = '${keys.left}', mods = 'LEADER', action = act.ActivatePaneDirection 'Left' },
{ key = '${keys.down}', mods = 'LEADER', action = act.ActivatePaneDirection 'Down' },
{ key = '${keys.up}', mods = 'LEADER', action = act.ActivatePaneDirection 'Up' },
{ key = '${keys.right}', mods = 'LEADER', action = act.ActivatePaneDirection 'Right' },
{ key = '${keys.left}', mods = 'CTRL|SHIFT', action = act.ActivatePaneDirection 'Left' },
{ key = '${keys.down}', mods = 'CTRL|SHIFT', action = act.ActivatePaneDirection 'Down' },
{ key = '${keys.up}', mods = 'CTRL|SHIFT', action = act.ActivatePaneDirection 'Up' },
{ key = '${keys.right}', mods = 'CTRL|SHIFT', action = act.ActivatePaneDirection 'Right' },
'';
in
# lua
''
local wezterm = require 'wezterm'
local act = wezterm.action
local resurrect = wezterm.plugin.require("https://github.com/MLFlexer/resurrect.wezterm")
local workspace_switcher = wezterm.plugin.require("https://github.com/MLFlexer/smart_workspace_switcher.wezterm")
wezterm.on("augment-command-palette", function(window, pane)
local workspace_state = resurrect.workspace_state
return {
{
brief = "Window | Workspace: Switch Workspace",
icon = "md_briefcase_arrow_up_down",
action = workspace_switcher.switch_workspace(),
},
{
brief = "Window | Workspace: Rename Workspace",
icon = "md_briefcase_edit",
action = wezterm.action.PromptInputLine({
description = "Enter new name for workspace",
action = wezterm.action_callback(function(window, pane, line)
if line then
wezterm.mux.rename_workspace(wezterm.mux.get_active_workspace(), line)
resurrect.state_manager.save_state(workspace_state.get_workspace_state())
end
end),
}),
},
}
end)
return {
front_end = 'WebGpu',
unix_domains = {
{
name = 'unix',
},
},
enable_kitty_graphics = true,
window_padding = {
left = 0,
right = 0,
top = 0,
bottom = 0,
},
use_fancy_tab_bar = false,
inactive_pane_hsb = {
-- saturation = 0.8,
brightness = 0.7,
},
-- window_frame = {
-- font = wezterm.font { family = 'Cantarell', weight = 'Bold' },
-- },
disable_default_key_bindings = true,
leader = { key = 'Space', mods = 'CTRL', timeout_milliseconds = 2000 },
keys = {
{
key = "w",
mods = "LEADER",
action = resurrect.window_state.save_window_action(),
},
{
key = "t",
mods = "LEADER",
action = resurrect.tab_state.save_tab_action(),
},
{
key = "s",
mods = "LEADER",
action = wezterm.action_callback(function(win, pane)
resurrect.state_manager.save_state(resurrect.workspace_state.get_workspace_state())
resurrect.window_state.save_window_action()
end),
},
{
key = "r",
mods = "LEADER",
action = wezterm.action_callback(function(win, pane)
resurrect.fuzzy_loader.fuzzy_load(win, pane, function(id, label)
local type = string.match(id, "^([^/]+)") -- match before '/'
id = string.match(id, "([^/]+)$") -- match after '/'
id = string.match(id, "(.+)%..+$") -- remove file extention
local opts = {
relative = true,
restore_text = true,
on_pane_restore = resurrect.tab_state.default_on_pane_restore,
}
if type == "workspace" then
local state = resurrect.state_manager.load_state(id, "workspace")
resurrect.workspace_state.restore_workspace(state, opts)
elseif type == "window" then
local state = resurrect.state_manager.load_state(id, "window")
resurrect.window_state.restore_window(pane:window(), state, opts)
elseif type == "tab" then
local state = resurrect.state_manager.load_state(id, "tab")
resurrect.tab_state.restore_tab(pane:tab(), state, opts)
end
end)
end),
},
{
key = "d",
mods = "LEADER",
action = wezterm.action_callback(function(win, pane)
resurrect.fuzzy_loader.fuzzy_load(win, pane, function(id)
resurrect.state_manager.delete_state(id)
end,
{
title = "Delete State",
description = "Select State to Delete and press Enter = accept, Esc = cancel, / = filter",
fuzzy_description = "Search State to Delete: ",
is_fuzzy = true,
})
end),
},
{
key = 'p',
mods = 'LEADER',
action = wezterm.action.ActivateCommandPalette,
},
{ key = 'Enter', mods = 'SHIFT|CTRL', action = act.ActivateCopyMode },
{ key = 'R', mods = 'SHIFT|CTRL', action = act.ReloadConfiguration },
{ key = '=', mods = 'CTRL', action = act.IncreaseFontSize },
{ key = '-', mods = 'CTRL', action = act.DecreaseFontSize },
{ key = '0', mods = 'CTRL', action = act.ResetFontSize },
{ key = 'C', mods = 'SHIFT|CTRL', action = act.CopyTo 'Clipboard' },
-- { key = 'N', mods = 'SHIFT|CTRL', action = act.SpawnWindow },
{ key = 'l', mods = 'SHIFT|CTRL', action = act.CharSelect{ copy_on_select = true, copy_to = 'ClipboardAndPrimarySelection' } },
{ key = 'v', mods = 'SHIFT|CTRL', action = act.PasteFrom 'Clipboard' },
{ key = '<', mods = 'CTRL|SHIFT', action = act.ActivateTabRelative(-1) },
{ key = '>', mods = 'CTRL|SHIFT', action = act.ActivateTabRelative(1) },
{ key = 'Tab', mods = 'CTRL|SHIFT', action = act.ActivateTabRelative(-1) },
{ key = 'Tab', mods = 'CTRL', action = act.ActivateTabRelative(1) },
{ key = '%', mods = 'SHIFT|CTRL', action = act.SplitVertical { domain = 'CurrentPaneDomain' }, },
{ key = '"', mods = 'SHIFT|CTRL', action = act.SplitHorizontal { domain = 'CurrentPaneDomain' }, },
-- pane navigation
${genNavigation arrows}
${genNavigation homerow-arrows}
{ key = 't', mods = 'SHIFT|CTRL', action = act.SpawnTab 'CurrentPaneDomain' },
{ key = 'w', mods = 'SHIFT|CTRL', action = act.CloseCurrentTab{ confirm = false } },
{ key = 'f', mods = 'SHIFT|CTRL', action = act.CloseCurrentPane{ confirm = false } },
{ key = 'b', mods = 'LEADER|CTRL', action = act.SendString '\x02', },
{ key = 'Enter', mods = 'LEADER', action = act.ActivateCopyMode, },
-- { key = 'p', mods = 'LEADER', action = act.PasteFrom 'PrimarySelection', },
{ key = 'k', mods = 'SHIFT|CTRL', action = act.Multiple
{
act.ClearScrollback 'ScrollbackAndViewport',
act.SendKey { key = 'L', mods = 'CTRL' },
},
},
},
}
'';
};
}
+108
View File
@@ -0,0 +1,108 @@
{
pkgs,
# config,
lib,
...
}: {
programs.yazi = {
enable = true; # file manager in rust
enableNushellIntegration = true;
shellWrapperName = "y";
settings = {
opener = {
open = [
{
run = "xdg-open \"$@\"";
orphan = true;
desc = "Open";
}
];
edit = [
{
run = "$EDITOR \"$@\"";
block = true;
desc = "Edit";
}
];
dragdrop = [
{
run = "${lib.getExe pkgs.ripdrag} -ab \"$@\"";
desc = "Drag'n'drop";
orphan = true;
for = "unix";
}
];
};
open.rules = [
{
mime = "text/*";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.json";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.yaml";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.yml";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.toml";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.sh";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.ini";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.conf";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.csv";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.go";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.html";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.c";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.cpp";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.rs";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.nix";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.py";
use = ["edit" "open" "dragdrop"];
}
{
name = "*";
use = ["open" "edit" "dragdrop"];
}
];
};
};
}
+151
View File
@@ -0,0 +1,151 @@
{
config,
pkgs,
lib,
...
}: let
inherit (lib) getExe;
in {
programs.zed-editor = {
enable = true;
extensions = [
"bash"
"fsharp"
"justfile"
"nix"
"typst"
];
userSettings = {
vim_mode = true;
ui_font_size = mkForce 16;
buffer_font_size = mkForce 16;
# features = {inline_completion_provider = "none";};
auto_update = false;
languages = {
"FSharp" = {
language-servers = [
"fsautocomplete"
];
};
"Nix" = {
language-servers = [
"nil"
];
# formatter = {
# external.command = getExe pkgs.alejandra;
# };
};
# "Rust" = {
# formatter = {
# external = {
# command = getExe pkgs.rustfmt;
# arguments = ["--edition" "2021"];
# };
# };
# };
"typst" = {
language-servers = ["tinymist"];
format_on_save = "on";
# formatter = {
# external = {
# command = getExe pkgs.typstyle;
# arguments = ["-i" "{buffer_path}"];
# };
# };
};
"Python" = {
format_on_save = "on";
formatter = [
{
language_server = {
name = "ruff";
};
}
];
language_servers = ["ruff"];
};
};
lsp = {
bash-language-server = {
binary = {
path = getExe pkgs.bash-language-server;
env = {
"SHELLCHECK_PATH" = getExe pkgs.shellcheck;
"SHFMT_PATH" = getExe pkgs.shfmt;
};
};
};
fsautocomplete = {
binary = {
path = getExe pkgs.fsautocomplete;
};
settings = {
AutomaticWorkspaceInit = true;
FSharp.ExternalAutocomplete = true;
FSharp.linting.fsharplint.enabled = true;
FSharp.linting.fsharplint.configFile = "fsharplint.json";
FSharp.formatting.fantomas.enabled = true;
};
};
clangd = {
binary = {
arguments = [];
path = "${pkgs.clang-tools}/bin/clangd";
};
};
# rust-analyzer = {
# binary = {
# arguments = [];
# path = getExe pkgs.rust-analyzer;
# };
# };
ruff = {
binary = {
arguments = [];
path = getExe pkgs.ruff;
};
};
# nixd = {
# binary = {
# arguments = [];
# path = getExe pkgs.nixd;
# };
# initialization_options.formatting.command = [(getExe pkgs.alejandra)];
# };
nil = {
binary = {
arguments = [];
path = getExe pkgs.nil;
};
settings.formatting.command = [(getExe pkgs.alejandra)];
};
# texlab = {
# binary = {
# arguments = [];
# path = getExe pkgs.texlab;
# };
# };
tinymist = {
binary = {
arguments = [];
path = getExe pkgs.tinymist;
};
};
vscode-json-language-server = {
binary = {
path = getExe pkgs.nodePackages.vscode-json-languageserver;
};
};
yaml-language-server = {
binary = {
path = getExe pkgs.yaml-language-server;
};
};
};
telemetry = {
diagnostics = false;
metrics = false;
};
};
};
}
+37 -9
View File
@@ -1,11 +1,39 @@
{
imports = [
# ./common
./cosmic
./dms
./gnome
./hyprland
./niri
./plasma
];
config,
inputs,
lib,
osConfig,
perSystem,
pkgs,
...
}:
with lib; let
cfg = config.desktop;
in {
imports =
[
# ./common
./cosmic
# ./dms
# ./gnome
./hyprland
./niri
./plasma
]
++ (with inputs; [
dms.homeModules.dankMaterialShell.default
dms.homeModules.dankMaterialShell.niri
]);
options = {
desktop.dms.enable = mkEnableOption "enable DankMaterialShell";
desktop.gnome.enable = mkEnableOption "enable gnome desktop";
};
config = let
importWithArgs = file: import file {inherit config inputs lib perSystem pkgs osConfig importWithArgs;};
in
lib.mergeAttrsList [
(mkIf config.desktop.dms.enable (importWithArgs ./dms/module.nix))
# (mkIf cfg.dms.enable (importWithArgs ./dms/module.nix))
# (mkIf cfg.gnome.enable (importWithArgs ./gnome))
];
}
+10 -22
View File
@@ -1,25 +1,13 @@
{
config,
inputs,
lib,
perSystem,
pkgs,
...
}:
with lib; let
cfg = config.desktop.dms;
# inherit (config.lib.stylix) colors;
in {
imports = with inputs; [
dms.homeModules.dankMaterialShell.default
dms.homeModules.dankMaterialShell.niri
imports = [
./dconf.nix
./mimeapps.nix
./packages.nix
./programs
# ./programs/niri.nix
# ./programs/satty.nix
# ./programs/wl-kbptr.nix
./services.nix
./stylix.nix
];
options = {
desktop.dms.enable =
mkEnableOption "enable DankMaterialShell";
};
config = let
importWithArgs = file: import file {inherit config inputs lib perSystem pkgs importWithArgs;};
in
mkIf cfg.enable (importWithArgs ./config);
}
@@ -7,17 +7,10 @@ lib.mkMerge [
(import ./dconf.nix)
(importWithArgs ./mimeapps.nix)
(importWithArgs ./packages.nix)
(import ./programs/dms.nix)
(importWithArgs ./programs/niri.nix)
(import ./programs/satty.nix)
(importWithArgs ./programs/wl-kbptr.nix)
(importWithArgs ./services.nix)
(importWithArgs ./stylix.nix)
{
programs.dankMaterialShell = {
enable = true;
systemd.enable = true;
niri.enableKeybinds = false; # Automatic keybinding configuration
# niri.enableSpawn = true; # Auto-start DMS with niri
};
}
]
@@ -1,5 +1,6 @@
{
imports = [
./dms.nix
./niri.nix
./satty.nix
./wl-kbptr.nix
@@ -0,0 +1,8 @@
{
programs.dankMaterialShell = {
enable = true;
systemd.enable = true;
niri.enableKeybinds = false; # Automatic keybinding configuration
# niri.enableSpawn = true; # Auto-start DMS with niri
};
}
@@ -3,6 +3,7 @@
lib,
pkgs,
perSystem,
osConfig,
...
}:
with lib; let
@@ -53,7 +54,14 @@ in {
keyboard = {
xkb = {
layout = "us,ua";
variant = "colemak_dh_ortho,";
variant =
"colemak_dh"
+ (
if osConfig.module.host.name == "dunamis"
then "_ortho"
else ""
)
+ ",";
};
repeat-delay = 200;
repeat-rate = 50;
@@ -9,7 +9,7 @@
enable = true;
components = ["secrets"];
};
kanshi = import ../../niri/services/kanshi;
kanshi = import ../niri/services/kanshi;
udiskie = {
enable = true;
automount = false;
+218 -241
View File
@@ -6,277 +6,254 @@
...
}:
with lib; let
cfg = config.desktop.gnome;
inherit (config.lib.stylix) colors;
getColorCh = colorName: channel: config.lib.stylix.colors."${colorName}-rgb-${channel}";
rgb = color: ''rgb(${getColorCh color "r"}, ${getColorCh color "g"}, ${getColorCh color "b"})'';
in {
options = {
desktop.gnome.enable =
mkEnableOption "enable gnome desktop";
home.packages =
(with pkgs.gnomeExtensions; [
alphabetical-app-grid
app-icons-taskbar
appindicator
caffeine
# gnome-bedtime
quick-lang-switch
removable-drive-menu
space-bar
tactile
vicinae
window-is-ready-remover
])
++ (with pkgs; [
# regular packages
junction
celluloid
mission-center
dconf
pwvucontrol
wl-clipboard
]);
programs.gnome-shell.extensions = [
{package = pkgs.gnomeExtensions.alphabetical-app-grid;}
{package = pkgs.gnomeExtensions.app-icons-taskbar;}
{package = pkgs.gnomeExtensions.appindicator;}
{package = pkgs.gnomeExtensions.caffeine;}
# {package = pkgs.gnomeExtensions.gnome-bedtime;}
{package = pkgs.gnomeExtensions.quick-lang-switch;}
{package = pkgs.gnomeExtensions.removable-drive-menu;}
{package = pkgs.gnomeExtensions.space-bar;}
{package = pkgs.gnomeExtensions.tactile;}
{package = pkgs.gnomeExtensions.vicinae;}
{package = pkgs.gnomeExtensions.window-is-ready-remover;}
];
gtk = {
enable = true;
};
config = mkIf cfg.enable {
home.packages =
(with pkgs.gnomeExtensions; [
alphabetical-app-grid
app-icons-taskbar
appindicator
caffeine
# gnome-bedtime
quick-lang-switch
removable-drive-menu
space-bar
tactile
vicinae
window-is-ready-remover
])
++ (with pkgs; [
# regular packages
junction
celluloid
mission-center
dconf
pwvucontrol
wl-clipboard
]);
programs.gnome-shell.extensions = [
{package = pkgs.gnomeExtensions.alphabetical-app-grid;}
{package = pkgs.gnomeExtensions.app-icons-taskbar;}
{package = pkgs.gnomeExtensions.appindicator;}
{package = pkgs.gnomeExtensions.caffeine;}
# {package = pkgs.gnomeExtensions.gnome-bedtime;}
{package = pkgs.gnomeExtensions.quick-lang-switch;}
{package = pkgs.gnomeExtensions.removable-drive-menu;}
{package = pkgs.gnomeExtensions.space-bar;}
{package = pkgs.gnomeExtensions.tactile;}
{package = pkgs.gnomeExtensions.vicinae;}
{package = pkgs.gnomeExtensions.window-is-ready-remover;}
];
gtk = {
enable = true;
iconTheme = let
name =
if (lib.strings.hasPrefix "gruvbox" osConfig.module.stylix.theme)
then "Gruvbox-Plus-Dark"
else if config.stylix.polarity == "dark"
then "Papirus-Dark"
else "Papirus-Light";
package =
if (lib.strings.hasPrefix "gruvbox" osConfig.module.stylix.theme)
then pkgs.gruvbox-plus-icons
else if (lib.strings.hasPrefix "rose-pine" osConfig.module.stylix.theme)
then pkgs.papirus-icon-theme.override {color = "indigo";}
else if (lib.strings.hasPrefix "nord" osConfig.module.stylix.theme)
then pkgs.papirus-icon-theme.override {color = "nordic";}
else pkgs.papirus-icon-theme;
in {inherit name package;};
};
qt = {
enable = true;
platformTheme.name = lib.mkForce "gtk3";
qt = {
enable = true;
platformTheme.name = lib.mkForce "gtk3";
};
dconf.settings = with lib.hm.gvariant; {
"org/gnome/desktop/a11y/applications" = {
screen-reader-enabled = false;
};
dconf.settings = with lib.hm.gvariant; {
"org/gnome/desktop/a11y/applications" = {
screen-reader-enabled = false;
};
"org/gnome/desktop/input-sources" = {
mru-sources = [(mkTuple ["xkb" "us"])];
# sources = [(mkTuple ["xkb" "us"]) (mkTuple ["xkb" "ua"]) (mkTuple ["xkb" "us+colemak_dh"])];
xkb-options = ["terminate:ctrl_alt_bksp"];
};
"org/gnome/desktop/input-sources" = {
mru-sources = [(mkTuple ["xkb" "us"])];
# sources = [(mkTuple ["xkb" "us"]) (mkTuple ["xkb" "ua"]) (mkTuple ["xkb" "us+colemak_dh"])];
xkb-options = ["terminate:ctrl_alt_bksp"];
};
"org/gnome/desktop/interface" = {
clock-show-seconds = true;
# color-scheme = "prefer-dark";
enable-animations = false;
gtk-enable-primary-paste = false;
scaling-factor = mkUint32 1;
toolbar-style = "text";
toolkit-accessibility = false;
};
"org/gnome/desktop/interface" = {
clock-show-seconds = true;
# color-scheme = "prefer-dark";
enable-animations = false;
gtk-enable-primary-paste = false;
scaling-factor = mkUint32 1;
toolbar-style = "text";
toolkit-accessibility = false;
};
"org/gnome/desktop/peripherals/mouse" = {
accel-profile = "flat";
};
"org/gnome/desktop/peripherals/mouse" = {
accel-profile = "flat";
};
"org/gnome/desktop/peripherals/keyboard" = {
delay = 200;
repeat-interval = 50;
};
"org/gnome/desktop/peripherals/keyboard" = {
delay = 200;
repeat-interval = 50;
};
"org/gnome/desktop/peripherals/touchpad" = {
two-finger-scrolling-enabled = true;
};
"org/gnome/desktop/peripherals/touchpad" = {
two-finger-scrolling-enabled = true;
};
"org/gnome/desktop/search-providers" = {
disabled = ["org.gnome.Epiphany.desktop"];
};
"org/gnome/desktop/search-providers" = {
disabled = ["org.gnome.Epiphany.desktop"];
};
"org/gnome/desktop/wm/keybindings" = {
close = ["<Super>q"];
move-to-monitor-down = ["<Shift><Control><Super>Down"];
move-to-monitor-left = ["<Shift><Control><Super>Left"];
move-to-monitor-right = ["<Shift><Control><Super>Right"];
move-to-monitor-up = ["<Shift><Control><Super>Up"];
move-to-workspace-1 = ["<Control><Super>1"];
move-to-workspace-2 = ["<Control><Super>2"];
move-to-workspace-3 = ["<Control><Super>3"];
move-to-workspace-4 = ["<Control><Super>4"];
move-to-workspace-5 = ["<Control><Super>5"];
move-to-workspace-last = ["<Shift><Control><Super>End"];
move-to-workspace-left = ["<Control><Super>Left"];
move-to-workspace-right = ["<Control><Super>Right"];
switch-input-source = ["<Super>Space"];
switch-input-source-backward = ["<Shift><Super>Space"];
switch-to-workspace-1 = ["<Super>1"];
switch-to-workspace-2 = ["<Super>2"];
switch-to-workspace-3 = ["<Super>3"];
switch-to-workspace-4 = ["<Super>4"];
switch-to-workspace-left = ["<Shift><Super>Left"];
switch-to-workspace-right = ["<Shift><Super>Right"];
};
"org/gnome/desktop/wm/keybindings" = {
close = ["<Super>q"];
move-to-monitor-down = ["<Shift><Control><Super>Down"];
move-to-monitor-left = ["<Shift><Control><Super>Left"];
move-to-monitor-right = ["<Shift><Control><Super>Right"];
move-to-monitor-up = ["<Shift><Control><Super>Up"];
move-to-workspace-1 = ["<Control><Super>1"];
move-to-workspace-2 = ["<Control><Super>2"];
move-to-workspace-3 = ["<Control><Super>3"];
move-to-workspace-4 = ["<Control><Super>4"];
move-to-workspace-5 = ["<Control><Super>5"];
move-to-workspace-last = ["<Shift><Control><Super>End"];
move-to-workspace-left = ["<Control><Super>Left"];
move-to-workspace-right = ["<Control><Super>Right"];
switch-input-source = ["<Super>Space"];
switch-input-source-backward = ["<Shift><Super>Space"];
switch-to-workspace-1 = ["<Super>1"];
switch-to-workspace-2 = ["<Super>2"];
switch-to-workspace-3 = ["<Super>3"];
switch-to-workspace-4 = ["<Super>4"];
switch-to-workspace-left = ["<Shift><Super>Left"];
switch-to-workspace-right = ["<Shift><Super>Right"];
};
"org/gnome/desktop/wm/preferences" = {
auto-raise = true;
button-layout = "icon:close";
};
"org/gnome/desktop/wm/preferences" = {
auto-raise = true;
button-layout = "icon:close";
};
"org/gnome/epiphany" = {
ask-for-default = false;
};
"org/gnome/epiphany" = {
ask-for-default = false;
};
"org/gnome/mutter" = {
dynamic-workspaces = true;
experimental-features = ["scale-monitor-framebuffer" "xwayland-native-scaling"];
workspaces-only-on-primary = true;
};
"org/gnome/mutter" = {
dynamic-workspaces = true;
experimental-features = ["scale-monitor-framebuffer" "xwayland-native-scaling"];
workspaces-only-on-primary = true;
};
"org/gnome/nm-applet" = {
disable-connected-notifications = true;
};
"org/gnome/nm-applet" = {
disable-connected-notifications = true;
};
"org/gnome/settings-daemon/plugins/color" = {
night-light-enabled = true;
night-light-schedule-automatic = false;
};
"org/gnome/settings-daemon/plugins/color" = {
night-light-enabled = true;
night-light-schedule-automatic = false;
};
"org/gnome/shell" = {
enabled-extensions = [
"AlphabeticalAppGrid@stuarthayhurst"
"appindicatorsupport@rgcjonas.gmail.com"
"aztaskbar@aztaskbar.gitlab.com"
"caffeine@patapon.info"
"drive-menu@gnome-shell-extensions.gcampax.github.com"
"focuscontrol@itsfernn"
"gnomebedtime@ionutbortis.gmail.com"
"just-perfection-desktop@just-perfection"
"quick-lang-switch@ankostis.gmail.com"
"space-bar@luchrioh"
"switcher@landau.fi"
"tactile@lundal.io"
"user-theme@gnome-shell-extensions.gcampax.github.com"
"vicinae@dagimg-dot"
];
};
"org/gnome/shell" = {
enabled-extensions = [
"AlphabeticalAppGrid@stuarthayhurst"
"appindicatorsupport@rgcjonas.gmail.com"
"aztaskbar@aztaskbar.gitlab.com"
"caffeine@patapon.info"
"drive-menu@gnome-shell-extensions.gcampax.github.com"
"focuscontrol@itsfernn"
"gnomebedtime@ionutbortis.gmail.com"
"just-perfection-desktop@just-perfection"
"quick-lang-switch@ankostis.gmail.com"
"space-bar@luchrioh"
"switcher@landau.fi"
"tactile@lundal.io"
"user-theme@gnome-shell-extensions.gcampax.github.com"
"vicinae@dagimg-dot"
];
};
"org/gnome/shell/extensions/aztaskbar" = with lib.hm.gvariant; {
favorites = true;
icon-size = 20;
icon-style = "REGULAR";
# intellihide = true;
indicator-color-focused = rgb "base0D";
indicator-color-running = rgb "base05";
main-panel-height = mkTuple [true 32];
position-offset = 4;
prefs-visible-page = "";
show-apps-button = mkTuple [false 0];
show-panel-activities-button = true;
show-weather-by-clock = "LEFT";
taskbar-spacing = 2;
};
"org/gnome/shell/extensions/aztaskbar" = with lib.hm.gvariant; {
favorites = true;
icon-size = 20;
icon-style = "REGULAR";
# intellihide = true;
indicator-color-focused = rgb "base0D";
indicator-color-running = rgb "base05";
main-panel-height = mkTuple [true 32];
position-offset = 4;
prefs-visible-page = "";
show-apps-button = mkTuple [false 0];
show-panel-activities-button = true;
show-weather-by-clock = "LEFT";
taskbar-spacing = 2;
};
"org/gnome/shell/extensions/caffeine" = {
indicator-position-max = 1;
};
"org/gnome/shell/extensions/caffeine" = {
indicator-position-max = 1;
};
# "org/gnome/shell/extensions/bedtime-mode" = {
# bedtime-mode-active = false;
# color-tone-preset = "grayscale";
# ondemand-button-location = "'menu'";
# };
# "org/gnome/shell/extensions/bedtime-mode" = {
# bedtime-mode-active = false;
# color-tone-preset = "grayscale";
# ondemand-button-location = "'menu'";
# };
"org/gnome/shell/extensions/focuscontrol" = {
border-color = "'rgba(0,0,0,0)'";
border-width = 1;
corner-radius = 0;
focus-down = "['<Super>Down']";
focus-left = "['<Super>Left']";
focus-right = "['<Super>Right']";
focus-up = "['<Super>Up']";
highlight-duration = 1;
};
"org/gnome/shell/extensions/focuscontrol" = {
border-color = "'rgba(0,0,0,0)'";
border-width = 1;
corner-radius = 0;
focus-down = "['<Super>Down']";
focus-left = "['<Super>Left']";
focus-right = "['<Super>Right']";
focus-up = "['<Super>Up']";
highlight-duration = 1;
};
"org/gnome/shell/extensions/space-bar/appearance" = {
active-workspace-background-color = "rgba(0,0,0,0)";
inactive-workspace-background-color = "rgba(0,0,0,0)";
active-workspace-text-color = rgb "base05";
inactive-workspace-text-color = rgb "base03";
};
"org/gnome/shell/extensions/space-bar/appearance" = {
active-workspace-background-color = "rgba(0,0,0,0)";
inactive-workspace-background-color = "rgba(0,0,0,0)";
active-workspace-text-color = rgb "base05";
inactive-workspace-text-color = rgb "base03";
};
"org/gnome/shell/extensions/space-bar/behavior" = {
always-show-numbers = false;
custom-label-named = "{{number}}";
custom-label-unnamed = "{{number}}";
enable-custom-label = true;
indicator-style = "workspaces-bar";
position = "right";
position-index = 0;
show-empty-workspaces = false;
smart-workspace-names = false;
system-workspace-indicator = false;
};
"org/gnome/shell/extensions/space-bar/behavior" = {
always-show-numbers = false;
custom-label-named = "{{number}}";
custom-label-unnamed = "{{number}}";
enable-custom-label = true;
indicator-style = "workspaces-bar";
position = "right";
position-index = 0;
show-empty-workspaces = false;
smart-workspace-names = false;
system-workspace-indicator = false;
};
"org/gnome/shell/extensions/tactile" = {
background-color = "#${colors.base00}";
border-color = "#${colors.base0D}";
text-color = "#${colors.base05}";
border-size = 3;
col-3 = 0;
gap-size = 6;
layout-2-col-1 = 1;
layout-2-row-2 = 0;
layout-3-col-1 = 2;
layout-3-col-2 = 1;
layout-3-col-3 = 0;
layout-3-row-2 = 0;
monitor-1-layout = 3;
tile-0-2 = ["z"];
tile-1-1 = ["r"];
tile-1-2 = ["x"];
tile-2-0 = ["f"];
tile-2-1 = ["s"];
tile-2-2 = ["c"];
tile-3-0 = ["p"];
tile-3-1 = ["t"];
tile-3-2 = ["d"];
};
"org/gnome/shell/extensions/tactile" = {
background-color = "#${colors.base00}";
border-color = "#${colors.base0D}";
text-color = "#${colors.base05}";
border-size = 3;
col-3 = 0;
gap-size = 6;
layout-2-col-1 = 1;
layout-2-row-2 = 0;
layout-3-col-1 = 2;
layout-3-col-2 = 1;
layout-3-col-3 = 0;
layout-3-row-2 = 0;
monitor-1-layout = 3;
tile-0-2 = ["z"];
tile-1-1 = ["r"];
tile-1-2 = ["x"];
tile-2-0 = ["f"];
tile-2-1 = ["s"];
tile-2-2 = ["c"];
tile-3-0 = ["p"];
tile-3-1 = ["t"];
tile-3-2 = ["d"];
};
"org/gnome/shell/extensions/vicinae" = {
show-status-indicator = false;
};
"org/gnome/shell/extensions/vicinae" = {
show-status-indicator = false;
};
"org/gnome/software" = {
download-updates = false;
download-updates-notify = false;
first-run = false;
};
"org/gnome/software" = {
download-updates = false;
download-updates-notify = false;
first-run = false;
};
"org/gnome/tweaks" = {
show-extensions-notice = false;
};
"org/gnome/tweaks" = {
show-extensions-notice = false;
};
};
}
@@ -1,6 +0,0 @@
{
imports = [
./joshuto.nix
./yazi.nix
];
}
-292
View File
@@ -1,292 +0,0 @@
{
pkgs,
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.console.joshuto;
in {
options = {
console.joshuto.enable =
mkEnableOption "enable joshuto file manager";
};
config =
# let
# test = pkgs.writeShellApplication {
# name = "upgrade";
# text = ''
# IFS=$'\n'
# # Security measures:
# # * noclobber prevents you from overwriting a file with `>`
# # * noglob prevents expansion of wild cards
# # * nounset causes bash to fail if an undeclared variable is used (e.g. typos)
# # * pipefail causes a pipeline to fail also if a command other than the last one fails
# set -o noclobber -o noglob -o nounset -o pipefail
# # Enable exiftool large file support
# shopt -s expand_aliases
# alias exiftool='exiftool -api largefilesupport=1'
# FILE_PATH=""
# PREVIEW_WIDTH=10
# PREVIEW_HEIGHT=10
# while [ "$#" -gt 0 ]; do
# case "$1" in
# "--path")
# shift
# FILE_PATH="$1"
# ;;
# "--preview-width")
# shift
# PREVIEW_WIDTH="$1"
# ;;
# "--preview-height")
# shift
# PREVIEW_HEIGHT="$1"
# ;;
# esac
# shift
# done
# handle_extension() {
# case "\$\{FILE_EXTENSION_LOWER}" in
# ## Archive
# a | ace | alz | arc | arj | bz | bz2 | cab | cpio | deb | gz | jar | lha | lz | lzh | lzma | lzo | \
# rpm | rz | t7z | tar | tbz | tbz2 | tgz | tlz | txz | tZ | tzo | war | xpi | xz | Z | zip)
# atool --list -- "\$\{FILE_PATH}" && exit 0
# bsdtar --list --file "\$\{FILE_PATH}" && exit 0
# exit 1
# ;;
# rar)
# ## Avoid password prompt by providing empty password
# unrar lt -p- -- "\$\{FILE_PATH}" && exit 0
# exit 1
# ;;
# 7z)
# ## Avoid password prompt by providing empty password
# 7z l -p -- "\$\{FILE_PATH}" && exit 0
# exit 1
# ;;
# ## PDF
# pdf)
# ## Preview as text conversion
# pdftotext -l 10 -nopgbrk -q -- "\$\{FILE_PATH}" - |
# fmt -w "\$\{PREVIEW_WIDTH}" && exit 0
# mutool draw -F txt -i -- "\$\{FILE_PATH}" 1-10 |
# fmt -w "\$\{PREVIEW_WIDTH}" && exit 0
# exiftool "\$\{FILE_PATH}" && exit 0
# exit 1
# ;;
# ## BitTorrent
# torrent)
# transmission-show -- "\$\{FILE_PATH}" && exit 0
# exit 1
# ;;
# ## OpenDocument
# odt | sxw)
# ## Preview as text conversion
# odt2txt "\$\{FILE_PATH}" && exit 0
# ## Preview as markdown conversion
# pandoc -s -t markdown -- "\$\{FILE_PATH}" && exit 0
# exit 1
# ;;
# ods | odp)
# ## Preview as text conversion (unsupported by pandoc for markdown)
# odt2txt "\$\{FILE_PATH}" && exit 0
# exit 1
# ;;
# ## XLSX
# xlsx)
# ## Preview as csv conversion
# ## Uses: https://github.com/dilshod/xlsx2csv
# xlsx2csv -- "\$\{FILE_PATH}" && exit 0
# exit 1
# ;;
# ## HTML
# htm | html | xhtml)
# ## Preview as text conversion
# w3m -dump "\$\{FILE_PATH}" && exit 0
# lynx -dump -- "\$\{FILE_PATH}" && exit 0
# elinks -dump "\$\{FILE_PATH}" && exit 0
# pandoc -s -t markdown -- "\$\{FILE_PATH}" && exit 0
# bat --color=always --paging=never \
# --style=plain \
# --terminal-width="\$\{PREVIEW_WIDTH}" \
# "\$\{FILE_PATH}" && exit 0
# ;;
# ## JSON
# json | ipynb)
# jq --color-output . "\$\{FILE_PATH}" && exit 0
# python -m json.tool -- "\$\{FILE_PATH}" && exit 0
# bat --color=always --paging=never \
# --style=plain \
# --terminal-width="\$\{PREVIEW_WIDTH}" \
# "\$\{FILE_PATH}" && exit 0
# ;;
# ## Direct Stream Digital/Transfer (DSDIFF) and wavpack aren't detected
# ## by file(1).
# dff | dsf | wv | wvc)
# mediainfo "\$\{FILE_PATH}" && exit 0
# exiftool "\$\{FILE_PATH}" && exit 0
# ;; # Continue with next handler on failure
# esac
# }
# handle_mime() {
# local mimetype="\$\{1}"
# case "\$\{mimetype}" in
# ## RTF and DOC
# text/rtf | *msword)
# ## Preview as text conversion
# ## note: catdoc does not always work for .doc files
# ## catdoc: http://www.wagner.pp.ru/~vitus/software/catdoc/
# catdoc -- "\$\{FILE_PATH}" && exit 0
# exit 1
# ;;
# ## DOCX, ePub, FB2 (using markdown)
# ## You might want to remove "|epub" and/or "|fb2" below if you have
# ## uncommented other methods to preview those formats
# *wordprocessingml.document | */epub+zip | */x-fictionbook+xml)
# ## Preview as markdown conversion
# pandoc -s -t markdown -- "\$\{FILE_PATH}" | bat -l markdown \
# --color=always --paging=never \
# --style=plain \
# --terminal-width="\$\{PREVIEW_WIDTH}" && exit 0
# exit 1
# ;;
# ## E-mails
# message/rfc822)
# ## Parsing performed by mu: https://github.com/djcb/mu
# mu view -- "\$\{FILE_PATH}" && exit 0
# exit 1
# ;;
# ## XLS
# *ms-excel)
# ## Preview as csv conversion
# ## xls2csv comes with catdoc:
# ## http://www.wagner.pp.ru/~vitus/software/catdoc/
# xls2csv -- "\$\{FILE_PATH}" && exit 0
# exit 1
# ;;
# ## Text
# text/* | */xml)
# bat --color=always --paging=never \
# --style=plain \
# --terminal-width="\$\{PREVIEW_WIDTH}" \
# "\$\{FILE_PATH}" && exit 0
# cat "\$\{FILE_PATH}" && exit 0
# exit 1
# ;;
# ## DjVu
# image/vnd.djvu)
# ## Preview as text conversion (requires djvulibre)
# djvutxt "\$\{FILE_PATH}" | fmt -w "\$\{PREVIEW_WIDTH}" && exit 0
# exiftool "\$\{FILE_PATH}" && exit 0
# exit 1
# ;;
# ## Image
# image/*)
# ## Preview as text conversion
# exiftool "\$\{FILE_PATH}" && exit 0
# exit 1
# ;;
# ## Video and audio
# video/* | audio/*)
# mediainfo "\$\{FILE_PATH}" && exit 0
# exiftool "\$\{FILE_PATH}" && exit 0
# exit 1
# ;;
# esac
# }
# FILE_EXTENSION="\$\{FILE_PATH##*.}"
# FILE_EXTENSION_LOWER="$(printf "%s" "\$\{FILE_EXTENSION}" | tr '[:upper:]' '[:lower:]')"
# handle_extension
# MIMETYPE="$(file --dereference --brief --mime-type -- "\$\{FILE_PATH}")"
# handle_mime "\$\{MIMETYPE}"
# exit 1
# '';
# };
# in
mkIf cfg.enable {
home.packages = [pkgs.file];
programs.joshuto = {
enable = true; # file manager in rust
settings = {
mouse_support = true;
focus_on_create = true;
use_trash = true;
watch_files = true;
xdg_open = true;
xdg_open_fork = true;
case_insensitive_ext = false;
# zoxide_update = true;
display = {
mode = "minimal";
show_icons = true;
column_ratio = [1 5 2];
};
preview = {
# preview_script = getExe pkgs.pistol;
use_xdg_thumbs = true;
xdg_thumb_size = "xxlarge";
};
};
mimetype = {
class = {
text_default = [
{
command = "hx";
}
];
};
extension = {
build."inherit" = "text_default";
c."inherit" = "text_default";
cmake."inherit" = "text_default";
conf."inherit" = "text_default";
cpp."inherit" = "text_default";
css."inherit" = "text_default";
csv."inherit" = "text_default";
cu."inherit" = "text_default";
ebuild."inherit" = "text_default";
eex."inherit" = "text_default";
env."inherit" = "text_default";
ex."inherit" = "text_default";
exs."inherit" = "text_default";
go."inherit" = "text_default";
h."inherit" = "text_default";
hpp."inherit" = "text_default";
hs."inherit" = "text_default";
html."inherit" = "text_default";
ini."inherit" = "text_default";
java."inherit" = "text_default";
js."inherit" = "text_default";
json."inherit" = "text_default";
kt."inherit" = "text_default";
log."inherit" = "text_default";
lua."inherit" = "text_default";
md."inherit" = "text_default";
micro."inherit" = "text_default";
ninja."inherit" = "text_default";
nix."inherit" = "text_default";
norg."inherit" = "text_default";
org."inherit" = "text_default";
py."inherit" = "text_default";
rkt."inherit" = "text_default";
rs."inherit" = "text_default";
scss."inherit" = "text_default";
sh."inherit" = "text_default";
srt."inherit" = "text_default";
svelte."inherit" = "text_default";
toml."inherit" = "text_default";
tsx."inherit" = "text_default";
txt."inherit" = "text_default";
vim."inherit" = "text_default";
xml."inherit" = "text_default";
yaml."inherit" = "text_default";
yml."inherit" = "text_default";
};
mimetype = {
text = {"inherit" = "text_default";};
};
};
};
};
}
-117
View File
@@ -1,117 +0,0 @@
{
pkgs,
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption getExe;
cfg = config.console.yazi;
in {
options = {
console.yazi.enable =
mkEnableOption "enable yazi file manager";
};
config = mkIf cfg.enable {
programs.yazi = {
enable = true; # file manager in rust
enableNushellIntegration = true;
shellWrapperName = "y";
settings = {
opener = {
open = [
{
run = "xdg-open \"$@\"";
orphan = true;
desc = "Open";
}
];
edit = [
{
run = "$EDITOR \"$@\"";
block = true;
desc = "Edit";
}
];
dragdrop = [
{
run = "${getExe pkgs.ripdrag} -ab \"$@\"";
desc = "Drag'n'drop";
orphan = true;
for = "unix";
}
];
};
open.rules = [
{
mime = "text/*";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.json";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.yaml";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.yml";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.toml";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.sh";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.ini";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.conf";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.csv";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.go";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.html";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.c";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.cpp";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.rs";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.nix";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.py";
use = ["edit" "open" "dragdrop"];
}
{
name = "*";
use = ["open" "edit" "dragdrop"];
}
];
};
};
};
}
-4
View File
@@ -1,9 +1,5 @@
{
imports = [
./console
./editor
./shell
./terminal
./syncthing.nix
./wl-kbptr.nix
];
-8
View File
@@ -1,8 +0,0 @@
{
imports = [
./helix.nix
./zed.nix
# ./neve.nix
#./nixvim.nix
];
}
-187
View File
@@ -1,187 +0,0 @@
{
pkgs,
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption getExe;
cfg = config.editor.helix;
in {
options = {
editor.helix.enable =
mkEnableOption "enable helix editor";
};
config = mkIf cfg.enable {
programs.helix = {
enable = true; # vim-like editor in rust
defaultEditor = true;
settings = {
editor = {
bufferline = "multiple";
cursorline = true;
inline-diagnostics.cursor-line = "warning";
line-number = "relative";
lsp = {
display-messages = true;
display-inlay-hints = true;
};
cursor-shape = {
insert = "bar";
normal = "block";
select = "underline";
};
statusline = {
left = ["mode" "spinner" "version-control"];
center = ["file-name"];
right = ["diagnostics" "selections" "position" "file-encoding" "file-line-ending" "file-type"];
separator = "|";
};
soft-wrap = {
enable = true;
max-wrap = 25;
max-indent-retain = 0;
wrap-indicator = "";
};
};
keys = {
insert.C-c = "normal_mode";
normal = {
esc = ["collapse_selection" "keep_primary_selection"];
space = {
space = "file_picker";
w = ":w";
q = ":q";
x = ":x";
n = ":n";
"," = "goto_previous_buffer";
"." = "goto_next_buffer";
l = ":reflow";
};
};
};
};
languages = {
language-server = {
# markdown-oxide.command = getExe pkgs.markdown-oxide;
# nixd.command = getExe pkgs.nixd;
# pyright = {
# command = getExe pkgs.pyright;
# args = ["-"];
# };
# rust-analyzer.command = getExe pkgs.rust-analyzer;
# texlab.command = getExe pkgs.texlab;
bash-language-server = {
command = getExe pkgs.bash-language-server;
environment = {
"SHELLCHECK_PATH" = getExe pkgs.shellcheck;
"SHFMT_PATH" = getExe pkgs.shfmt;
};
};
clangd.command = "${pkgs.clang-tools}/bin/clangd";
# fsac = {
# command = getExe pkgs.fsautocomplete;
# config = {
# editor.formatOnSave = true;
# AutomaticWorkspaceInit = true;
# FSharp.ExternalAutocomplete = true;
# FSharp.linting.fsharplint.enabled = true;
# FSharp.linting.fsharplint.configFile = "fsharplint.json";
# FSharp.formatting.fantomas.enabled = true;
# };
# };
nil = {
command = getExe pkgs.nil;
config = {
formatting.command = [(getExe pkgs.alejandra)];
};
};
ruff = {
command = getExe pkgs.ruff;
args = ["server"];
};
tinymist.command = getExe pkgs.tinymist;
vscode-json-language-server.command = getExe pkgs.nodePackages.vscode-json-languageserver;
yaml-language-server.command = getExe pkgs.yaml-language-server;
zk = {
command = getExe pkgs.zk;
args = ["lsp"];
};
};
language = [
{
name = "nix";
auto-format = true;
language-servers = ["nil"];
}
{
name = "typst";
auto-format = true;
formatter.command = getExe pkgs.typstyle;
language-servers = ["tinymist"];
}
{
name = "markdown";
# auto-format = true;
language-servers = ["zk" "markdown-oxide"];
}
{
name = "c";
auto-format = true;
# formatter.command = "${pkgs.clang-tools}/bin/clang-format";
}
{
name = "cpp";
auto-format = true;
# formatter.command = "${pkgs.clang-tools}/bin/clang-format";
}
# {
# name = "fsharp";
# auto-format = true;
# language-servers = ["fsac"];
# scope = "source.fs";
# roots = ["fsproj" "sln" ".git"];
# }
# {
# name = "rust";
# auto-format = true;
# language-servers = ["rust-analyzer"];
# formatter.command = getExe pkgs.rustfmt;
# }
{
name = "json";
auto-format = true;
formatter.command = getExe pkgs.jq;
language-servers = ["vscode-json-language-server"];
}
{
name = "yaml";
auto-format = true;
formatter.command = getExe pkgs.yamlfmt;
formatter.args = ["-"];
language-servers = ["yaml-language-server"];
}
{
name = "bash";
auto-format = true;
# formatter.command = getExe pkgs.shfmt;
# formatter.args = ["-"];
}
{
name = "python";
auto-format = true;
language-servers = [
{
name = "ruff";
# only-features = ["format" "diagnostics"];
}
# {
# name = "pyright";
# except-features = ["format" "diagnostics"];
# }
];
}
];
};
};
};
}
-31
View File
@@ -1,31 +0,0 @@
{
pkgs,
lib,
inputs,
config,
...
}:
with lib; let
cfg = config.editor.neve;
in {
imports = [
inputs.nixvim.homeManagerModules.nixvim
];
options = {
editor.neve.enable =
mkEnableOption "enable neve neovim distribution";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
neovide
cpplint
statix
];
programs.nixvim = {
enable = true;
imports = [inputs.neve.nixvimModule];
viAlias = true;
vimAlias = true;
};
};
}
-271
View File
@@ -1,271 +0,0 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib) mkIf mkEnableOption;
in {
options = {
editor.neovim.enable =
mkEnableOption "enable neovim text editor";
};
config = mkIf config.editors.neovim.enable {
# stylix.targets.nixvim.enable = true;
home.packages = with pkgs; [neovide];
programs.nixvim = {
enable = true;
enableMan = true;
# package = ;
plugins.lualine.enable = true;
plugins.treesitter = {
enable = true;
folding = true;
};
plugins = {
yazi.enable = true;
noice = {
enable = true;
popupmenu.backend = "nui";
};
notify.enable = true;
telescope.enable = true;
transparent.enable = true;
lsp-format.enable = true;
lsp-lines.enable = true;
lsp-status.enable = true;
which-key.enable = true;
web-devicons.enable = true;
# vimtex = {
# enable = true;
# texlivePackage = pkgs.tectonic; #pkgs.texlive.combined.scheme-full;
# settings = {
# compiler_method = "tectonic";
# view_method = "zathura_simple";
# compiler_tectonic = {
# "aux_dir" = {};
# "out_dir" = {};
# "callback" = 1;
# "continuous" = 0;
# "executable" = "latexmk";
# "hooks" = {};
# "options" = [
# "--synctex"
# "--keep-logs"
# "-Z shell-escape"
# "-Z continue-on-errors"
# ];
# };
# compiler_latexmk = {
# "aux_dir" = {};
# "out_dir" = {};
# "callback" = 1;
# "continuous" = 0;
# "executable" = "latexmk";
# "hooks" = {};
# "options" = [
# "-xelatex"
# "-recorder"
# "-file-line-error"
# "-synctex=1"
# "-interaction=nonstopmode"
# "-shell-escape"
# ];
# };
# };
# };
treesitter-textobjects.enable = true;
cmp-latex-symbols.enable = true;
dap.enable = true;
rustaceanvim.enable = true;
lsp = {
enable = true;
servers = {
clangd.enable = true;
#rust_analyzer = {
# enable = true;
# installRustc = true;
# installCargo = true;
#};
lua_ls.enable = true;
nil_ls.enable = true;
};
};
};
plugins = {
cmp-nvim-lsp = {enable = true;}; # lsp
cmp-buffer = {enable = true;};
cmp-path = {enable = true;}; # file system paths
cmp_luasnip = {enable = true;}; # snippets
cmp-cmdline = {enable = true;}; # autocomplete for cmdline
cmp = {
enable = true;
autoEnableSources = true;
settings = {
sources = [
{name = "nvim_lsp";}
{name = "path";}
{name = "buffer";}
];
mapping = {
"<C-Space>" = "cmp.mapping.complete()";
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
"<C-e>" = "cmp.mapping.close()";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<CR>" = "cmp.mapping.confirm({ select = true })";
"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
};
experimental = {
ghost_text = true;
};
};
};
luasnip = {
enable = true;
settings = {
enable_autosnippets = true;
store_selection_keys = "<Tab>";
};
};
};
clipboard = {
providers.wl-copy.enable = true;
};
globals.mapleader = " ";
globals.maplocalleader = ",";
opts = {
# Show line numbers
number = true;
# Show relative line numbers
relativenumber = true;
# Use the system clipboard
clipboard = "unnamedplus";
# Number of spaces that represent a <TAB>
tabstop = 2;
softtabstop = 2;
# Show tabline always
showtabline = 2;
# Use spaces instead of tabs
expandtab = true;
# Enable smart indentation
smartindent = true;
# Number of spaces to use for each step of (auto)indent
shiftwidth = 2;
# Enable break indent
breakindent = true;
# Highlight the screen line of the cursor
cursorline = true;
# Minimum number of screen lines to keep above and below the cursor
scrolloff = 8;
# Enable mouse support
mouse = "a";
# Set folding method to manual
foldmethod = "manual";
# Disable folding by default
foldenable = false;
# Wrap long lines at a character in 'breakat'
linebreak = true;
# Disable spell checking
spell = false;
# Disable swap file creation
swapfile = false;
# Time in milliseconds to wait for a mapped sequence to complete
timeoutlen = 300;
# Enable 24-bit RGB color in the TUI
termguicolors = true;
# Don't show mode in the command line
showmode = false;
# Open new split below the current window
splitbelow = true;
# Keep the screen when splitting
splitkeep = "screen";
# Open new split to the right of the current window
splitright = true;
# Hide command line unless needed
cmdheight = 0;
# Remove EOB
fillchars = {
eob = " ";
};
};
keymaps = [
{
mode = "n";
key = "j";
action = "gj";
}
{
mode = "n";
key = "k";
action = "gk";
}
{
mode = "n";
key = "n";
action = "nzzzv";
}
{
mode = "n";
key = "N";
action = "Nzzzv";
}
{
mode = "n";
key = "<C-d>";
action = "<C-d>zz";
}
{
mode = "n";
key = "<C-u>";
action = "<C-u>zz";
}
{
mode = "n";
key = "<leader>yy";
action = "<cmd>Yazi<cr>";
options = {desc = "open yazi";};
}
{
mode = "n";
key = "<leader>fo";
action = "<cmd>Telescope oldfiles<cr>";
options = {desc = "Telescope oldfiles";};
}
{
mode = "n";
key = "<leader>ff";
action = "<cmd>Telescope find_files<cr>";
options = {desc = "Telescope find files";};
}
];
};
};
}
-158
View File
@@ -1,158 +0,0 @@
{
config,
pkgs,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption mkForce getExe;
cfg = config.editor.zed;
in {
options = {
editor.zed.enable =
mkEnableOption "enable zed editor";
};
config = mkIf cfg.enable {
programs.zed-editor = {
enable = true;
extensions = [
"bash"
"fsharp"
"justfile"
"nix"
"typst"
];
userSettings = {
vim_mode = true;
ui_font_size = mkForce 16;
buffer_font_size = mkForce 16;
# features = {inline_completion_provider = "none";};
auto_update = false;
languages = {
"FSharp" = {
language-servers = [
"fsautocomplete"
];
};
"Nix" = {
language-servers = [
"nil"
];
# formatter = {
# external.command = getExe pkgs.alejandra;
# };
};
# "Rust" = {
# formatter = {
# external = {
# command = getExe pkgs.rustfmt;
# arguments = ["--edition" "2021"];
# };
# };
# };
"typst" = {
language-servers = ["tinymist"];
format_on_save = "on";
# formatter = {
# external = {
# command = getExe pkgs.typstyle;
# arguments = ["-i" "{buffer_path}"];
# };
# };
};
"Python" = {
format_on_save = "on";
formatter = [
{
language_server = {
name = "ruff";
};
}
];
language_servers = ["ruff"];
};
};
lsp = {
bash-language-server = {
binary = {
path = getExe pkgs.bash-language-server;
env = {
"SHELLCHECK_PATH" = getExe pkgs.shellcheck;
"SHFMT_PATH" = getExe pkgs.shfmt;
};
};
};
fsautocomplete = {
binary = {
path = getExe pkgs.fsautocomplete;
};
settings = {
AutomaticWorkspaceInit = true;
FSharp.ExternalAutocomplete = true;
FSharp.linting.fsharplint.enabled = true;
FSharp.linting.fsharplint.configFile = "fsharplint.json";
FSharp.formatting.fantomas.enabled = true;
};
};
clangd = {
binary = {
arguments = [];
path = "${pkgs.clang-tools}/bin/clangd";
};
};
# rust-analyzer = {
# binary = {
# arguments = [];
# path = getExe pkgs.rust-analyzer;
# };
# };
ruff = {
binary = {
arguments = [];
path = getExe pkgs.ruff;
};
};
# nixd = {
# binary = {
# arguments = [];
# path = getExe pkgs.nixd;
# };
# initialization_options.formatting.command = [(getExe pkgs.alejandra)];
# };
nil = {
binary = {
arguments = [];
path = getExe pkgs.nil;
};
settings.formatting.command = [(getExe pkgs.alejandra)];
};
# texlab = {
# binary = {
# arguments = [];
# path = getExe pkgs.texlab;
# };
# };
tinymist = {
binary = {
arguments = [];
path = getExe pkgs.tinymist;
};
};
vscode-json-language-server = {
binary = {
path = getExe pkgs.nodePackages.vscode-json-languageserver;
};
};
yaml-language-server = {
binary = {
path = getExe pkgs.yaml-language-server;
};
};
};
telemetry = {
diagnostics = false;
metrics = false;
};
};
};
};
}
-3
View File
@@ -1,3 +0,0 @@
{
imports = [./nushell.nix ./fish.nix ./oh-my-posh.nix];
}
-51
View File
@@ -1,51 +0,0 @@
{
config,
pkgs,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption getExe;
cfg = config.shell.fish;
in {
options = {
shell.fish.enable =
mkEnableOption "enable fish";
};
config = mkIf cfg.enable {
programs = {
atuin = {
enable = true;
flags = [
"--disable-up-arrow"
];
};
fish = {
enable = true; # friendly interactive shell in rust
shellAliases = {
cd = "z";
ed = "$EDITOR";
jf = "jj-fzf"; # think of jeff
jo = "joshuto"; # think of josh
l = "ls -lah";
la = "ls -ah";
ll = "ls -lh";
p = "pueue";
s = "systemctl";
stui = "systemctl-tui";
};
shellAbbrs = {
pa = "pueue add --";
pl = "pueue log";
};
interactiveShellInit = ''
bind \e\[3\;5~ kill-word
bind \cH backward-kill-word
set fish_greeting
set fish_cursor_default block blink
# ${getExe pkgs.bat-extras.batman} --export-env | source
if test -e ~/.profile; source ~/.profile; end
'';
};
};
};
}
-74
View File
@@ -1,74 +0,0 @@
{
# pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.shell.nushell;
in {
options = {
shell.nushell.enable =
mkEnableOption "enable nushell";
};
config = mkIf cfg.enable {
programs = {
eza.enableNushellIntegration = false;
atuin = {
enable = false;
enableNushellIntegration = true;
flags = [
"--disable-up-arrow"
];
};
carapace.enable = true;
nushell = {
enable = true;
environmentVariables = {
CARAPACE_BRIDGES = "fish";
CARAPACE_MATCH = 1;
EDITOR = "hx";
};
shellAliases = {
cd = "z";
# ed = "$env.EDITOR";
jf = "jj-fzf"; # think of jeff
jo = "joshuto"; # think of josh
l = "ls -la";
la = "ls -a";
ll = "ls -l";
nix-shell = "nix-shell --command nu";
p = "pueue";
s = "systemctl";
};
extraConfig = ''
$env.config = {
show_banner: false
shell_integration: {
osc2: true
osc7: true
osc8: true
osc9_9: false
osc133: true
osc633: true
reset_application_mode: true
}
ls: {
use_ls_colors: true
clickable_links: true
}
rm: {
always_trash: true
}
completions: {
case_sensitive: false
quick: true
partial: true
algorithm: "fuzzy"
}
}
'';
};
};
};
}
-132
View File
@@ -1,132 +0,0 @@
{
config,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.shell.oh-my-posh;
in {
options = {
shell.oh-my-posh.enable =
mkEnableOption "enable oh my posh";
};
config = mkIf cfg.enable {
programs.oh-my-posh = {
enable = true;
settings = {
# version = 2;
final_space = true;
shell_integration = true;
console_title_template = "{{ .Shell }} in {{ .Folder }}";
blocks = [
{
type = "prompt";
alignment = "left";
overflow = "hidden";
segments = [
{
type = "path";
style = "plain";
background = "transparent";
foreground = "blue";
template = "{{ .Path }}";
properties = {
style = "full";
};
}
{
type = "text";
style = "plain";
background = "transparent";
template = "{{ if .Env.BW_SESSION }} 󰞀{{ end }}";
}
{
type = "nix-shell";
style = "plain";
background = "transparent";
template = "{{ if ne .Type \"unknown\" }} {{ end }}";
}
{
type = "git";
style = "plain";
foreground = "p:grey";
background = "transparent";
template = " {{ .HEAD }}{{ if or (.Working.Changed) (.Staging.Changed) }}*{{ end }} <cyan>{{ if gt .Behind 0 }}{{ end }}{{ if gt .Ahead 0 }}{{ end }}</>";
properties = {
branch_icon = "";
commit_icon = "@";
fetch_status = true;
};
}
];
}
{
type = "prompt";
alignment = "right";
segments = [
{
type = "session";
style = "plain";
foreground = "white";
background = "transparent";
template = "{{ if .SSHSession }} {{ .UserName }}@{{ .HostName }}{{ end }}";
}
{
style = "plain";
foreground = "white";
background = "transparent";
properties = {
charged_icon = "󰁹";
charging_icon = "󱟡";
discharging_icon = "󱟟";
};
template = "{{ if not .Error }} {{ .Icon }} {{ .Percentage }}%{{ end }}";
type = "battery";
}
];
}
{
type = "rprompt";
overflow = "hidden";
segments = [
{
type = "executiontime";
style = "plain";
foreground = "yellow";
background = "transparent";
template = "{{.FormattedMs}}";
properties = {
threshold = 5000;
};
}
];
}
{
type = "prompt";
alignment = "left";
newline = true;
segments = [
{
type = "text";
style = "plain";
foreground_templates = ["{{if gt .Code 0}}red{{end}}" "{{if eq .Code 0}}magenta{{end}}"];
background = "transparent";
template = ">";
}
];
}
];
transient_prompt = {
foreground_templates = ["{{if gt .Code 0}}red{{end}}" "{{if eq .Code 0}}magenta{{end}}"];
background = "transparent";
template = "> ";
};
secondary_prompt = {
foreground = "magenta";
background = "transparent";
template = "-> ";
};
};
};
};
}
-75
View File
@@ -1,75 +0,0 @@
{
pkgs,
config,
lib,
...
}: {
options = {
zsh.enable =
lib.mkEnableOption "enable z shell";
};
config = lib.mkIf config.zsh.enable {
programs.zsh = {
enable = true;
dotDir = ".config/zsh";
initExtra = ''
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
'';
# promptInit = "oh-my-posh init zsh -c ~/.config/oh-my-posh/zen.toml";
enableCompletion = true;
autosuggestion.enable = true;
#autosuggestion.highlight = "fg=#ff00ff,bg=cyan,bold,underline";
shellAliases = {
ls = "eza";
cat = "bat";
cd = "z";
l = "eza -alh";
};
history = {
size = 10000;
path = "${config.xdg.dataHome}/zsh/history";
};
plugins = [
{
name = "zsh-autosuggestions";
file = "zsh-autosuggestions.plugin.zsh";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-autocomplete";
rev = "v0.7.0";
sha256 = "sha256-/6V6IHwB5p0GT1u5SAiUa20LjFDSrMo731jFBq/bnpw=";
};
}
{
name = "zsh-syntax-highlighting";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-syntax-highlighting";
rev = "0.8.0";
sha256 = "sha256-iJdWopZwHpSyYl5/FQXEW7gl/SrKaYDEtTH9cGP7iPo=";
};
}
{
name = "zsh-history-substring-search";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-history-substring-search";
rev = "v1.1.0";
sha256 = "sha256-GSEvgvgWi1rrsgikTzDXokHTROoyPRlU0FVpAoEmXG4=";
};
}
{
name = "zsh-nix-shell";
file = "nix-shell.plugin.zsin.fromh";
src = pkgs.fetchFromGitHub {
owner = "chisui";
repo = "zsh-nix-shell";
rev = "v0.8.0";
sha256 = "1lzrn0n4fxfcgg65v0qhnj7wnybybqzs4adz7xsrkgmcsr0ii8b7";
};
}
];
};
};
}
@@ -1,7 +0,0 @@
{
imports = [
./kitty.nix
./ghostty.nix
./wezterm.nix
];
}
@@ -1,26 +0,0 @@
{
config,
lib,
perSystem,
...
}:
with lib; let
cfg = config.terminal.ghostty;
in {
options = {
terminal.ghostty.enable = mkEnableOption "enable ghostty terminal";
};
config = mkIf cfg.enable {
programs.ghostty = {
enable = true;
package = perSystem.ghostty.ghostty;
settings = {
gtk-single-instance = true;
window-decoration = "client";
keybind = [
"ctrl+shift+f=close_surface"
];
};
};
};
}
-24
View File
@@ -1,24 +0,0 @@
{
config,
lib,
...
}:
with lib; let
cfg = config.terminal.kitty;
in {
options = {
terminal.kitty.enable =
mkEnableOption "enable kitty terminal";
};
config = mkIf cfg.enable {
programs.kitty = {
enable = true;
settings = {
tab_bar_edge = "bottom";
tab_bar_align = "left";
tab_bar_style = "fade";
# tab_separator = " ";
};
};
};
}
-201
View File
@@ -1,201 +0,0 @@
{
config,
# inputs,
# pkgs,
lib,
...
}:
with lib; let
cfg = config.terminal.wezterm;
in {
options = {
terminal.wezterm.enable =
mkEnableOption "enable wez's terminal";
};
config = mkIf cfg.enable {
programs.wezterm = {
enable = true;
# package = inputs.wezterm.packages.${pkgs.system}.default;
extraConfig = let
arrows = {
left = "LeftArrow";
down = "DownArrow";
up = "UpArrow";
right = "RightArrow";
};
homerow-arrows = {
left = "n";
down = "e";
up = "i";
right = "o";
};
genNavigation = keys: ''
{ key = '${keys.left}', mods = 'LEADER', action = act.ActivatePaneDirection 'Left' },
{ key = '${keys.down}', mods = 'LEADER', action = act.ActivatePaneDirection 'Down' },
{ key = '${keys.up}', mods = 'LEADER', action = act.ActivatePaneDirection 'Up' },
{ key = '${keys.right}', mods = 'LEADER', action = act.ActivatePaneDirection 'Right' },
{ key = '${keys.left}', mods = 'CTRL|SHIFT', action = act.ActivatePaneDirection 'Left' },
{ key = '${keys.down}', mods = 'CTRL|SHIFT', action = act.ActivatePaneDirection 'Down' },
{ key = '${keys.up}', mods = 'CTRL|SHIFT', action = act.ActivatePaneDirection 'Up' },
{ key = '${keys.right}', mods = 'CTRL|SHIFT', action = act.ActivatePaneDirection 'Right' },
'';
in
# lua
''
local wezterm = require 'wezterm'
local act = wezterm.action
local resurrect = wezterm.plugin.require("https://github.com/MLFlexer/resurrect.wezterm")
local workspace_switcher = wezterm.plugin.require("https://github.com/MLFlexer/smart_workspace_switcher.wezterm")
wezterm.on("augment-command-palette", function(window, pane)
local workspace_state = resurrect.workspace_state
return {
{
brief = "Window | Workspace: Switch Workspace",
icon = "md_briefcase_arrow_up_down",
action = workspace_switcher.switch_workspace(),
},
{
brief = "Window | Workspace: Rename Workspace",
icon = "md_briefcase_edit",
action = wezterm.action.PromptInputLine({
description = "Enter new name for workspace",
action = wezterm.action_callback(function(window, pane, line)
if line then
wezterm.mux.rename_workspace(wezterm.mux.get_active_workspace(), line)
resurrect.state_manager.save_state(workspace_state.get_workspace_state())
end
end),
}),
},
}
end)
return {
front_end = 'WebGpu',
unix_domains = {
{
name = 'unix',
},
},
enable_kitty_graphics = true,
window_padding = {
left = 0,
right = 0,
top = 0,
bottom = 0,
},
use_fancy_tab_bar = false,
inactive_pane_hsb = {
-- saturation = 0.8,
brightness = 0.7,
},
-- window_frame = {
-- font = wezterm.font { family = 'Cantarell', weight = 'Bold' },
-- },
disable_default_key_bindings = true,
leader = { key = 'Space', mods = 'CTRL', timeout_milliseconds = 2000 },
keys = {
{
key = "w",
mods = "LEADER",
action = resurrect.window_state.save_window_action(),
},
{
key = "t",
mods = "LEADER",
action = resurrect.tab_state.save_tab_action(),
},
{
key = "s",
mods = "LEADER",
action = wezterm.action_callback(function(win, pane)
resurrect.state_manager.save_state(resurrect.workspace_state.get_workspace_state())
resurrect.window_state.save_window_action()
end),
},
{
key = "r",
mods = "LEADER",
action = wezterm.action_callback(function(win, pane)
resurrect.fuzzy_loader.fuzzy_load(win, pane, function(id, label)
local type = string.match(id, "^([^/]+)") -- match before '/'
id = string.match(id, "([^/]+)$") -- match after '/'
id = string.match(id, "(.+)%..+$") -- remove file extention
local opts = {
relative = true,
restore_text = true,
on_pane_restore = resurrect.tab_state.default_on_pane_restore,
}
if type == "workspace" then
local state = resurrect.state_manager.load_state(id, "workspace")
resurrect.workspace_state.restore_workspace(state, opts)
elseif type == "window" then
local state = resurrect.state_manager.load_state(id, "window")
resurrect.window_state.restore_window(pane:window(), state, opts)
elseif type == "tab" then
local state = resurrect.state_manager.load_state(id, "tab")
resurrect.tab_state.restore_tab(pane:tab(), state, opts)
end
end)
end),
},
{
key = "d",
mods = "LEADER",
action = wezterm.action_callback(function(win, pane)
resurrect.fuzzy_loader.fuzzy_load(win, pane, function(id)
resurrect.state_manager.delete_state(id)
end,
{
title = "Delete State",
description = "Select State to Delete and press Enter = accept, Esc = cancel, / = filter",
fuzzy_description = "Search State to Delete: ",
is_fuzzy = true,
})
end),
},
{
key = 'p',
mods = 'LEADER',
action = wezterm.action.ActivateCommandPalette,
},
{ key = 'Enter', mods = 'SHIFT|CTRL', action = act.ActivateCopyMode },
{ key = 'R', mods = 'SHIFT|CTRL', action = act.ReloadConfiguration },
{ key = '=', mods = 'CTRL', action = act.IncreaseFontSize },
{ key = '-', mods = 'CTRL', action = act.DecreaseFontSize },
{ key = '0', mods = 'CTRL', action = act.ResetFontSize },
{ key = 'C', mods = 'SHIFT|CTRL', action = act.CopyTo 'Clipboard' },
-- { key = 'N', mods = 'SHIFT|CTRL', action = act.SpawnWindow },
{ key = 'l', mods = 'SHIFT|CTRL', action = act.CharSelect{ copy_on_select = true, copy_to = 'ClipboardAndPrimarySelection' } },
{ key = 'v', mods = 'SHIFT|CTRL', action = act.PasteFrom 'Clipboard' },
{ key = '<', mods = 'CTRL|SHIFT', action = act.ActivateTabRelative(-1) },
{ key = '>', mods = 'CTRL|SHIFT', action = act.ActivateTabRelative(1) },
{ key = 'Tab', mods = 'CTRL|SHIFT', action = act.ActivateTabRelative(-1) },
{ key = 'Tab', mods = 'CTRL', action = act.ActivateTabRelative(1) },
{ key = '%', mods = 'SHIFT|CTRL', action = act.SplitVertical { domain = 'CurrentPaneDomain' }, },
{ key = '"', mods = 'SHIFT|CTRL', action = act.SplitHorizontal { domain = 'CurrentPaneDomain' }, },
-- pane navigation
${genNavigation arrows}
${genNavigation homerow-arrows}
{ key = 't', mods = 'SHIFT|CTRL', action = act.SpawnTab 'CurrentPaneDomain' },
{ key = 'w', mods = 'SHIFT|CTRL', action = act.CloseCurrentTab{ confirm = false } },
{ key = 'f', mods = 'SHIFT|CTRL', action = act.CloseCurrentPane{ confirm = false } },
{ key = 'b', mods = 'LEADER|CTRL', action = act.SendString '\x02', },
{ key = 'Enter', mods = 'LEADER', action = act.ActivateCopyMode, },
-- { key = 'p', mods = 'LEADER', action = act.PasteFrom 'PrimarySelection', },
{ key = 'k', mods = 'SHIFT|CTRL', action = act.Multiple
{
act.ClearScrollback 'ScrollbackAndViewport',
act.SendKey { key = 'L', mods = 'CTRL' },
},
},
},
}
'';
};
};
}
+2 -2
View File
@@ -21,10 +21,10 @@ in {
};
sound.pipewire.enable = true;
nixpkgs.overlays = [inputs.niri.overlays.default];
# nixpkgs.overlays = [inputs.niri.overlays.default];
programs.niri.enable = true; # wayland compositor in rust
programs.niri.package = perSystem.niri.niri;
programs.niri.package = perSystem.niri-flake.niri-unstable;
environment.variables = {
NIXOS_OZONE_WL = "1";
+7 -1
View File
@@ -63,7 +63,13 @@ in {
(mkIf (cfg.laptop.homeRowMods)
# lib.asserts.assertMsg (config.services.kanata.enable != config.services.keyd.enable) "Kanata and keyd create soft lock when both enabled"
{
services.kanata.keyboards.internal.config = builtins.readFile ./kanata/internal.kbd;
services.kanata.enable = true;
services.kanata.keyboards.internal = {
extraDefCfg = ''
process-unmapped-keys no
'';
configFile = ./kanata/internal.kbd;
};
})
(mkIf (cfg.powerSave) {
powerManagement.enable = true;
-5
View File
@@ -1,10 +1,5 @@
;; Kanata Configuration File for Graphite Anglemod Layout
;; Add a default configuration section to define unmapped key behavior.
(defcfg
process-unmapped-keys no ;; Ensure unmapped keys are passed to the OS unchanged.
)
;; Define the source keys Kanata will intercept.
(defsrc
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
@@ -4,7 +4,7 @@
lib,
...
}: let
isBuildHost = config.networking.hostName == "dunamis";
isBuildHost = config.module.host.name == "dunamis";
in {
config = lib.mkMerge [
(lib.mkIf isBuildHost {
+1 -1
View File
@@ -9,7 +9,7 @@
nix-ld.enable = true;
nh = {
enable = true;
flake = "/home/user/.config/nixos";
flake = "/etc/nixos";
};
};
environment.systemPackages = with pkgs; [
-2
View File
@@ -12,7 +12,6 @@
in {
users.groups.admin = {};
# --------------------------------------
nix.settings.trusted-users = ["user" "admin"];
users.mutableUsers = false;
users.users = {
@@ -20,7 +19,6 @@ in {
isNormalUser = true;
description = "System administrator";
extraGroups = ["wheel"]; # wheel = sudo
# run `mkpasswd --method=yescrypt` and replace "changeme" w/ the result
hashedPasswordFile = secrets."user-password-hashed".path;
openssh.authorizedKeys.keyFiles = map sshKeys [
"dunamis"
-5
View File
@@ -36,11 +36,6 @@
"org.kde.kdenlive" # video editor
{
appId = "com.collabora.Office";
bundle = builtins.fetchurl {
url = "https://cdn.collaboraoffice.com/collaboraoffice-v25.04.7.2_final.flatpak";
name = "collaboraoffice-v25.04.7.2_final.flatpak";
sha256 = "RHEXrlymoWnNmdVEzVh85/icxQsWVpLpgkJubi7SpsY=";
};
}
]
++ [
+13 -18
View File
@@ -1,9 +1,9 @@
{
config,
inputs,
lib,
osConfig,
perSystem,
flake,
pkgs,
...
}: let
@@ -11,22 +11,19 @@
inherit (osConfig.virtualisation) libvirtd;
inherit (osConfig.hardware) bluetooth;
in {
imports = [
inputs.vicinae.homeManagerModules.default
];
services.vicinae.enable = true;
console.yazi.enable = true;
editor.helix.enable = true;
shell = {
fish.enable = true;
oh-my-posh.enable = true;
};
imports = with flake.modules.hm-programs;
[
yazi
helix
fish
oh-my-posh
wezterm
ghostty
]
++ [./vicinae.nix];
syncthing.enable = true;
terminal.wezterm.enable = true;
terminal.ghostty.enable = true;
systemd.user.settings.Manager.DefaultEnvironment = {
TERMINAL = "wezterm";
HISTFILE = ''"$XDG_STATE_HOME"/bash/history'';
@@ -37,7 +34,7 @@ in {
NUGET_PACKAGES = ''"$XDG_CACHE_HOME"/NuGetPackages'';
NPM_CONFIG_INIT_MODULE = ''"$XDG_CONFIG_HOME"/npm/config/npm-init.js'';
NPM_CONFIG_CACHE = ''"$XDG_CACHE_HOME"/npm'';
NPM_CONFIG_TMP = ''"$XDG_RUNTIME_DIR"/npm'';
# NPM_CONFIG_TMP = ''"$XDG_RUNTIME_DIR"/npm'';
};
services = {
@@ -153,8 +150,6 @@ in {
# sonusmix # pipewire routing tool in rust
];
xdg.configFile."vicinae/vicinae.json".enable = false;
# xdg.desktopEntries.uni = {
# actions."Copy".exec = "fish -c \"~/.local/bin/uni --copy\"";
# categories = ["Utility" "X-Launch" "Network"];
+7
View File
@@ -0,0 +1,7 @@
{inputs, ...}: {
imports = [inputs.vicinae.homeManagerModules.default];
services.vicinae.enable = true;
xdg.configFile."vicinae/vicinae.json".enable = false;
}