From 063e32aa7309ca5636c4ce733d5a88036debe3f1 Mon Sep 17 00:00:00 2001 From: unexplrd Date: Thu, 25 Dec 2025 23:41:24 +0200 Subject: [PATCH] sorta refactor --- flake.nix | 1 + hosts/sarien/configuration.nix | 21 +- hosts/sarien/hardware/default.nix | 2 +- modules/hm-programs/fish.nix | 44 ++ modules/hm-programs/ghostty.nix | 18 + modules/hm-programs/helix.nix | 180 +++++++ modules/hm-programs/kitty.nix | 15 + modules/hm-programs/oh-my-posh.nix | 123 +++++ modules/hm-programs/wezterm.nix | 192 ++++++++ modules/hm-programs/yazi.nix | 108 +++++ modules/hm-programs/zed.nix | 151 ++++++ modules/home/desktop/default.nix | 46 +- .../home/desktop/dms/{config => }/dconf.nix | 0 modules/home/desktop/dms/default.nix | 32 +- .../desktop/dms/{config => }/mimeapps.nix | 0 .../dms/{config/default.nix => module.nix} | 9 +- .../desktop/dms/{config => }/packages.nix | 0 .../dms/{config => }/programs/default.nix | 1 + modules/home/desktop/dms/programs/dms.nix | 8 + .../dms/{config => }/programs/niri.nix | 10 +- .../dms/{config => }/programs/satty.nix | 0 .../dms/{config => }/programs/wl-kbptr.nix | 0 .../desktop/dms/{config => }/services.nix | 2 +- .../home/desktop/dms/{config => }/stylix.nix | 0 modules/home/desktop/gnome/default.nix | 459 +++++++++--------- modules/home/programs/console/default.nix | 6 - modules/home/programs/console/joshuto.nix | 292 ----------- modules/home/programs/console/yazi.nix | 117 ----- modules/home/programs/default.nix | 4 - modules/home/programs/editor/default.nix | 8 - modules/home/programs/editor/helix.nix | 187 ------- modules/home/programs/editor/neve.nix | 31 -- modules/home/programs/editor/nixvim.nix | 271 ----------- modules/home/programs/editor/zed.nix | 158 ------ modules/home/programs/shell/default.nix | 3 - modules/home/programs/shell/fish.nix | 51 -- modules/home/programs/shell/nushell.nix | 74 --- modules/home/programs/shell/oh-my-posh.nix | 132 ----- modules/home/programs/shell/zsh.nix | 75 --- modules/home/programs/terminal/default.nix | 7 - modules/home/programs/terminal/ghostty.nix | 26 - modules/home/programs/terminal/kitty.nix | 24 - modules/home/programs/terminal/wezterm.nix | 201 -------- modules/nixos/desktop/niri/default.nix | 4 +- modules/shared/nixos/default.nix | 8 +- modules/shared/nixos/kanata/internal.kbd | 5 - modules/shared/nixos/nix/distibuted-build.nix | 2 +- modules/shared/nixos/programs.nix | 2 +- modules/shared/nixos/users.nix | 2 - modules/users/user/flatpak.nix | 5 - modules/users/user/programs.nix | 31 +- modules/users/user/vicinae.nix | 7 + 52 files changed, 1159 insertions(+), 1996 deletions(-) create mode 100644 modules/hm-programs/fish.nix create mode 100644 modules/hm-programs/ghostty.nix create mode 100644 modules/hm-programs/helix.nix create mode 100644 modules/hm-programs/kitty.nix create mode 100644 modules/hm-programs/oh-my-posh.nix create mode 100644 modules/hm-programs/wezterm.nix create mode 100644 modules/hm-programs/yazi.nix create mode 100644 modules/hm-programs/zed.nix rename modules/home/desktop/dms/{config => }/dconf.nix (100%) rename modules/home/desktop/dms/{config => }/mimeapps.nix (100%) rename modules/home/desktop/dms/{config/default.nix => module.nix} (58%) rename modules/home/desktop/dms/{config => }/packages.nix (100%) rename modules/home/desktop/dms/{config => }/programs/default.nix (83%) create mode 100644 modules/home/desktop/dms/programs/dms.nix rename modules/home/desktop/dms/{config => }/programs/niri.nix (98%) rename modules/home/desktop/dms/{config => }/programs/satty.nix (100%) rename modules/home/desktop/dms/{config => }/programs/wl-kbptr.nix (100%) rename modules/home/desktop/dms/{config => }/services.nix (95%) rename modules/home/desktop/dms/{config => }/stylix.nix (100%) delete mode 100644 modules/home/programs/console/default.nix delete mode 100644 modules/home/programs/console/joshuto.nix delete mode 100644 modules/home/programs/console/yazi.nix delete mode 100644 modules/home/programs/editor/default.nix delete mode 100644 modules/home/programs/editor/helix.nix delete mode 100644 modules/home/programs/editor/neve.nix delete mode 100644 modules/home/programs/editor/nixvim.nix delete mode 100644 modules/home/programs/editor/zed.nix delete mode 100644 modules/home/programs/shell/default.nix delete mode 100644 modules/home/programs/shell/fish.nix delete mode 100644 modules/home/programs/shell/nushell.nix delete mode 100644 modules/home/programs/shell/oh-my-posh.nix delete mode 100644 modules/home/programs/shell/zsh.nix delete mode 100644 modules/home/programs/terminal/default.nix delete mode 100644 modules/home/programs/terminal/ghostty.nix delete mode 100644 modules/home/programs/terminal/kitty.nix delete mode 100644 modules/home/programs/terminal/wezterm.nix create mode 100644 modules/users/user/vicinae.nix diff --git a/flake.nix b/flake.nix index 1c9386e..24913fa 100644 --- a/flake.nix +++ b/flake.nix @@ -4,6 +4,7 @@ inputs = { blueprint.url = "github:numtide/blueprint"; chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; + # TODO: unpin when refactor is fixed dms.url = "github:AvengeMedia/DankMaterialShell/42a283"; disko.url = "github:nix-community/disko/latest"; ghostty.url = "github:ghostty-org/ghostty"; diff --git a/hosts/sarien/configuration.nix b/hosts/sarien/configuration.nix index 63f3cad..00cd60c 100644 --- a/hosts/sarien/configuration.nix +++ b/hosts/sarien/configuration.nix @@ -8,15 +8,7 @@ ./misc ]; - networking = { - hostId = "31150fae"; - hostName = "sarien"; - }; - - system.stateVersion = "25.11"; - time.timeZone = "Europe/Kyiv"; - - desktop.niri.enable = true; + desktop.dms.enable = true; services.displayManager.autoLogin = { enable = true; @@ -37,17 +29,24 @@ ]; module = { + host = { + id = "31150fae"; + name = "sarien"; + stateVersion = "25.11"; + }; + config = { laptop.homeRowMods = true; powerSave = true; useIwd = true; vaapi = "intel-media-driver"; + locale = "uk_UA.UTF-8"; + timeZone = "Europe/Kyiv"; }; stylix = { enable = true; - theme = "sandcastle"; + theme = "ashes"; }; - locale = "uk_UA.UTF-8"; misc.qmk-vial.enable = true; virt.libvirt.enable = true; }; diff --git a/hosts/sarien/hardware/default.nix b/hosts/sarien/hardware/default.nix index 05c884c..40f8d46 100644 --- a/hosts/sarien/hardware/default.nix +++ b/hosts/sarien/hardware/default.nix @@ -1,6 +1,6 @@ { imports = [ - ./laptop + # ./laptop ]; services = { logind = { diff --git a/modules/hm-programs/fish.nix b/modules/hm-programs/fish.nix new file mode 100644 index 0000000..91caf35 --- /dev/null +++ b/modules/hm-programs/fish.nix @@ -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 + ''; + }; + }; +} diff --git a/modules/hm-programs/ghostty.nix b/modules/hm-programs/ghostty.nix new file mode 100644 index 0000000..b81330e --- /dev/null +++ b/modules/hm-programs/ghostty.nix @@ -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" + ]; + }; + }; +} diff --git a/modules/hm-programs/helix.nix b/modules/hm-programs/helix.nix new file mode 100644 index 0000000..dc7cdd5 --- /dev/null +++ b/modules/hm-programs/helix.nix @@ -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"]; + # } + ]; + } + ]; + }; + }; +} diff --git a/modules/hm-programs/kitty.nix b/modules/hm-programs/kitty.nix new file mode 100644 index 0000000..c23425e --- /dev/null +++ b/modules/hm-programs/kitty.nix @@ -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 = " "; + }; + }; +} diff --git a/modules/hm-programs/oh-my-posh.nix b/modules/hm-programs/oh-my-posh.nix new file mode 100644 index 0000000..86b8c58 --- /dev/null +++ b/modules/hm-programs/oh-my-posh.nix @@ -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 }} {{ 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 = "-> "; + }; + }; + }; +} diff --git a/modules/hm-programs/wezterm.nix b/modules/hm-programs/wezterm.nix new file mode 100644 index 0000000..b783ff7 --- /dev/null +++ b/modules/hm-programs/wezterm.nix @@ -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' }, + }, + }, + }, + } + ''; + }; +} diff --git a/modules/hm-programs/yazi.nix b/modules/hm-programs/yazi.nix new file mode 100644 index 0000000..e44597f --- /dev/null +++ b/modules/hm-programs/yazi.nix @@ -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"]; + } + ]; + }; + }; +} diff --git a/modules/hm-programs/zed.nix b/modules/hm-programs/zed.nix new file mode 100644 index 0000000..3f2c8fe --- /dev/null +++ b/modules/hm-programs/zed.nix @@ -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; + }; + }; + }; +} diff --git a/modules/home/desktop/default.nix b/modules/home/desktop/default.nix index 933347e..98693c5 100644 --- a/modules/home/desktop/default.nix +++ b/modules/home/desktop/default.nix @@ -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)) + ]; } diff --git a/modules/home/desktop/dms/config/dconf.nix b/modules/home/desktop/dms/dconf.nix similarity index 100% rename from modules/home/desktop/dms/config/dconf.nix rename to modules/home/desktop/dms/dconf.nix diff --git a/modules/home/desktop/dms/default.nix b/modules/home/desktop/dms/default.nix index 7a55bc7..eb5b9c1 100644 --- a/modules/home/desktop/dms/default.nix +++ b/modules/home/desktop/dms/default.nix @@ -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); } diff --git a/modules/home/desktop/dms/config/mimeapps.nix b/modules/home/desktop/dms/mimeapps.nix similarity index 100% rename from modules/home/desktop/dms/config/mimeapps.nix rename to modules/home/desktop/dms/mimeapps.nix diff --git a/modules/home/desktop/dms/config/default.nix b/modules/home/desktop/dms/module.nix similarity index 58% rename from modules/home/desktop/dms/config/default.nix rename to modules/home/desktop/dms/module.nix index 4cd4daa..02c73ab 100644 --- a/modules/home/desktop/dms/config/default.nix +++ b/modules/home/desktop/dms/module.nix @@ -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 - }; - } ] diff --git a/modules/home/desktop/dms/config/packages.nix b/modules/home/desktop/dms/packages.nix similarity index 100% rename from modules/home/desktop/dms/config/packages.nix rename to modules/home/desktop/dms/packages.nix diff --git a/modules/home/desktop/dms/config/programs/default.nix b/modules/home/desktop/dms/programs/default.nix similarity index 83% rename from modules/home/desktop/dms/config/programs/default.nix rename to modules/home/desktop/dms/programs/default.nix index c7695e2..47c74f0 100644 --- a/modules/home/desktop/dms/config/programs/default.nix +++ b/modules/home/desktop/dms/programs/default.nix @@ -1,5 +1,6 @@ { imports = [ + ./dms.nix ./niri.nix ./satty.nix ./wl-kbptr.nix diff --git a/modules/home/desktop/dms/programs/dms.nix b/modules/home/desktop/dms/programs/dms.nix new file mode 100644 index 0000000..a570b90 --- /dev/null +++ b/modules/home/desktop/dms/programs/dms.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 + }; +} diff --git a/modules/home/desktop/dms/config/programs/niri.nix b/modules/home/desktop/dms/programs/niri.nix similarity index 98% rename from modules/home/desktop/dms/config/programs/niri.nix rename to modules/home/desktop/dms/programs/niri.nix index f5593ac..d806f11 100644 --- a/modules/home/desktop/dms/config/programs/niri.nix +++ b/modules/home/desktop/dms/programs/niri.nix @@ -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; diff --git a/modules/home/desktop/dms/config/programs/satty.nix b/modules/home/desktop/dms/programs/satty.nix similarity index 100% rename from modules/home/desktop/dms/config/programs/satty.nix rename to modules/home/desktop/dms/programs/satty.nix diff --git a/modules/home/desktop/dms/config/programs/wl-kbptr.nix b/modules/home/desktop/dms/programs/wl-kbptr.nix similarity index 100% rename from modules/home/desktop/dms/config/programs/wl-kbptr.nix rename to modules/home/desktop/dms/programs/wl-kbptr.nix diff --git a/modules/home/desktop/dms/config/services.nix b/modules/home/desktop/dms/services.nix similarity index 95% rename from modules/home/desktop/dms/config/services.nix rename to modules/home/desktop/dms/services.nix index 44a8aa5..843a584 100644 --- a/modules/home/desktop/dms/config/services.nix +++ b/modules/home/desktop/dms/services.nix @@ -9,7 +9,7 @@ enable = true; components = ["secrets"]; }; - kanshi = import ../../niri/services/kanshi; + kanshi = import ../niri/services/kanshi; udiskie = { enable = true; automount = false; diff --git a/modules/home/desktop/dms/config/stylix.nix b/modules/home/desktop/dms/stylix.nix similarity index 100% rename from modules/home/desktop/dms/config/stylix.nix rename to modules/home/desktop/dms/stylix.nix diff --git a/modules/home/desktop/gnome/default.nix b/modules/home/desktop/gnome/default.nix index 6a104d1..9824887 100644 --- a/modules/home/desktop/gnome/default.nix +++ b/modules/home/desktop/gnome/default.nix @@ -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 = ["q"]; + move-to-monitor-down = ["Down"]; + move-to-monitor-left = ["Left"]; + move-to-monitor-right = ["Right"]; + move-to-monitor-up = ["Up"]; + move-to-workspace-1 = ["1"]; + move-to-workspace-2 = ["2"]; + move-to-workspace-3 = ["3"]; + move-to-workspace-4 = ["4"]; + move-to-workspace-5 = ["5"]; + move-to-workspace-last = ["End"]; + move-to-workspace-left = ["Left"]; + move-to-workspace-right = ["Right"]; + switch-input-source = ["Space"]; + switch-input-source-backward = ["Space"]; + switch-to-workspace-1 = ["1"]; + switch-to-workspace-2 = ["2"]; + switch-to-workspace-3 = ["3"]; + switch-to-workspace-4 = ["4"]; + switch-to-workspace-left = ["Left"]; + switch-to-workspace-right = ["Right"]; + }; - "org/gnome/desktop/wm/keybindings" = { - close = ["q"]; - move-to-monitor-down = ["Down"]; - move-to-monitor-left = ["Left"]; - move-to-monitor-right = ["Right"]; - move-to-monitor-up = ["Up"]; - move-to-workspace-1 = ["1"]; - move-to-workspace-2 = ["2"]; - move-to-workspace-3 = ["3"]; - move-to-workspace-4 = ["4"]; - move-to-workspace-5 = ["5"]; - move-to-workspace-last = ["End"]; - move-to-workspace-left = ["Left"]; - move-to-workspace-right = ["Right"]; - switch-input-source = ["Space"]; - switch-input-source-backward = ["Space"]; - switch-to-workspace-1 = ["1"]; - switch-to-workspace-2 = ["2"]; - switch-to-workspace-3 = ["3"]; - switch-to-workspace-4 = ["4"]; - switch-to-workspace-left = ["Left"]; - switch-to-workspace-right = ["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 = "['Down']"; + focus-left = "['Left']"; + focus-right = "['Right']"; + focus-up = "['Up']"; + highlight-duration = 1; + }; - "org/gnome/shell/extensions/focuscontrol" = { - border-color = "'rgba(0,0,0,0)'"; - border-width = 1; - corner-radius = 0; - focus-down = "['Down']"; - focus-left = "['Left']"; - focus-right = "['Right']"; - focus-up = "['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; }; }; } diff --git a/modules/home/programs/console/default.nix b/modules/home/programs/console/default.nix deleted file mode 100644 index b99b283..0000000 --- a/modules/home/programs/console/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - imports = [ - ./joshuto.nix - ./yazi.nix - ]; -} diff --git a/modules/home/programs/console/joshuto.nix b/modules/home/programs/console/joshuto.nix deleted file mode 100644 index 7cb29b5..0000000 --- a/modules/home/programs/console/joshuto.nix +++ /dev/null @@ -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";}; - }; - }; - }; - }; -} diff --git a/modules/home/programs/console/yazi.nix b/modules/home/programs/console/yazi.nix deleted file mode 100644 index 01a2173..0000000 --- a/modules/home/programs/console/yazi.nix +++ /dev/null @@ -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"]; - } - ]; - }; - }; - }; -} diff --git a/modules/home/programs/default.nix b/modules/home/programs/default.nix index d8b799a..4f09470 100644 --- a/modules/home/programs/default.nix +++ b/modules/home/programs/default.nix @@ -1,9 +1,5 @@ { imports = [ - ./console - ./editor - ./shell - ./terminal ./syncthing.nix ./wl-kbptr.nix ]; diff --git a/modules/home/programs/editor/default.nix b/modules/home/programs/editor/default.nix deleted file mode 100644 index 8255a26..0000000 --- a/modules/home/programs/editor/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - imports = [ - ./helix.nix - ./zed.nix - # ./neve.nix - #./nixvim.nix - ]; -} diff --git a/modules/home/programs/editor/helix.nix b/modules/home/programs/editor/helix.nix deleted file mode 100644 index 99aed25..0000000 --- a/modules/home/programs/editor/helix.nix +++ /dev/null @@ -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"]; - # } - ]; - } - ]; - }; - }; - }; -} diff --git a/modules/home/programs/editor/neve.nix b/modules/home/programs/editor/neve.nix deleted file mode 100644 index 9509e5d..0000000 --- a/modules/home/programs/editor/neve.nix +++ /dev/null @@ -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; - }; - }; -} diff --git a/modules/home/programs/editor/nixvim.nix b/modules/home/programs/editor/nixvim.nix deleted file mode 100644 index 7d4200c..0000000 --- a/modules/home/programs/editor/nixvim.nix +++ /dev/null @@ -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 = { - "" = "cmp.mapping.complete()"; - "" = "cmp.mapping.scroll_docs(-4)"; - "" = "cmp.mapping.close()"; - "" = "cmp.mapping.scroll_docs(4)"; - "" = "cmp.mapping.confirm({ select = true })"; - "" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})"; - "" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; - }; - experimental = { - ghost_text = true; - }; - }; - }; - luasnip = { - enable = true; - settings = { - enable_autosnippets = true; - store_selection_keys = ""; - }; - }; - }; - 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 - 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 = ""; - action = "zz"; - } - { - mode = "n"; - key = ""; - action = "zz"; - } - { - mode = "n"; - key = "yy"; - action = "Yazi"; - options = {desc = "open yazi";}; - } - { - mode = "n"; - key = "fo"; - action = "Telescope oldfiles"; - options = {desc = "Telescope oldfiles";}; - } - { - mode = "n"; - key = "ff"; - action = "Telescope find_files"; - options = {desc = "Telescope find files";}; - } - ]; - }; - }; -} diff --git a/modules/home/programs/editor/zed.nix b/modules/home/programs/editor/zed.nix deleted file mode 100644 index d5d70fb..0000000 --- a/modules/home/programs/editor/zed.nix +++ /dev/null @@ -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; - }; - }; - }; - }; -} diff --git a/modules/home/programs/shell/default.nix b/modules/home/programs/shell/default.nix deleted file mode 100644 index de1a6ce..0000000 --- a/modules/home/programs/shell/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - imports = [./nushell.nix ./fish.nix ./oh-my-posh.nix]; -} diff --git a/modules/home/programs/shell/fish.nix b/modules/home/programs/shell/fish.nix deleted file mode 100644 index d8c73ce..0000000 --- a/modules/home/programs/shell/fish.nix +++ /dev/null @@ -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 - ''; - }; - }; - }; -} diff --git a/modules/home/programs/shell/nushell.nix b/modules/home/programs/shell/nushell.nix deleted file mode 100644 index 5cae173..0000000 --- a/modules/home/programs/shell/nushell.nix +++ /dev/null @@ -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" - } - } - ''; - }; - }; - }; -} diff --git a/modules/home/programs/shell/oh-my-posh.nix b/modules/home/programs/shell/oh-my-posh.nix deleted file mode 100644 index a4c9db6..0000000 --- a/modules/home/programs/shell/oh-my-posh.nix +++ /dev/null @@ -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 }} {{ 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 = "-> "; - }; - }; - }; - }; -} diff --git a/modules/home/programs/shell/zsh.nix b/modules/home/programs/shell/zsh.nix deleted file mode 100644 index 7f4f53b..0000000 --- a/modules/home/programs/shell/zsh.nix +++ /dev/null @@ -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"; - }; - } - ]; - }; - }; -} diff --git a/modules/home/programs/terminal/default.nix b/modules/home/programs/terminal/default.nix deleted file mode 100644 index 46dc60b..0000000 --- a/modules/home/programs/terminal/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - imports = [ - ./kitty.nix - ./ghostty.nix - ./wezterm.nix - ]; -} diff --git a/modules/home/programs/terminal/ghostty.nix b/modules/home/programs/terminal/ghostty.nix deleted file mode 100644 index cb12821..0000000 --- a/modules/home/programs/terminal/ghostty.nix +++ /dev/null @@ -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" - ]; - }; - }; - }; -} diff --git a/modules/home/programs/terminal/kitty.nix b/modules/home/programs/terminal/kitty.nix deleted file mode 100644 index 98f76b6..0000000 --- a/modules/home/programs/terminal/kitty.nix +++ /dev/null @@ -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 = " "; - }; - }; - }; -} diff --git a/modules/home/programs/terminal/wezterm.nix b/modules/home/programs/terminal/wezterm.nix deleted file mode 100644 index 061c48c..0000000 --- a/modules/home/programs/terminal/wezterm.nix +++ /dev/null @@ -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' }, - }, - }, - }, - } - ''; - }; - }; -} diff --git a/modules/nixos/desktop/niri/default.nix b/modules/nixos/desktop/niri/default.nix index 70c8533..15a48dd 100644 --- a/modules/nixos/desktop/niri/default.nix +++ b/modules/nixos/desktop/niri/default.nix @@ -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"; diff --git a/modules/shared/nixos/default.nix b/modules/shared/nixos/default.nix index 17a1d90..3ba5f4a 100644 --- a/modules/shared/nixos/default.nix +++ b/modules/shared/nixos/default.nix @@ -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; diff --git a/modules/shared/nixos/kanata/internal.kbd b/modules/shared/nixos/kanata/internal.kbd index 0a5c726..44732fc 100644 --- a/modules/shared/nixos/kanata/internal.kbd +++ b/modules/shared/nixos/kanata/internal.kbd @@ -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 diff --git a/modules/shared/nixos/nix/distibuted-build.nix b/modules/shared/nixos/nix/distibuted-build.nix index 9ab9ffd..66b46ef 100644 --- a/modules/shared/nixos/nix/distibuted-build.nix +++ b/modules/shared/nixos/nix/distibuted-build.nix @@ -4,7 +4,7 @@ lib, ... }: let - isBuildHost = config.networking.hostName == "dunamis"; + isBuildHost = config.module.host.name == "dunamis"; in { config = lib.mkMerge [ (lib.mkIf isBuildHost { diff --git a/modules/shared/nixos/programs.nix b/modules/shared/nixos/programs.nix index 036479e..c24da69 100644 --- a/modules/shared/nixos/programs.nix +++ b/modules/shared/nixos/programs.nix @@ -9,7 +9,7 @@ nix-ld.enable = true; nh = { enable = true; - flake = "/home/user/.config/nixos"; + flake = "/etc/nixos"; }; }; environment.systemPackages = with pkgs; [ diff --git a/modules/shared/nixos/users.nix b/modules/shared/nixos/users.nix index e3a4308..05b4181 100644 --- a/modules/shared/nixos/users.nix +++ b/modules/shared/nixos/users.nix @@ -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" diff --git a/modules/users/user/flatpak.nix b/modules/users/user/flatpak.nix index 2a7d574..c9170ee 100644 --- a/modules/users/user/flatpak.nix +++ b/modules/users/user/flatpak.nix @@ -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="; - }; } ] ++ [ diff --git a/modules/users/user/programs.nix b/modules/users/user/programs.nix index a1a9df5..64ebf6e 100644 --- a/modules/users/user/programs.nix +++ b/modules/users/user/programs.nix @@ -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"]; diff --git a/modules/users/user/vicinae.nix b/modules/users/user/vicinae.nix new file mode 100644 index 0000000..73342df --- /dev/null +++ b/modules/users/user/vicinae.nix @@ -0,0 +1,7 @@ +{inputs, ...}: { + imports = [inputs.vicinae.homeManagerModules.default]; + + services.vicinae.enable = true; + + xdg.configFile."vicinae/vicinae.json".enable = false; +}