diff --git a/hosts/vali/hermit/configuration.nix b/hosts/vali/hermit/configuration.nix index fd676d4..7b6a5f7 100644 --- a/hosts/vali/hermit/configuration.nix +++ b/hosts/vali/hermit/configuration.nix @@ -43,7 +43,7 @@ }; }; }; - boot.kernelPackages = pkgs.linuxPackages_xanmod_stable; + boot.kernelPackages = pkgs.linuxPackages_xanmod_latest; modules = { other = { system = { @@ -62,28 +62,38 @@ hyprland.enable = true; }; }; + system = { + programs = { + discord.enable = true; + firefox.enable = true; + zathura.enable = true; + terminals = { + foot.enable = true; + kitty.enable = true; + }; + }; + }; + usrEnv = { + programs = { + launchers = { + anyrun.enable = true; + }; + }; + services = { + mpd.enable = true; + }; + }; programs = { vesktop.enable = true; ssh.enable = true; btop.enable = true; mpv.enable = true; - kitty.enable = true; newsboat.enable = true; fish.enable = true; ncmpcpp.enable = true; nh.enable = true; - wtfutil.enable = true; waybar.enable = true; beets.enable = true; - #spicetify.enable = true; - schizofox.enable = true; - anyrun.enable = true; - zathura.enable = true; - ags.enable = true; - foot = { - enable = true; - server = false; - }; }; editors = { emacs.enable = true; @@ -102,6 +112,7 @@ theming = { quickshell.enable = true; stylix = { + # FIXME: Broken enable = true; # scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-pale.yaml"; scheme = "${pkgs.base16-schemes}/share/themes/tomorrow-night.yaml"; diff --git a/hosts/vali/temperance/configuration.nix b/hosts/vali/temperance/configuration.nix index 7fb6eaa..589bd27 100644 --- a/hosts/vali/temperance/configuration.nix +++ b/hosts/vali/temperance/configuration.nix @@ -30,6 +30,50 @@ programs.dconf.enable = true; boot.kernelPackages = pkgs.linuxPackages_xanmod_latest; modules = { + system = { + programs = { + editors = { + emacs.enable = true; + neovim.enable = true; + helix.enable = true; + kakoune.enable = true; + }; + discord.enable = true; + firefox.enable = true; + zathura.enable = true; + terminals = { + foot.enable = true; + kitty.enable = true; + }; + }; + }; + usrEnv = { + desktop.hyprland.enable = true; + programs = { + launchers.anyrun.enable = true; + media = { + beets.enable = true; + mpv.enable = true; + ncmpcpp.enable = true; + }; + }; + services = { + mpd.enable = true; + }; + style = { + stylix = { + enable = true; + scheme = "${pkgs.base16-schemes}/share/themes/tomorrow-night.yaml"; + cursor.size = 28; + fontsizes = { + terminal = 18; + popups = 14; + applications = 14; + }; + image = ../../../assets/wallpapers/tiredgod.png; + }; + }; + }; other = { system = { hostname = "temperance"; @@ -41,30 +85,13 @@ enableDirenv = true; }; }; - wms = { - wayland = { - enable = true; - hyprland.enable = true; - }; - }; programs = { - beets.enable = true; - vesktop.enable = true; ssh.enable = true; btop.enable = true; - mpv.enable = true; - kitty.enable = true; newsboat.enable = true; - ncmpcpp.enable = true; - wtfutil.enable = true; - foot.enable = true; fish.enable = true; nh.enable = true; waybar.enable = true; - #spicetify.enable = true; - schizofox.enable = true; - anyrun.enable = true; - zathura.enable = true; }; editors = { emacs.enable = true; @@ -82,17 +109,6 @@ }; theming = { quickshell.enable = true; - stylix = { - enable = true; - scheme = "${pkgs.base16-schemes}/share/themes/tomorrow-night.yaml"; - cursor.size = 28; - fontsizes = { - terminal = 18; - popups = 18; - applications = 14; - }; - image = ../../../assets/wallpapers/tiredgod.png; - }; gtk = {enable = false;}; qt = { enable = true; diff --git a/modules/cli/beets.nix b/modules/cli/beets.nix index ffb70fc..17ad8b8 100644 --- a/modules/cli/beets.nix +++ b/modules/cli/beets.nix @@ -3,12 +3,11 @@ lib, ... }: let - cfg = config.modules.programs.beets; - inherit (lib) mkIf mkEnableOption; + cfg = config.modules.usrEnv.programs.media.beets; inherit (config.modules.other.system) username; inherit (config.modules.services.mpd) musicDirectory; + inherit (lib) mkIf; in { - options.modules.programs.beets.enable = mkEnableOption "beets"; config = mkIf cfg.enable { home-manager.users.${username} = { programs.beets = { diff --git a/modules/editors/emacs.nix b/modules/editors/emacs.nix index 3c26734..4d88c06 100644 --- a/modules/editors/emacs.nix +++ b/modules/editors/emacs.nix @@ -5,9 +5,9 @@ inputs, ... }: let - cfg = config.modules.editors.emacs; + cfg = config.modules.system.programs.editors.emacs; inherit (config.modules.other.system) username; - inherit (lib) mkEnableOption mkIf; + inherit (lib) mkIf; newpkgs = pkgs.appendOverlays @@ -152,10 +152,6 @@ ws-butler ])); in { - options.modules.editors.emacs = { - enable = mkEnableOption "emacs"; - }; - config = mkIf cfg.enable { home-manager.users.${username} = { home.packages = with pkgs; [ diff --git a/modules/editors/helix.nix b/modules/editors/helix.nix index 22eb41b..64d15ec 100644 --- a/modules/editors/helix.nix +++ b/modules/editors/helix.nix @@ -4,12 +4,11 @@ pkgs, ... }: let - cfg = config.modules.editors.helix; - username = config.modules.other.system.username; + cfg = config.modules.system.programs.editors.helix; + inherit (config.modules.other.system) username; + inherit (lib) mkIf; in { - options.modules.editors.helix.enable = lib.mkEnableOption "helix"; - - config = lib.mkIf cfg.enable { + config = mkIf cfg.enable { home-manager.users.${username} = { programs.helix = { enable = true; diff --git a/modules/editors/kakoune.nix b/modules/editors/kakoune.nix index 706557c..a9b477e 100644 --- a/modules/editors/kakoune.nix +++ b/modules/editors/kakoune.nix @@ -3,13 +3,11 @@ lib, pkgs, ... -}: -with lib; let - cfg = config.modules.editors.kakoune; +}: let + cfg = config.modules.system.programs.editors; inherit (config.modules.other.system) username; + inherit (lib) mkIf; in { - options.modules.editors.kakoune.enable = mkEnableOption "kakoune"; - config = mkIf cfg.enable { home-manager.users.${username} = { programs.kakoune = { diff --git a/modules/editors/nixvim/colors/aquarium.nix b/modules/editors/nixvim/colors/aquarium.nix deleted file mode 100644 index 2a680a6..0000000 --- a/modules/editors/nixvim/colors/aquarium.nix +++ /dev/null @@ -1,18 +0,0 @@ -_: { - base01 = "#2c2e3e"; - base00 = "#20202A"; - base02 = "#3D4059"; - base03 = "#313449"; - base04 = "#63718b"; - base05 = "#ced4df"; - base06 = "#414560"; - base07 = "#63718b"; - base08 = "#ebb9b9"; - base09 = "#e8cca7"; - base0A = "#e6dfb8"; - base0B = "#b1dba4"; - base0C = "#b8dceb"; - base0D = "#a3b8ef"; - base0E = "#f6bbe7"; - base0F = "#eAc1c1"; -} diff --git a/modules/editors/nixvim/colors/decay.nix b/modules/editors/nixvim/colors/decay.nix deleted file mode 100644 index b357784..0000000 --- a/modules/editors/nixvim/colors/decay.nix +++ /dev/null @@ -1,18 +0,0 @@ -_: { - base00 = "#171B20"; - base01 = "#21262e"; - base02 = "#2b323b"; - base03 = "#3c4453"; - base04 = "#485263"; - base05 = "#b6beca"; - base06 = "#dee1e6"; - base07 = "#dee1e6"; - base08 = "#70A5EB"; - base09 = "#e9a180"; - base0A = "#f1cf8a"; - base0B = "#78DBA9"; - base0C = "#e26c7c"; - base0D = "#86aaec"; - base0E = "#c68aee"; - base0F = "#9cd1ff"; -} diff --git a/modules/editors/nixvim/colors/everblush.nix b/modules/editors/nixvim/colors/everblush.nix deleted file mode 100644 index 1001cf7..0000000 --- a/modules/editors/nixvim/colors/everblush.nix +++ /dev/null @@ -1,18 +0,0 @@ -_: { - base00 = "#101618"; - base01 = "#232a2d"; - base02 = "#2d3437"; - base03 = "#404749"; - base04 = "#4f5658"; - base05 = "#cacaca"; - base06 = "#d2d2d2"; - base07 = "#dadada"; - base08 = "#e57474"; - base09 = "#e19d5c"; - base0A = "#e5c76b"; - base0B = "#8ccf7e"; - base0C = "#71baf2"; - base0D = "#67cbe7"; - base0E = "#c47fd5"; - base0F = "#ef7d7d"; -} diff --git a/modules/editors/nixvim/colors/everforest.nix b/modules/editors/nixvim/colors/everforest.nix deleted file mode 100644 index 3dcab6a..0000000 --- a/modules/editors/nixvim/colors/everforest.nix +++ /dev/null @@ -1,18 +0,0 @@ -_: { - base00 = "#2b3339"; - base01 = "#323c41"; - base02 = "#3a4248"; - base03 = "#868d80"; - base04 = "#d3c6aa"; - base05 = "#d3c6aa"; - base06 = "#e9e8d2"; - base07 = "#fff9e8"; - base08 = "#7fbbb3"; - base09 = "#d699b6"; - base0A = "#83c092"; - base0B = "#dbbc7f"; - base0C = "#e69875"; - base0D = "#a7c080"; - base0E = "#e67e80"; - base0F = "#d699b6"; -} diff --git a/modules/editors/nixvim/colors/gruvbox.nix b/modules/editors/nixvim/colors/gruvbox.nix deleted file mode 100644 index a8c168b..0000000 --- a/modules/editors/nixvim/colors/gruvbox.nix +++ /dev/null @@ -1,18 +0,0 @@ -_: { - base00 = "#1e2122"; - base01 = "#2c2f30"; - base02 = "#36393a"; - base03 = "#404344"; - base04 = "#d4be98"; - base05 = "#c0b196"; - base06 = "#c3b499"; - base07 = "#c7b89d"; - base08 = "#ec6b64"; - base09 = "#e78a4e"; - base0A = "#e0c080"; - base0B = "#a9b665"; - base0C = "#86b17f"; - base0D = "#7daea3"; - base0E = "#d3869b"; - base0F = "#d65d0e"; -} diff --git a/modules/editors/nixvim/colors/jellybeans.nix b/modules/editors/nixvim/colors/jellybeans.nix deleted file mode 100644 index c50828b..0000000 --- a/modules/editors/nixvim/colors/jellybeans.nix +++ /dev/null @@ -1,18 +0,0 @@ -_: { - base00 = "#151515"; - base01 = "#1c1c1c"; - base02 = "#404040"; - base03 = "#888888"; - base04 = "#ddddbf"; - base05 = "#e8e8d3"; - base06 = "#eeeede"; - base07 = "#f1f1e5"; - base08 = "#cf6a4c"; - base09 = "#d8ad4c"; - base0A = "#d8ad4c"; - base0B = "#99ad6a"; - base0C = "#71b9f8"; - base0D = "#597bc5"; - base0E = "#c6b6ee"; - base0F = "#d8ad4c"; -} diff --git a/modules/editors/nixvim/colors/mountain.nix b/modules/editors/nixvim/colors/mountain.nix deleted file mode 100644 index 78990a5..0000000 --- a/modules/editors/nixvim/colors/mountain.nix +++ /dev/null @@ -1,18 +0,0 @@ -_: { - base00 = "#0f0f0f"; - base01 = "#151515"; - base02 = "#191919"; - base03 = "#323232"; - base04 = "#535353"; - base05 = "#f0f0f0"; - base06 = "#d8d8d8"; - base07 = "#414141"; - base08 = "#ac8a8c"; - base09 = "#d3d0ad"; - base0A = "#ACA98A"; - base0B = "#8aac8b"; - base0C = "#9EC3C4"; - base0D = "#8fb4b5"; - base0E = "#C49EC4"; - base0F = "#9d9a7b"; -} diff --git a/modules/editors/nixvim/colors/paradise.nix b/modules/editors/nixvim/colors/paradise.nix deleted file mode 100644 index 544bdd7..0000000 --- a/modules/editors/nixvim/colors/paradise.nix +++ /dev/null @@ -1,18 +0,0 @@ -_: { - base00 = "#151515"; - base01 = "#1F1F1F"; - base02 = "#2E2E2E"; - base03 = "#424242"; - base04 = "#BBB6B6"; - base05 = "#E8E3E3"; - base06 = "#E8E3E3"; - base07 = "#E8E3E3"; - base08 = "#B66467"; - base09 = "#D9BC8C"; - base0A = "#D9BC8C"; - base0B = "#8C977D"; - base0C = "#8AA6A2"; - base0D = "#8DA3B9"; - base0E = "#A988B0"; - base0F = "#BBB6B6"; -} diff --git a/modules/editors/nixvim/colors/tokyonight.nix b/modules/editors/nixvim/colors/tokyonight.nix deleted file mode 100644 index 4b226a3..0000000 --- a/modules/editors/nixvim/colors/tokyonight.nix +++ /dev/null @@ -1,18 +0,0 @@ -_: { - base00 = "#1A1B26"; - base01 = "#3b4261"; - base02 = "#3b4261"; - base03 = "#545c7e"; - base04 = "#565c64"; - base05 = "#a9b1d6"; - base06 = "#bbc5f0"; - base07 = "#c0caf5"; - base08 = "#f7768e"; - base09 = "#ff9e64"; - base0A = "#e0af68"; - base0B = "#9ece6a"; - base0C = "#2ac3de"; - base0D = "#7aa2f7"; - base0E = "#9d7cd8"; - base0F = "#9abdf5"; -} diff --git a/modules/editors/nixvim/default.nix b/modules/editors/nixvim/default.nix deleted file mode 100644 index ac6d47a..0000000 --- a/modules/editors/nixvim/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ - config, - lib, - inputs, - ... -}: let - inherit (builtins) filter map toString elem; - inherit (lib.filesystem) listFilesRecursive; - inherit (lib.strings) hasSuffix; - inherit (lib.lists) concatLists; - - mkNixvimModule = { - path, - ignoredPaths ? [ - ], - }: - filter (hasSuffix ".nix") ( - map toString ( - filter (path: path != ./default.nix && !elem path ignoredPaths) (listFilesRecursive path) - ) - ); -in { - imports = concatLists [ - [inputs.nixvim.nixosModules.nixvim] - - (mkNixvimModule {path = ./.;}) - ]; -} diff --git a/modules/editors/nixvim/highlight.nix b/modules/editors/nixvim/highlight.nix deleted file mode 100644 index 8c4e538..0000000 --- a/modules/editors/nixvim/highlight.nix +++ /dev/null @@ -1,121 +0,0 @@ -{ - config, - lib, - ... -}: let - colors = import ./colors/${config.theme}.nix {}; -in { - config = lib.mkIf config.colorschemes.base16.enable { - highlight = { - CursorLine = { - fg = "none"; - bg = "none"; - }; - CursorLineNr = { - fg = "none"; - bg = "none"; - }; - - AlphaHeader = { - fg = colors.base0E; - bg = "none"; - }; - - StatusNormal = { - bg = "none"; - fg = "none"; - }; - - TelescopePromptBorder = { - fg = colors.base01; - bg = colors.base01; - }; - TelescopePromptNormal = { - fg = "none"; - bg = colors.base01; - }; - TelescopePromptPrefix = { - fg = colors.base08; - bg = colors.base01; - }; - - TelescopeSelection = { - fg = "none"; - bg = colors.base01; - }; - - Pmenu = { - fg = "none"; - bg = colors.base01; - }; - PmenuSbar = { - fg = "none"; - bg = colors.base01; - }; - PmenuThumb = { - fg = "none"; - bg = colors.base01; - }; - PmenuSel = { - fg = "none"; - bg = colors.base02; - }; - - CmpItemAbbrMatch = { - fg = colors.base05; - bg = "none"; - }; - CmpItemAbbrMatchFuzzy = { - fg = colors.base05; - bg = "none"; - }; - CmpItemAbbr = { - fg = colors.base03; - bg = "none"; - }; - CmpItemKind = { - fg = colors.base0E; - bg = "none"; - }; - CmpItemMenu = { - fg = colors.base0E; - bg = "none"; - }; - CmpItemKindSnippet = { - fg = colors.base0E; - bg = "none"; - }; - - VertSplit = { - fg = colors.base01; - bg = "none"; - }; - FloatBorder = { - fg = colors.base01; - bg = colors.base01; - }; - NormalFloat = { - fg = "none"; - bg = colors.base01; - }; - - LineNr = { - fg = colors.base03; - bg = "none"; - }; - - NoiceCmdlinePopup = { - fg = colors.base04; - bg = colors.base01; - }; - NoiceCmdlinePopupBorder = { - fg = colors.base01; - bg = colors.base01; - }; - NoiceCmdlinePopupBorderSearch = { - fg = colors.base01; - bg = colors.base01; - }; - }; - }; -} diff --git a/modules/editors/nixvim/keys.nix b/modules/editors/nixvim/keys.nix deleted file mode 100644 index 640a758..0000000 --- a/modules/editors/nixvim/keys.nix +++ /dev/null @@ -1,410 +0,0 @@ -{ - programs.nixvim = { - globals.mapleader = " "; - - keymaps = [ - { - mode = "n"; - key = "f"; - action = "+find/file"; - options.desc = "Find a file"; - } - { - mode = "n"; - key = "s"; - action = "+search"; - options.desc = "Search in your file"; - } - - { - mode = "n"; - key = "q"; - action = "+quit/session"; - options.desc = "Quit the current session"; - } - - { - mode = ["n" "v"]; - key = "g"; - action = "+git"; - } - - { - mode = "n"; - key = "u"; - action = "+ui"; - } - - { - mode = "n"; - key = "w"; - action = "+windows"; - } - - { - mode = "n"; - key = ""; - action = "+tab"; - } - - { - mode = ["n" "v"]; - key = "d"; - action = "+debug"; - } - - { - mode = ["n" "v"]; - key = "c"; - action = "+code"; - } - - { - mode = ["n" "v"]; - key = "t"; - action = "+test"; - } - - # Tabs - { - mode = "n"; - key = ""; - action = "tabnew"; - options = { - silent = true; - desc = "New Tab"; - }; - } - - { - mode = "n"; - key = "d"; - action = "tabclose"; - options = { - silent = true; - desc = "Close tab"; - }; - } - - # Windows - { - mode = "n"; - key = "ww"; - action = "p"; - options = { - silent = true; - desc = "Other window"; - }; - } - - { - mode = "n"; - key = "wd"; - action = "c"; - options = { - silent = true; - desc = "Delete window"; - }; - } - - { - mode = "n"; - key = "w-"; - action = "s"; - options = { - silent = true; - desc = "Split window below"; - }; - } - - { - mode = "n"; - key = "w|"; - action = "v"; - options = { - silent = true; - desc = "Split window right"; - }; - } - - { - mode = "n"; - key = ""; - action = "h"; - options = { - silent = true; - desc = "Move to window left"; - }; - } - - { - mode = "n"; - key = ""; - action = "l"; - options = { - silent = true; - desc = "Move to window right"; - }; - } - - { - mode = "n"; - key = ""; - action = "k"; - options = { - silent = true; - desc = "Move to window over"; - }; - } - - { - mode = "n"; - key = ""; - action = "j"; - options = { - silent = true; - desc = "Move to window bellow"; - }; - } - - { - mode = "n"; - key = ""; - action = "w"; - options = { - silent = true; - desc = "Save file"; - }; - } - - # Quit/Session - { - mode = "n"; - key = "qq"; - action = "quitall"; - options = { - silent = true; - desc = "Quit all"; - }; - } - - { - mode = "n"; - key = "ul"; - action = ":lua ToggleLineNumber()"; - options = { - silent = true; - desc = "Toggle Line Numbers"; - }; - } - - { - mode = "n"; - key = "uL"; - action = ":lua ToggleRelativeLineNumber()"; - options = { - silent = true; - desc = "Toggle Relative Line Numbers"; - }; - } - - { - mode = "n"; - key = "uw"; - action = ":lua ToggleWrap()"; - options = { - silent = true; - desc = "Toggle Line Wrap"; - }; - } - - { - mode = "v"; - key = "J"; - action = ":m '>+1gv=gv"; - options = {desc = "Use move command when line is highlighted ";}; - } - - { - mode = "v"; - key = "K"; - action = ":m '>-2gv=gv"; - options = {desc = "Use move command when line is highlighted ";}; - } - - { - mode = "n"; - key = "J"; - action = "mzJ`z"; - options = { - desc = "Allow cursor to stay in the same place after appending to current line "; - }; - } - - { - mode = "n"; - key = ""; - action = ""; - #action = "zz"; - options = { - desc = "Allow C-d and C-u to keep the cursor in the middle"; - }; - } - - { - mode = "n"; - key = ""; - #action = "zz"; - action = ""; - options = { - desc = "Allow C-d and C-u to keep the cursor in the middle"; - }; - } - - { - mode = "n"; - key = "n"; - action = "nzzzv"; - options = {desc = "Allow search terms to stay in the middle ";}; - } - - { - mode = "n"; - key = "N"; - action = "Nzzzv"; - options = {desc = "Allow search terms to stay in the middle ";}; - } - - # Paste stuff without saving the deleted word into the buffer - { - mode = "x"; - key = "p"; - action = ''"_dP''; - options = {desc = "Deletes to void register and paste over";}; - } - - # Copy stuff to system clipboard with + y or just y to have it just in vim - { - mode = ["n" "v"]; - key = "y"; - action = ''"+y''; - options = {desc = "Copy to system clipboard";}; - } - - { - mode = ["n" "v"]; - key = "Y"; - action = ''"+Y''; - options = {desc = "Copy to system clipboard";}; - } - - # Delete to void register - { - mode = ["n" "v"]; - key = "D"; - action = ''"_d''; - options = {desc = "Delete to void register";}; - } - - # instead of pressing esc just because - { - mode = "i"; - key = ""; - action = ""; - } - - { - mode = "n"; - key = "zz"; - action = " ZenMode | Pencil"; - options = {desc = "Toggle writting mode";}; - } - - { - mode = "n"; - key = "m"; - action = " Grapple toggle "; - options = {desc = "Grapple Toggle tag";}; - } - - { - mode = "n"; - key = "k"; - action = " Grapple toggle_tags "; - options = {desc = "Grapple Toggle tag";}; - } - - { - mode = "n"; - key = "K"; - action = " Grapple toggle_scopes "; - options = {desc = "Grapple Toggle scopes";}; - } - - { - mode = "n"; - key = "j"; - action = " Grapple cycle forward "; - options = {desc = "Grapple Cycle forward";}; - } - - { - mode = "n"; - key = "J"; - action = " Grapple cycle backward "; - options = {desc = "Grapple Cycle backward";}; - } - - { - mode = "n"; - key = "1"; - action = " Grapple select index=1"; - options = {desc = "Grapple Select 1";}; - } - - { - mode = "n"; - key = "2"; - action = " Grapple select index=2"; - options = {desc = "Grapple Select 2";}; - } - - { - mode = "n"; - key = "3"; - action = " Grapple select index=3"; - options = {desc = "Grapple Select 3";}; - } - - { - mode = "n"; - key = "4"; - action = " Grapple select index=4"; - options = {desc = "Grapple Select 4";}; - } - ]; - extraConfigLua = '' - function ToggleLineNumber() - if vim.wo.number then - vim.wo.number = false - else - vim.wo.number = true - vim.wo.relativenumber = false - end - end - - function ToggleRelativeLineNumber() - if vim.wo.relativenumber then - vim.wo.relativenumber = false - else - vim.wo.relativenumber = true - vim.wo.number = false - end - end - - function ToggleWrap() - vim.wo.wrap = not vim.wo.wrap - end - ''; - }; -} diff --git a/modules/editors/nixvim/nixvim.nix b/modules/editors/nixvim/nixvim.nix deleted file mode 100644 index 8bcfcab..0000000 --- a/modules/editors/nixvim/nixvim.nix +++ /dev/null @@ -1,73 +0,0 @@ -{ - config, - lib, - inputs, - ... -}: let - cfg = config.modules.editors.nixvim; -in { - options.modules.editors.nixvim.enable = lib.mkEnableOption "nixvim"; - imports = [ - inputs.nixvim.nixosModules.nixvim - ./keys.nix - ./settings.nix - ./plug/completion/cmp.nix - #./plug/completion/copilot-cmp.nix - #./plug/completion/lspkind.nix - ./plug/git/gitlinker.nix - ./plug/git/gitsigns.nix - ./plug/git/lazygit.nix - ./plug/git/worktree.nix - - ./plug/lsp/conform.nix - ./plug/lsp/fidget.nix - ./plug/lsp/hlchunk.nix - ./plug/lsp/lsp.nix - ./plug/lsp/lspsaga.nix - ./plug/lsp/none-ls.nix - ./plug/lsp/trouble.nix - - ./plug/snippets/luasnip.nix - - ./plug/statusline/lualine.nix - #./plug/statusline/staline.nix - - #./plug/treesitter/treesitter-context.nix - ./plug/treesitter/treesitter-textobjects.nix - ./plug/treesitter/treesitter.nix - - ./plug/ui/alpha.nix - ./plug/ui/btw.nix - ./plug/ui/bufferline.nix - ./plug/ui/noice.nix - ./plug/ui/nvim-notify.nix - ./plug/ui/telescope.nix - - ./plug/utils/comment.nix - #./plug/utils/copilot.nix - ./plug/utils/flash.nix - ./plug/utils/hardtime.nix - #./plug/utils/harpoon.nix - ./plug/utils/grapple.nix - ./plug/utils/illuminate.nix - ./plug/utils/nvim-autopairs.nix - ./plug/utils/oil.nix - ./plug/utils/undotree.nix - ./plug/utils/ufo.nix - ./plug/utils/whichkey.nix - ./plug/utils/lazy.nix - ]; - options = { - theme = lib.mkOption { - default = "gruvbox"; - type = lib.types.enum ["paradise" "decay" "mountain" "tokyonight" "everforest" "everblush" "jellybeans" "aquarium" "gruvbox"]; - }; - }; - config = lib.mkIf cfg.enable { - programs.nixvim.enable = true; - # theme = "gruvbox"; - # programs.nixvim.extraConfigLua = '' - # _G.theme = "${config.theme}" - #''; - }; -} diff --git a/modules/editors/nixvim/plug/completion/cmp.nix b/modules/editors/nixvim/plug/completion/cmp.nix deleted file mode 100644 index 278f9e1..0000000 --- a/modules/editors/nixvim/plug/completion/cmp.nix +++ /dev/null @@ -1,122 +0,0 @@ -{ - programs.nixvim = { - plugins = { - cmp-emoji = {enable = true;}; - cmp = { - enable = true; - settings = { - autoEnableSources = true; - experimental = {ghost_text = true;}; - performance = { - debounce = 60; - fetchingTimeout = 200; - maxViewEntries = 30; - }; - snippet = {expand = "luasnip";}; - formatting = {fields = ["kind" "abbr" "menu"];}; - sources = [ - {name = "nvim_lsp";} - {name = "emoji";} - { - name = "buffer"; # text within current buffer - option.get_bufnrs.__raw = "vim.api.nvim_list_bufs"; - keywordLength = 3; - } - { - name = "path"; # file system paths - keywordLength = 3; - } - { - name = "luasnip"; # snippets - keywordLength = 3; - } - ]; - - window = { - completion = {border = "solid";}; - documentation = {border = "solid";}; - }; - - mapping = { - "" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; - "" = "cmp.mapping.select_next_item()"; - "" = "cmp.mapping.select_prev_item()"; - "" = "cmp.mapping.abort()"; - "" = "cmp.mapping.scroll_docs(-4)"; - "" = "cmp.mapping.scroll_docs(4)"; - "" = "cmp.mapping.complete()"; - "" = "cmp.mapping.confirm({ select = true })"; - "" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })"; - }; - }; - }; - 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 = false;}; # autocomplete for cmdline - }; - extraConfigLua = '' - luasnip = require("luasnip") - kind_icons = { - Text = "󰊄", - Method = "", - Function = "󰡱", - Constructor = "", - Field = "", - Variable = "󱀍", - Class = "", - Interface = "", - Module = "󰕳", - Property = "", - Unit = "", - Value = "", - Enum = "", - Keyword = "", - Snippet = "", - Color = "", - File = "", - Reference = "", - Folder = "", - EnumMember = "", - Constant = "", - Struct = "", - Event = "", - Operator = "", - TypeParameter = "", - } - - local cmp = require'cmp' - - -- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). - cmp.setup.cmdline({'/', "?" }, { - sources = { - { name = 'buffer' } - } - }) - - -- Set configuration for specific filetype. - cmp.setup.filetype('gitcommit', { - sources = cmp.config.sources({ - { name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it. - }, { - { name = 'buffer' }, - }) - }) - - -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). - cmp.setup.cmdline(':', { - sources = cmp.config.sources({ - { name = 'path' } - }, { - { name = 'cmdline' } - }), - -- formatting = { - -- format = function(_, vim_item) - -- vim_item.kind = cmdIcons[vim_item.kind] or "FOO" - -- return vim_item - -- end - -- } - }) ''; - }; -} diff --git a/modules/editors/nixvim/plug/git/gitlinker.nix b/modules/editors/nixvim/plug/git/gitlinker.nix deleted file mode 100644 index 5c14efa..0000000 --- a/modules/editors/nixvim/plug/git/gitlinker.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - programs.nixvim.plugins.gitlinker = { - enable = true; - callbacks = { - "gihub.com" = "get_github_type_url"; - }; - }; -} diff --git a/modules/editors/nixvim/plug/git/gitsigns.nix b/modules/editors/nixvim/plug/git/gitsigns.nix deleted file mode 100644 index 4383c20..0000000 --- a/modules/editors/nixvim/plug/git/gitsigns.nix +++ /dev/null @@ -1,78 +0,0 @@ -{ - programs.nixvim = { - plugins.gitsigns = { - enable = true; - settings = { - trouble = true; - current_line_blame = true; - signs = { - add = { - text = "│"; - }; - change = { - text = "│"; - }; - delete = { - text = "_"; - }; - topdelete = { - text = "‾"; - }; - changedelete = { - text = "~"; - }; - untracked = { - text = "│"; - }; - }; - }; - }; - keymaps = [ - { - mode = ["n" "v"]; - key = "gh"; - action = "gitsigns"; - options = { - silent = true; - desc = "+hunks"; - }; - } - { - mode = "n"; - key = "ghb"; - action = ":Gitsigns blame_line"; - options = { - silent = true; - desc = "Blame line"; - }; - } - { - mode = "n"; - key = "ghd"; - action = ":Gitsigns diffthis"; - options = { - silent = true; - desc = "Diff This"; - }; - } - { - mode = "n"; - key = "ghR"; - action = ":Gitsigns reset_buffer"; - options = { - silent = true; - desc = "Reset Buffer"; - }; - } - { - mode = "n"; - key = "ghS"; - action = ":Gitsigns stage_buffer"; - options = { - silent = true; - desc = "Stage Buffer"; - }; - } - ]; - }; -} diff --git a/modules/editors/nixvim/plug/git/lazygit.nix b/modules/editors/nixvim/plug/git/lazygit.nix deleted file mode 100644 index 46d2c27..0000000 --- a/modules/editors/nixvim/plug/git/lazygit.nix +++ /dev/null @@ -1,22 +0,0 @@ -{pkgs, ...}: { - programs.nixvim = { - extraPlugins = with pkgs.vimPlugins; [ - lazygit-nvim - ]; - - extraConfigLua = '' - require("telescope").load_extension("lazygit") - ''; - - keymaps = [ - { - mode = "n"; - key = "gg"; - action = "LazyGit"; - options = { - desc = "LazyGit (root dir)"; - }; - } - ]; - }; -} diff --git a/modules/editors/nixvim/plug/git/worktree.nix b/modules/editors/nixvim/plug/git/worktree.nix deleted file mode 100644 index de5ac19..0000000 --- a/modules/editors/nixvim/plug/git/worktree.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - programs.nixvim.plugins.git-worktree = { - enable = true; - enableTelescope = true; - }; -} diff --git a/modules/editors/nixvim/plug/lsp/conform.nix b/modules/editors/nixvim/plug/lsp/conform.nix deleted file mode 100644 index 5550558..0000000 --- a/modules/editors/nixvim/plug/lsp/conform.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - programs.nixvim.plugins.conform-nvim = { - enable = true; - formatOnSave = { - lspFallback = true; - timeoutMs = 500; - }; - notifyOnError = true; - formattersByFt = { - liquidsoap = ["liquidsoap-prettier"]; - html = [["prettierd" "prettier"]]; - css = [["prettierd" "prettier"]]; - javascript = [["prettierd" "prettier"]]; - javascriptreact = [["prettierd" "prettier"]]; - typescript = [["prettierd" "prettier"]]; - typescriptreact = [["prettierd" "prettier"]]; - python = ["black"]; - lua = ["stylua"]; - nix = ["alejandra"]; - markdown = [["prettierd" "prettier"]]; - yaml = ["yamllint" "yamlfmt"]; - }; - }; -} diff --git a/modules/editors/nixvim/plug/lsp/fidget.nix b/modules/editors/nixvim/plug/lsp/fidget.nix deleted file mode 100644 index 225c841..0000000 --- a/modules/editors/nixvim/plug/lsp/fidget.nix +++ /dev/null @@ -1,101 +0,0 @@ -{ - programs.nixvim = { - plugins.fidget = { - enable = true; - logger = { - level = "warn"; # “off”, “error”, “warn”, “info”, “debug”, “trace” - floatPrecision = 0.01; # Limit the number of decimals displayed for floats - }; - progress = { - pollRate = 0; # How and when to poll for progress messages - suppressOnInsert = true; # Suppress new messages while in insert mode - ignoreDoneAlready = false; # Ignore new tasks that are already complete - ignoreEmptyMessage = false; # Ignore new tasks that don't contain a message - clearOnDetach = - # Clear notification group when LSP server detaches - '' - function(client_id) - local client = vim.lsp.get_client_by_id(client_id) - return client and client.name or nil - end - ''; - notificationGroup = - # How to get a progress message's notification group key - '' - function(msg) return msg.lsp_client.name end - ''; - ignore = []; # List of LSP servers to ignore - lsp = { - progressRingbufSize = 0; # Configure the nvim's LSP progress ring buffer size - }; - display = { - renderLimit = 16; # How many LSP messages to show at once - doneTtl = 3; # How long a message should persist after completion - doneIcon = "✔"; # Icon shown when all LSP progress tasks are complete - doneStyle = "Constant"; # Highlight group for completed LSP tasks - progressTtl = "math.huge"; # How long a message should persist when in progress - progressIcon = { - pattern = "dots"; - period = 1; - }; # Icon shown when LSP progress tasks are in progress - progressStyle = "WarningMsg"; # Highlight group for in-progress LSP tasks - groupStyle = "Title"; # Highlight group for group name (LSP server name) - iconStyle = "Question"; # Highlight group for group icons - priority = 30; # Ordering priority for LSP notification group - skipHistory = true; # Whether progress notifications should be omitted from history - formatMessage = '' - require ("fidget.progress.display").default_format_message - ''; # How to format a progress message - formatAnnote = '' - function (msg) return msg.title end - ''; # How to format a progress annotation - formatGroupName = '' - function (group) return tostring (group) end - ''; # How to format a progress notification group's name - overrides = { - rust_analyzer = { - name = "rust-analyzer"; - }; - }; # Override options from the default notification config - }; - }; - notification = { - pollRate = 10; # How frequently to update and render notifications - filter = "info"; # “off”, “error”, “warn”, “info”, “debug”, “trace” - historySize = 128; # Number of removed messages to retain in history - overrideVimNotify = true; - redirect = '' - function(msg, level, opts) - if opts and opts.on_open then - return require("fidget.integration.nvim-notify").delegate(msg, level, opts) - end - end - ''; - configs = { - default = "require('fidget.notification').default_config"; - }; - - window = { - normalHl = "Comment"; - winblend = 0; - border = "none"; # none, single, double, rounded, solid, shadow - zindex = 45; - maxWidth = 0; - maxHeight = 0; - xPadding = 1; - yPadding = 0; - align = "bottom"; - relative = "editor"; - }; - view = { - stackUpwards = true; # Display notification items from bottom to top - iconSeparator = " "; # Separator between group name and icon - groupSeparator = "---"; # Separator between notification groups - groupSeparatorHl = - # Highlight group used for group separator - "Comment"; - }; - }; - }; - }; -} diff --git a/modules/editors/nixvim/plug/lsp/hlchunk.nix b/modules/editors/nixvim/plug/lsp/hlchunk.nix deleted file mode 100644 index 190618c..0000000 --- a/modules/editors/nixvim/plug/lsp/hlchunk.nix +++ /dev/null @@ -1,13 +0,0 @@ -{pkgs, ...}: { - programs.nixvim.extraPlugins = [ - (pkgs.vimUtils.buildVimPlugin { - name = "hlchunk"; - src = pkgs.fetchFromGitHub { - owner = "shellRaining"; - repo = "hlchunk.nvim"; - rev = "882d1bc86d459fa8884398223c841fd09ea61b6b"; - hash = "sha256-fvFvV7KAOo7xtOCjhGS5bDUzwd10DndAKs3++dunED8="; - }; - }) - ]; -} diff --git a/modules/editors/nixvim/plug/lsp/lsp.nix b/modules/editors/nixvim/plug/lsp/lsp.nix deleted file mode 100644 index 3ad668e..0000000 --- a/modules/editors/nixvim/plug/lsp/lsp.nix +++ /dev/null @@ -1,98 +0,0 @@ -{ - programs.nixvim = { - plugins = { - lsp-format = {enable = true;}; - lsp = { - enable = true; - servers = { - eslint = {enable = true;}; - html = {enable = true;}; - lua-ls = {enable = true;}; - nil_ls = {enable = true;}; - marksman = {enable = true;}; - pyright = {enable = true;}; - gopls = {enable = true;}; - terraformls = {enable = true;}; - tsserver = {enable = false;}; - yamlls.enable = true; - typst-lsp.enable = true; - texlab.enable = true; - }; - keymaps = { - silent = true; - lspBuf = { - gd = { - action = "definition"; - desc = "Goto Definition"; - }; - gr = { - action = "references"; - desc = "Goto References"; - }; - gD = { - action = "declaration"; - desc = "Goto Declaration"; - }; - gI = { - action = "implementation"; - desc = "Goto Implementation"; - }; - gT = { - action = "type_definition"; - desc = "Type Definition"; - }; - K = { - action = "hover"; - desc = "Hover"; - }; - "cw" = { - action = "workspace_symbol"; - desc = "Workspace Symbol"; - }; - "cr" = { - action = "rename"; - desc = "Rename"; - }; - }; - diagnostic = { - "cd" = { - action = "open_float"; - desc = "Line Diagnostics"; - }; - "[d" = { - action = "goto_next"; - desc = "Next Diagnostic"; - }; - "]d" = { - action = "goto_prev"; - desc = "Previous Diagnostic"; - }; - }; - }; - }; - }; - extraConfigLua = '' - local _border = "rounded" - - vim.lsp.handlers["textDocument/hover"] = vim.lsp.with( - vim.lsp.handlers.hover, { - border = _border - } - ) - - vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( - vim.lsp.handlers.signature_help, { - border = _border - } - ) - - vim.diagnostic.config{ - float={border=_border} - }; - - require('lspconfig.ui.windows').default_options = { - border = _border - } - ''; - }; -} diff --git a/modules/editors/nixvim/plug/lsp/lspsaga.nix b/modules/editors/nixvim/plug/lsp/lspsaga.nix deleted file mode 100644 index 7eb444f..0000000 --- a/modules/editors/nixvim/plug/lsp/lspsaga.nix +++ /dev/null @@ -1,188 +0,0 @@ -{ - programs.nixvim = { - plugins.lspsaga = { - enable = true; - beacon = { - enable = true; - }; - ui = { - border = "rounded"; # One of none, single, double, rounded, solid, shadow - codeAction = "💡"; # Can be any symbol you want 💡 - }; - hover = { - openCmd = "!floorp"; # Choose your browser - openLink = "gx"; - }; - diagnostic = { - borderFollow = true; - diagnosticOnlyCurrent = false; - showCodeAction = true; - }; - symbolInWinbar = { - enable = true; # Breadcrumbs - }; - codeAction = { - extendGitSigns = false; - showServerName = true; - onlyInCursor = true; - numShortcut = true; - keys = { - exec = ""; - quit = ["" "q"]; - }; - }; - lightbulb = { - enable = false; - sign = false; - virtualText = true; - }; - implement = { - enable = false; - }; - rename = { - autoSave = false; - keys = { - exec = ""; - quit = ["" ""]; - select = "x"; - }; - }; - outline = { - autoClose = true; - autoPreview = true; - closeAfterJump = true; - layout = "normal"; # normal or float - winPosition = "right"; # left or right - keys = { - jump = "e"; - quit = "q"; - toggleOrJump = "o"; - }; - }; - scrollPreview = { - scrollDown = ""; - scrollUp = ""; - }; - }; - keymaps = [ - { - mode = "n"; - key = "gd"; - action = "Lspsaga finder def"; - options = { - desc = "Goto Definition"; - silent = true; - }; - } - { - mode = "n"; - key = "gr"; - action = "Lspsaga finder ref"; - options = { - desc = "Goto References"; - silent = true; - }; - } - - # { - # mode = "n"; - # key = "gD"; - # action = "Lspsaga show_line_diagnostics"; - # options = { - # desc = "Goto Declaration"; - # silent = true; - # }; - # } - - { - mode = "n"; - key = "gI"; - action = "Lspsaga finder imp"; - options = { - desc = "Goto Implementation"; - silent = true; - }; - } - - { - mode = "n"; - key = "gT"; - action = "Lspsaga peek_type_definition"; - options = { - desc = "Type Definition"; - silent = true; - }; - } - - { - mode = "n"; - key = "K"; - action = "Lspsaga hover_doc"; - options = { - desc = "Hover"; - silent = true; - }; - } - - { - mode = "n"; - key = "cw"; - action = "Lspsaga outline"; - options = { - desc = "Outline"; - silent = true; - }; - } - - { - mode = "n"; - key = "cr"; - action = "Lspsaga rename"; - options = { - desc = "Rename"; - silent = true; - }; - } - - { - mode = "n"; - key = "ca"; - action = "Lspsaga code_action"; - options = { - desc = "Code Action"; - silent = true; - }; - } - - { - mode = "n"; - key = "cd"; - action = "Lspsaga show_line_diagnostics"; - options = { - desc = "Line Diagnostics"; - silent = true; - }; - } - - { - mode = "n"; - key = "[d"; - action = "Lspsaga diagnostic_jump_next"; - options = { - desc = "Next Diagnostic"; - silent = true; - }; - } - - { - mode = "n"; - key = "]d"; - action = "Lspsaga diagnostic_jump_prev"; - options = { - desc = "Previous Diagnostic"; - silent = true; - }; - } - ]; - }; -} diff --git a/modules/editors/nixvim/plug/lsp/none-ls.nix b/modules/editors/nixvim/plug/lsp/none-ls.nix deleted file mode 100644 index 97cfe4a..0000000 --- a/modules/editors/nixvim/plug/lsp/none-ls.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ - programs.nixvim = { - plugins.none-ls = { - enable = true; - enableLspFormat = true; - updateInInsert = false; - sources = { - code_actions = { - gitsigns.enable = true; - statix.enable = true; - }; - diagnostics = { - statix.enable = true; - yamllint.enable = true; - }; - formatting = { - alejandra.enable = true; - black = { - enable = true; - withArgs = '' - { - extra_args = { "--fast" }, - } - ''; - }; - prettier = { - enable = true; - disableTsServerFormatter = true; - withArgs = '' - { - extra_args = { "--no-semi", "--single-quote" }, - } - ''; - }; - stylua.enable = true; - yamlfmt.enable = true; - }; - }; - }; - keymaps = [ - { - mode = ["n" "v"]; - key = "cf"; - action = "lua vim.lsp.buf.format()"; - options = { - silent = true; - desc = "Format"; - }; - } - ]; - }; -} diff --git a/modules/editors/nixvim/plug/lsp/trouble.nix b/modules/editors/nixvim/plug/lsp/trouble.nix deleted file mode 100644 index f11b89a..0000000 --- a/modules/editors/nixvim/plug/lsp/trouble.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - programs.nixvim.plugins.trouble = { - enable = true; - }; -} diff --git a/modules/editors/nixvim/plug/snippets/luasnip.nix b/modules/editors/nixvim/plug/snippets/luasnip.nix deleted file mode 100644 index 70a161c..0000000 --- a/modules/editors/nixvim/plug/snippets/luasnip.nix +++ /dev/null @@ -1,15 +0,0 @@ -{pkgs, ...}: { - programs.nixvim.plugins.luasnip = { - enable = true; - extraConfig = { - enable_autosnippets = true; - store_selection_keys = ""; - }; - fromVscode = [ - { - lazyLoad = true; - paths = "${pkgs.vimPlugins.friendly-snippets}"; - } - ]; - }; -} diff --git a/modules/editors/nixvim/plug/statusline/lualine.nix b/modules/editors/nixvim/plug/statusline/lualine.nix deleted file mode 100644 index 911cdd4..0000000 --- a/modules/editors/nixvim/plug/statusline/lualine.nix +++ /dev/null @@ -1,103 +0,0 @@ -{ - programs.nixvim.plugins.lualine = { - enable = true; - globalstatus = true; - disabledFiletypes = { - statusline = ["dashboard" "alpha" "starter"]; - }; - # theme = { - # normal = { - # a = { - # bg = "#b4befe"; - # fg = "#1c1d21"; - # }; - # b = { - # bg = "nil"; - # }; - # c = { - # bg = "nil"; - # }; - # z = { - # bg = "nil"; - # }; - # y = { - # bg = "nil"; - # }; - # }; - # }; - sections = { - lualine_a = [ - { - name = "mode"; - fmt = "string.lower"; - color = { - fg = "none"; - bg = "none"; - }; - } - ]; - lualine_b = [ - { - name = "branch"; - icon = ""; - color = { - fg = "none"; - bg = "none"; - }; - } - "diff" - ]; - lualine_c = [ - { - name = "diagnostic"; - extraConfig = { - symbols = { - error = " "; - warn = " "; - info = " "; - hint = "󰝶 "; - }; - }; - color = { - fg = "none"; - bg = "none"; - }; - } - ]; - lualine_x = [ - { - name = "filetype"; - extraConfig = { - icon_only = true; - }; - } - ]; - lualine_y = [ - { - name = "filename"; - extraConfig = { - symbols = { - modified = ""; - readonly = ""; - unnamed = ""; - }; - }; - color = { - fg = "none"; - bg = "none"; - }; - separator.left = ""; - } - ]; - lualine_z = [ - { - name = "location"; - color = { - fg = "none"; - bg = "none"; - }; - } - ]; - }; - }; -} diff --git a/modules/editors/nixvim/plug/statusline/staline.nix b/modules/editors/nixvim/plug/statusline/staline.nix deleted file mode 100644 index ae07bb8..0000000 --- a/modules/editors/nixvim/plug/statusline/staline.nix +++ /dev/null @@ -1,65 +0,0 @@ -{pkgs, ...}: { - extraPlugins = with pkgs.vimUtils; [ - (buildVimPlugin { - pname = "staline.nvim"; - version = "2024-02-05"; - src = pkgs.fetchFromGitHub { - owner = "tamton-aquib"; - repo = "staline.nvim"; - rev = "a53f869278b8b186a5afd6f21680cd103c381599"; - hash = "sha256-GDMKzxFDtQk5LL+rMsxTGTyLv69w5NUd+u19noeO5ws="; - }; - }) - ]; - extraConfigLua = '' - require("staline").setup({ - sections = { - left = { "-mode", " ", "branch" }, - mid = { "lsp_name" }, - right = { "file_name", "line_column" }, - }, - inactive_sections = { - left = { "-mode", " ", "branch" }, - mid = { "lsp_name" }, - right = { "file_name", "line_column" }, - }, - defaults = { - left_separator = " ", - right_separator = " ", - branch_symbol = " ", - mod_symbol = "", - line_column = "[%l/%L]", - inactive_color = "#80a6f2", --#303030 is the default - inactive_bgcolor = "none", - }, - special_table = { - lazy = { "Plugins", "💤 " }, - TelescopePrompt = { "Telescope", " " }, - oil = { "Oil", "󰏇 " }, - lazygit = { "LazyGit", " " }, - }, - mode_icons = { - ["n"] = "NORMAL", - ["no"] = "NORMAL", - ["nov"] = "NORMAL", - ["noV"] = "NORMAL", - ["niI"] = "NORMAL", - ["niR"] = "NORMAL", - ["niV"] = "NORMAL", - ["i"] = "INSERT", - ["ic"] = "INSERT", - ["ix"] = "INSERT", - ["s"] = "INSERT", - ["S"] = "INSERT", - ["v"] = "VISUAL", - ["V"] = "VISUAL", - [""] = "VISUAL", - ["r"] = "REPLACE", - ["r?"] = "REPLACE", - ["R"] = "REPLACE", - ["c"] = "COMMAND", - ["t"] = "TERMINAL", - }, - }) - ''; -} diff --git a/modules/editors/nixvim/plug/treesitter/treesitter-context.nix b/modules/editors/nixvim/plug/treesitter/treesitter-context.nix deleted file mode 100644 index 5e08da4..0000000 --- a/modules/editors/nixvim/plug/treesitter/treesitter-context.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - programs.nixvim.plugins.treesitter-context = { - enable = true; - }; -} diff --git a/modules/editors/nixvim/plug/treesitter/treesitter-textobjects.nix b/modules/editors/nixvim/plug/treesitter/treesitter-textobjects.nix deleted file mode 100644 index 090c11e..0000000 --- a/modules/editors/nixvim/plug/treesitter/treesitter-textobjects.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ - programs.nixvim.plugins.treesitter-textobjects = { - enable = false; - select = { - enable = true; - lookahead = true; - keymaps = { - "aa" = "@parameter.outer"; - "ia" = "@parameter.inner"; - "af" = "@function.outer"; - "if" = "@function.inner"; - "ac" = "@class.outer"; - "ic" = "@class.inner"; - "ii" = "@conditional.inner"; - "ai" = "@conditional.outer"; - "il" = "@loop.inner"; - "al" = "@loop.outer"; - "at" = "@comment.outer"; - }; - }; - move = { - enable = true; - gotoNextStart = { - "]m" = "@function.outer"; - "]]" = "@class.outer"; - }; - gotoNextEnd = { - "]M" = "@function.outer"; - "][" = "@class.outer"; - }; - gotoPreviousStart = { - "[m" = "@function.outer"; - "[[" = "@class.outer"; - }; - gotoPreviousEnd = { - "[M" = "@function.outer"; - "[]" = "@class.outer"; - }; - }; - swap = { - enable = true; - swapNext = { - "a" = "@parameters.inner"; - }; - swapPrevious = { - "A" = "@parameter.outer"; - }; - }; - }; -} diff --git a/modules/editors/nixvim/plug/treesitter/treesitter.nix b/modules/editors/nixvim/plug/treesitter/treesitter.nix deleted file mode 100644 index 24acbe2..0000000 --- a/modules/editors/nixvim/plug/treesitter/treesitter.nix +++ /dev/null @@ -1,46 +0,0 @@ -{pkgs, ...}: let - nu-grammar = pkgs.tree-sitter.buildGrammar { - language = "nu"; - version = "0.0.0+rev=358c4f5"; - src = pkgs.fetchFromGitHub { - owner = "nushell"; - repo = "tree-sitter-nu"; - rev = "2d0dd587dbfc3363d2af4e4141833e718647a67e"; - hash = "sha256-A0Lpsx0VFRYUWetgX3Bn5osCsLQrZzg90unGg9kTnVg="; - }; - }; -in { - programs.nixvim = { - filetype.extension.liq = "liquidsoap"; - filetype.extension.nu = "nu"; - - plugins.treesitter = { - enable = true; - indent = true; - folding = true; - languageRegister.nu = "nu"; - languageRegister.liq = "liquidsoap"; - nixvimInjections = true; - grammarPackages = - [ - nu-grammar - ] - ++ pkgs.vimPlugins.nvim-treesitter.allGrammars; - }; - - extraFiles = { - "/queries/nu/highlights.scm" = builtins.readFile "${nu-grammar}/queries/nu/highlights.scm"; - "/queries/nu/injections.scm" = builtins.readFile "${nu-grammar}/queries/nu/injections.scm"; - }; - extraConfigLua = '' - local parser_config = require("nvim-treesitter.parsers").get_parser_configs() - - parser_config.liquidsoap = { - filetype = "liquidsoap", - } - parser_config.nu = { - filetype = "nu", - } - ''; - }; -} diff --git a/modules/editors/nixvim/plug/ui/alpha.nix b/modules/editors/nixvim/plug/ui/alpha.nix deleted file mode 100644 index dc59c64..0000000 --- a/modules/editors/nixvim/plug/ui/alpha.nix +++ /dev/null @@ -1,93 +0,0 @@ -{ - programs.nixvim = { - plugins.alpha = let - nixFlake = [ - "⠄⠄⠄⢰⣧⣼⣯⠄⣸⣠⣶⣶⣦⣾⠄⠄⠄⠄⡀⠄⢀⣿⣿⠄⠄⠄⢸⡇⠄⠄" - "⠄⠄⠄⣾⣿⠿⠿⠶⠿⢿⣿⣿⣿⣿⣦⣤⣄⢀⡅⢠⣾⣛⡉⠄⠄⠄⠸⢀⣿⠄" - "⠄⠄⢀⡋⣡⣴⣶⣶⡀⠄⠄⠙⢿⣿⣿⣿⣿⣿⣴⣿⣿⣿⢃⣤⣄⣀⣥⣿⣿⠄" - "⠄⠄⢸⣇⠻⣿⣿⣿⣧⣀⢀⣠⡌⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠿⠿⣿⣿⣿⠄" - "⠄⢀⢸⣿⣷⣤⣤⣤⣬⣙⣛⢿⣿⣿⣿⣿⣿⣿⡿⣿⣿⡍⠄⠄⢀⣤⣄⠉⠋⣰" - "⠄⣼⣖⣿⣿⣿⣿⣿⣿⣿⣿⣿⢿⣿⣿⣿⣿⣿⢇⣿⣿⡷⠶⠶⢿⣿⣿⠇⢀⣤" - "⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣽⣿⣿⣿⡇⣿⣿⣿⣿⣿⣿⣷⣶⣥⣴⣿⡗" - "⢀⠈⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠄" - "⢸⣿⣦⣌⣛⣻⣿⣿⣧⠙⠛⠛⡭⠅⠒⠦⠭⣭⡻⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⠄" - "⠘⣿⣿⣿⣿⣿⣿⣿⣿⡆⠄⠄⠄⠄⠄⠄⠄⠄⠹⠈⢋⣽⣿⣿⣿⣿⣵⣾⠃⠄" - "⠄⠘⣿⣿⣿⣿⣿⣿⣿⣿⠄⣴⣿⣶⣄⠄⣴⣶⠄⢀⣾⣿⣿⣿⣿⣿⣿⠃⠄⠄" - "⠄⠄⠈⠻⣿⣿⣿⣿⣿⣿⡄⢻⣿⣿⣿⠄⣿⣿⡀⣾⣿⣿⣿⣿⣛⠛⠁⠄⠄⠄" - "⠄⠄⠄⠄⠈⠛⢿⣿⣿⣿⠁⠞⢿⣿⣿⡄⢿⣿⡇⣸⣿⣿⠿⠛⠁⠄⠄⠄⠄⠄" - "⠄⠄⠄⠄⠄⠄⠄⠉⠻⣿⣿⣾⣦⡙⠻⣷⣾⣿⠃⠿⠋⠁⠄⠄⠄⠄⠄⢀⣠⣴" - "⣿⣿⣿⣶⣶⣮⣥⣒⠲⢮⣝⡿⣿⣿⡆⣿⡿⠃⠄⠄⠄⠄⠄⠄⠄⣠⣴⣿⣿⣿" - ]; - in { - enable = true; - layout = [ - { - type = "padding"; - val = 4; - } - { - opts = { - hl = "AlphaHeader"; - position = "center"; - }; - type = "text"; - val = nixFlake; - } - { - type = "padding"; - val = 2; - } - { - type = "group"; - val = let - mkButton = shortcut: cmd: val: hl: { - type = "button"; - inherit val; - opts = { - inherit hl shortcut; - keymap = [ - "n" - shortcut - cmd - {} - ]; - position = "center"; - cursor = 0; - width = 40; - align_shortcut = "right"; - hl_shortcut = "Keyword"; - }; - }; - in [ - ( - mkButton - "f" - "lua require('telescope.builtin').find_files({hidden = true})" - "🔍 Find File" - "Operator" - ) - ( - mkButton - "q" - "qa" - "💣 Quit Neovim" - "String" - ) - ]; - } - { - type = "padding"; - val = 2; - } - { - opts = { - hl = "Gruvbox"; - position = "center"; - }; - type = "text"; - val = "https://github.com/bloxx12/nichts"; - } - ]; - }; - }; -} diff --git a/modules/editors/nixvim/plug/ui/btw.nix b/modules/editors/nixvim/plug/ui/btw.nix deleted file mode 100644 index 239e731..0000000 --- a/modules/editors/nixvim/plug/ui/btw.nix +++ /dev/null @@ -1,22 +0,0 @@ -{pkgs, ...}: { - programs.nixvim = { - extraPlugins = with pkgs.vimUtils; [ - (buildVimPlugin { - pname = "btw.nvim"; - version = "2024-04-36"; - src = pkgs.fetchFromGitHub { - owner = "letieu"; - repo = "btw.nvim"; - rev = "47f6419e90d3383987fd06e8f3e06a4bc032ac83"; - hash = "sha256-91DZUfa4FBvXnkcNHdllr82Dr1Ie+MGVD3ibwkqo04c="; - }; - }) - ]; - - extraConfigLua = '' - require('btw').setup({ - text = "I use Neovim (and NixOS, BTW)", - }) - ''; - }; -} diff --git a/modules/editors/nixvim/plug/ui/bufferline.nix b/modules/editors/nixvim/plug/ui/bufferline.nix deleted file mode 100644 index be7aea3..0000000 --- a/modules/editors/nixvim/plug/ui/bufferline.nix +++ /dev/null @@ -1,177 +0,0 @@ -{ - config, - lib, - ... -}: let - colors = import ../../colors/${config.theme}.nix {}; -in { - programs.nixvim = { - plugins = { - bufferline = { - enable = true; - separatorStyle = "slant"; # “slant”, “padded_slant”, “slope”, “padded_slope”, “thick”, “thin” - highlights = { - fill = { - fg = colors.base00; - bg = colors.base00; - }; - background = { - fg = colors.base03; - bg = colors.base00; - }; - bufferSelected = { - fg = colors.base05; - bg = colors.base00; - italic = false; - }; - bufferVisible = { - fg = colors.base03; - bg = colors.base00; - }; - closeButton = { - fg = colors.base03; - bg = colors.base00; - }; - closeButtonVisible = { - fg = colors.base03; - bg = colors.base00; - }; - closeButtonSelected = { - fg = colors.base08; - bg = colors.base00; - }; - - indicatorSelected = { - fg = colors.base00; - bg = colors.base00; - }; - modified = { - fg = colors.base03; - bg = colors.base00; - }; - modifiedVisible = { - fg = colors.base00; - bg = colors.base00; - }; - modifiedSelected = { - fg = colors.base0B; - bg = colors.base00; - }; - tabClose = { - fg = colors.base00; - bg = colors.base00; - }; - }; - }; - }; - keymaps = [ - { - mode = "n"; - key = ""; - action = "BufferLineCycleNext"; - options = { - desc = "Cycle to next buffer"; - }; - } - - { - mode = "n"; - key = ""; - action = "BufferLineCyclePrev"; - options = { - desc = "Cycle to previous buffer"; - }; - } - - { - mode = "n"; - key = ""; - action = "BufferLineCycleNext"; - options = { - desc = "Cycle to next buffer"; - }; - } - - { - mode = "n"; - key = ""; - action = "BufferLineCyclePrev"; - options = { - desc = "Cycle to previous buffer"; - }; - } - - { - mode = "n"; - key = "bd"; - action = "bdelete"; - options = { - desc = "Delete buffer"; - }; - } - - { - mode = "n"; - key = "bb"; - action = "e #"; - options = { - desc = "Switch to Other Buffer"; - }; - } - - # { - # mode = "n"; - # key = "`"; - # action = "e #"; - # options = { - # desc = "Switch to Other Buffer"; - # }; - # } - - { - mode = "n"; - key = "br"; - action = "BufferLineCloseRight"; - options = { - desc = "Delete buffers to the right"; - }; - } - - { - mode = "n"; - key = "bl"; - action = "BufferLineCloseLeft"; - options = { - desc = "Delete buffers to the left"; - }; - } - - { - mode = "n"; - key = "bo"; - action = "BufferLineCloseOthers"; - options = { - desc = "Delete other buffers"; - }; - } - - { - mode = "n"; - key = "bp"; - action = "BufferLineTogglePin"; - options = { - desc = "Toggle pin"; - }; - } - - { - mode = "n"; - key = "bP"; - action = "BufferLineGroupClose ungrouped"; - options = { - desc = "Delete non-pinned buffers"; - }; - } - ]; - }; -} diff --git a/modules/editors/nixvim/plug/ui/noice.nix b/modules/editors/nixvim/plug/ui/noice.nix deleted file mode 100644 index 7d96f43..0000000 --- a/modules/editors/nixvim/plug/ui/noice.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ - programs.nixvim.plugins.noice = { - enable = true; - notify = { - enabled = false; - }; - messages = { - enabled = true; # Adds a padding-bottom to neovim statusline when set to false for some reason - }; - lsp = { - message = { - enabled = true; - }; - progress = { - enabled = false; - view = "mini"; - }; - }; - popupmenu = { - enabled = true; - backend = "nui"; - }; - format = { - filter = { - pattern = [":%s*%%s*s:%s*" ":%s*%%s*s!%s*" ":%s*%%s*s/%s*" "%s*s:%s*" ":%s*s!%s*" ":%s*s/%s*"]; - icon = ""; - lang = "regex"; - }; - replace = { - pattern = [":%s*%%s*s:%w*:%s*" ":%s*%%s*s!%w*!%s*" ":%s*%%s*s/%w*/%s*" "%s*s:%w*:%s*" ":%s*s!%w*!%s*" ":%s*s/%w*/%s*"]; - icon = "󱞪"; - lang = "regex"; - }; - }; - }; -} diff --git a/modules/editors/nixvim/plug/ui/nvim-notify.nix b/modules/editors/nixvim/plug/ui/nvim-notify.nix deleted file mode 100644 index e4b8ff4..0000000 --- a/modules/editors/nixvim/plug/ui/nvim-notify.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ - programs.nixvim = { - plugins.notify = { - enable = true; - backgroundColour = "#000000"; - fps = 60; - render = "default"; - timeout = 1000; - topDown = true; - }; - keymaps = [ - { - mode = "n"; - key = "un"; - action = '' - lua require("notify").dismiss({ silent = true, pending = true }) - ''; - options = { - desc = "Dismiss All Notifications"; - }; - } - ]; - extraConfigLua = '' - local notify = require("notify") - - local filtered_message = { "No information available" } - - -- Override notify function to filter out messages - ---@diagnostic disable-next-line: duplicate-set-field - vim.notify = function(message, level, opts) - local merged_opts = vim.tbl_extend("force", { - on_open = function(win) - local buf = vim.api.nvim_win_get_buf(win) - vim.api.nvim_buf_set_option(buf, "filetype", "markdown") - end, - }, opts or {}) - - for _, msg in ipairs(filtered_message) do - if message == msg then - return - end - end - return notify(message, level, merged_opts) - end - ''; - }; -} diff --git a/modules/editors/nixvim/plug/ui/telescope.nix b/modules/editors/nixvim/plug/ui/telescope.nix deleted file mode 100644 index 645ce14..0000000 --- a/modules/editors/nixvim/plug/ui/telescope.nix +++ /dev/null @@ -1,212 +0,0 @@ -{ - programs.nixvim = { - plugins.telescope = { - enable = true; - extensions = { - file-browser = { - enable = true; - }; - fzf-native = { - enable = true; - }; - }; - settings = { - defaults = { - layout_config = { - horizontal = { - prompt_position = "top"; - }; - }; - sorting_strategy = "ascending"; - }; - }; - keymaps = { - "" = { - action = "find_files, {}"; - options = { - desc = "Find project files"; - }; - }; - "/" = { - action = "live_grep"; - options = { - desc = "Grep (root dir)"; - }; - }; - ":" = { - action = "command_history, {}"; - options = { - desc = "Command History"; - }; - }; - "b" = { - action = "buffers, {}"; - options = { - desc = "+buffer"; - }; - }; - "ff" = { - action = "find_files, {}"; - options = { - desc = "Find project files"; - }; - }; - "fr" = { - action = "live_grep, {}"; - options = { - desc = "Find text"; - }; - }; - "fR" = { - action = "resume, {}"; - options = { - desc = "Resume"; - }; - }; - "fg" = { - action = "oldfiles, {}"; - options = { - desc = "Recent"; - }; - }; - "fb" = { - action = "buffers, {}"; - options = { - desc = "Buffers"; - }; - }; - "" = { - action = "git_files, {}"; - options = { - desc = "Search git files"; - }; - }; - "gc" = { - action = "git_commits, {}"; - options = { - desc = "Commits"; - }; - }; - "gs" = { - action = "git_status, {}"; - options = { - desc = "Status"; - }; - }; - "sa" = { - action = "autocommands, {}"; - options = { - desc = "Auto Commands"; - }; - }; - "sb" = { - action = "current_buffer_fuzzy_find, {}"; - options = { - desc = "Buffer"; - }; - }; - "sc" = { - action = "command_history, {}"; - options = { - desc = "Command History"; - }; - }; - "sC" = { - action = "commands, {}"; - options = { - desc = "Commands"; - }; - }; - "sD" = { - action = "diagnostics, {}"; - options = { - desc = "Workspace diagnostics"; - }; - }; - "sh" = { - action = "help_tags, {}"; - options = { - desc = "Help pages"; - }; - }; - "sH" = { - action = "highlights, {}"; - options = { - desc = "Search Highlight Groups"; - }; - }; - "sk" = { - action = "keymaps, {}"; - options = { - desc = "Keymaps"; - }; - }; - "sM" = { - action = "man_pages, {}"; - options = { - desc = "Man pages"; - }; - }; - "sm" = { - action = "marks, {}"; - options = { - desc = "Jump to Mark"; - }; - }; - "so" = { - action = "vim_options, {}"; - options = { - desc = "Options"; - }; - }; - "sR" = { - action = "resume, {}"; - options = { - desc = "Resume"; - }; - }; - "uC" = { - action = "colorscheme, {}"; - options = { - desc = "Colorscheme preview"; - }; - }; - }; - }; - keymaps = [ - { - mode = "n"; - key = "sd"; - action = "Telescope diagnostics bufnr=0"; - options = { - desc = "Document diagnostics"; - }; - } - { - mode = "n"; - key = "fe"; - action = "Telescope file_browser"; - options = { - desc = "File browser"; - }; - } - { - mode = "n"; - key = "fE"; - action = "Telescope file_browser path=%:p:h select_buffer=true"; - options = { - desc = "File browser"; - }; - } - ]; - extraConfigLua = '' - require("telescope").setup{ - pickers = { - colorscheme = { - enable_preview = true - } - } - } - ''; - }; -} diff --git a/modules/editors/nixvim/plug/utils/comment.nix b/modules/editors/nixvim/plug/utils/comment.nix deleted file mode 100644 index b55ef26..0000000 --- a/modules/editors/nixvim/plug/utils/comment.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - programs.nixvim.plugins.comment = { - enable = true; - }; -} diff --git a/modules/editors/nixvim/plug/utils/copilot.nix b/modules/editors/nixvim/plug/utils/copilot.nix deleted file mode 100644 index 4de0878..0000000 --- a/modules/editors/nixvim/plug/utils/copilot.nix +++ /dev/null @@ -1,58 +0,0 @@ -{ - pkgs, - lib, - ... -}: let - copilotChatRepo = { - owner = "copilotc-nvim"; - repo = "CopilotChat.nvim"; - rev = "2771f1fa7af502ea4226a88a792f4e4319199906"; - hash = "sha256-Q+g81BQVQTY5J2c2ZWB7bjJLuNSdI0PAan+75YJ7mI0="; - }; -in { - programs.nixvim = { - extraPlugins = with pkgs.vimUtils; [ - (buildVimPlugin { - pname = "copilotchat"; - version = "2.4.0"; - src = pkgs.fetchFromGitHub copilotChatRepo; - meta = { - description = "Chat with GitHub Copilot in Neovim"; - homepage = "https://github.com/CopilotC-Nvim/CopilotChat.nvim/"; - license = lib.licenses.gpl3; - }; - }) - ]; - extraConfigLua = '' - require("CopilotChat").setup { } - ''; - - keymaps = [ - { - mode = "x"; - key = "a"; - action = "+copilot"; - } - { - mode = "x"; - key = "ae"; - action = "CopilotChatExplain"; - } - { - mode = "x"; - key = "af"; - action = "CopilotChatFix"; - } - { - mode = "x"; - key = "ad"; - action = "CopilotChatDocs"; - } - { - mode = "x"; - key = "ac"; - action = "CopilotChatCommit"; - } - ]; - }; -} diff --git a/modules/editors/nixvim/plug/utils/flash.nix b/modules/editors/nixvim/plug/utils/flash.nix deleted file mode 100644 index bf078bf..0000000 --- a/modules/editors/nixvim/plug/utils/flash.nix +++ /dev/null @@ -1,58 +0,0 @@ -{ - programs.nixvim = { - plugins.flash = { - enable = true; - labels = "asdfghjklqwertyuiopzxcvbnm"; - search = { - mode = "fuzzy"; - }; - jump = { - autojump = true; - }; - label = { - uppercase = false; - rainbow = { - enabled = false; - shade = 5; - }; - }; - }; - keymaps = [ - { - mode = ["n" "x" "o"]; - key = "s"; - action = "lua require('flash').jump()"; - options = { - desc = "Flash"; - }; - } - - { - mode = ["n" "x" "o"]; - key = "S"; - action = "lua require('flash').treesitter()"; - options = { - desc = "Flash Treesitter"; - }; - } - - { - mode = "o"; - key = "r"; - action = "lua require('flash').remote()"; - options = { - desc = "Remote Flash"; - }; - } - - { - mode = ["x" "o"]; - key = "R"; - action = "lua require('flash').treesitter_search()"; - options = { - desc = "Treesitter Search"; - }; - } - ]; - }; -} diff --git a/modules/editors/nixvim/plug/utils/grapple.nix b/modules/editors/nixvim/plug/utils/grapple.nix deleted file mode 100644 index 962591a..0000000 --- a/modules/editors/nixvim/plug/utils/grapple.nix +++ /dev/null @@ -1,22 +0,0 @@ -{pkgs, ...}: { - programs.nixvim = { - extraPlugins = with pkgs.vimUtils; [ - (buildVimPlugin { - pname = "grapple.nvim"; - version = "1.0"; - src = pkgs.fetchFromGitHub { - owner = "cbochs"; - repo = "grapple.nvim"; - rev = "59d458e378c4884f22b7a68e61c07ed3e41aabf0"; - hash = "sha256-4k8BE9i8kG4pL7Fj0xw9cG8sjA0u4jzJ40WSV/lBFhY="; - }; - }) - ]; - - extraConfigLua = '' - require('grapple').setup({ - scope = "git_branch", - }) - ''; - }; -} diff --git a/modules/editors/nixvim/plug/utils/hardtime.nix b/modules/editors/nixvim/plug/utils/hardtime.nix deleted file mode 100644 index 5dabd50..0000000 --- a/modules/editors/nixvim/plug/utils/hardtime.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ - programs.nixvim.plugins.hardtime = { - enable = true; - enabled = true; - disableMouse = true; - disabledFiletypes = ["Oil"]; - hint = true; - maxCount = 2; - maxTime = 1000; - restrictionMode = "hint"; - restrictedKeys = { - "h" = ["n" "x"]; - "j" = ["n" "x"]; - "k" = ["n" "x"]; - "l" = ["n" "x"]; - "-" = ["n" "x"]; - "+" = ["n" "x"]; - "gj" = ["n" "x"]; - "gk" = ["n" "x"]; - "" = ["n" "x"]; - "" = ["n" "x"]; - "" = ["n" "x"]; - "" = ["n" "x"]; - }; - }; -} diff --git a/modules/editors/nixvim/plug/utils/harpoon.nix b/modules/editors/nixvim/plug/utils/harpoon.nix deleted file mode 100644 index 0338407..0000000 --- a/modules/editors/nixvim/plug/utils/harpoon.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - programs.nixvim.plugins.harpoon = { - enable = true; - enableTelescope = true; - keymapsSilent = true; - keymaps = { - addFile = "ha"; - toggleQuickMenu = ""; - navFile = { - "1" = "hj"; - "2" = "hk"; - "3" = "hl"; - "4" = "hm"; - }; - }; - }; -} diff --git a/modules/editors/nixvim/plug/utils/illuminate.nix b/modules/editors/nixvim/plug/utils/illuminate.nix deleted file mode 100644 index f0bd7d4..0000000 --- a/modules/editors/nixvim/plug/utils/illuminate.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ - programs.nixvim.plugins.illuminate = { - enable = true; - underCursor = false; - filetypesDenylist = [ - "Outline" - "TelescopePrompt" - "alpha" - "harpoon" - "reason" - ]; - }; -} diff --git a/modules/editors/nixvim/plug/utils/lazy.nix b/modules/editors/nixvim/plug/utils/lazy.nix deleted file mode 100644 index 7a7b5cb..0000000 --- a/modules/editors/nixvim/plug/utils/lazy.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - programs.nixvim.plugins.lazy = { - enable = true; - }; -} diff --git a/modules/editors/nixvim/plug/utils/nvim-autopairs.nix b/modules/editors/nixvim/plug/utils/nvim-autopairs.nix deleted file mode 100644 index d86c709..0000000 --- a/modules/editors/nixvim/plug/utils/nvim-autopairs.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - programs.nixvim.plugins.nvim-autopairs = { - enable = true; - }; -} diff --git a/modules/editors/nixvim/plug/utils/oil.nix b/modules/editors/nixvim/plug/utils/oil.nix deleted file mode 100644 index 0c95a21..0000000 --- a/modules/editors/nixvim/plug/utils/oil.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ - programs.nixvim = { - plugins.oil = { - enable = true; - settings = { - useDefaultKeymaps = true; - deleteToTrash = true; - float = { - padding = 2; - maxWidth = 0; # ''math.ceil(vim.o.lines * 0.8 - 4)''; - maxHeight = 0; # ''math.ceil(vim.o.columns * 0.8)''; - border = "rounded"; # 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open - winOptions = { - winblend = 0; - }; - }; - preview = { - border = "rounded"; - }; - keymaps = { - "g?" = "actions.show_help"; - "" = "actions.select"; - "" = "actions.select_vsplit"; - "" = "actions.select_split"; # this is used to navigate left - "" = "actions.select_tab"; - "" = "actions.preview"; - "" = "actions.close"; - "" = "actions.refresh"; - "-" = "actions.parent"; - "_" = "actions.open_cwd"; - "`" = "actions.cd"; - "~" = "actions.tcd"; - "gs" = "actions.change_sort"; - "gx" = "actions.open_external"; - "g." = "actions.toggle_hidden"; - "q" = "actions.close"; - }; - }; - }; - keymaps = [ - { - mode = "n"; - key = "-"; - action = ":Oil"; - options = { - desc = "Open parent directory"; - silent = true; - }; - } - ]; - }; -} diff --git a/modules/editors/nixvim/plug/utils/ufo.nix b/modules/editors/nixvim/plug/utils/ufo.nix deleted file mode 100644 index c796c4b..0000000 --- a/modules/editors/nixvim/plug/utils/ufo.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - programs.nixvim.plugins.nvim-ufo = { - enable = true; - }; -} diff --git a/modules/editors/nixvim/plug/utils/undotree.nix b/modules/editors/nixvim/plug/utils/undotree.nix deleted file mode 100644 index 8640c0b..0000000 --- a/modules/editors/nixvim/plug/utils/undotree.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ - programs.nixvim = { - plugins.undotree = { - enable = true; - settings = { - autoOpenDiff = true; - focusOnToggle = true; - }; - }; - keymaps = [ - { - mode = "n"; - key = "ut"; - action = "UndotreeToggle"; - options = { - silent = true; - desc = "Undotree"; - }; - } - ]; - }; -} diff --git a/modules/editors/nixvim/plug/utils/whichkey.nix b/modules/editors/nixvim/plug/utils/whichkey.nix deleted file mode 100644 index 3841b71..0000000 --- a/modules/editors/nixvim/plug/utils/whichkey.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - programs.nixvim.plugins.which-key = { - enable = true; - }; -} diff --git a/modules/editors/nixvim/settings.nix b/modules/editors/nixvim/settings.nix deleted file mode 100644 index f5a5c74..0000000 --- a/modules/editors/nixvim/settings.nix +++ /dev/null @@ -1,87 +0,0 @@ -{ - config = { - programs.nixvim.opts = { - # Enable relative line numbers - number = true; - relativenumber = true; - # Set tabs to 2 spaces - tabstop = 2; - softtabstop = 2; - showtabline = 2; - expandtab = true; - - # Enable auto indenting and set it to spaces - smartindent = true; - shiftwidth = 2; - # Enable smart indenting (see https://stackoverflow.com/questions/1204149/smart-wrap-in-vim) - breakindent = true; - - # Enable incremental searching - hlsearch = true; - incsearch = true; - - # Enable text wrap - wrap = true; - - # Better splitting - splitbelow = true; - splitright = true; - - # Enable mouse mode - mouse = "a"; # Mouse - - # Enable ignorecase + smartcase for better searching - ignorecase = true; - smartcase = true; # Don't ignore case with capitals - grepprg = "rg --vimgrep"; - grepformat = "%f:%l:%c:%m"; - - # Decrease updatetime - updatetime = 50; # faster completion (4000ms default) - - # Set completeopt to have a better completion experience - completeopt = ["menuone" "noselect" "noinsert"]; # mostly just for cmp - - # Enable persistent undo history - swapfile = false; - backup = false; - undofile = true; - - # Enable 24-bit colors - termguicolors = true; - - # Enable the sign column to prevent the screen from jumping - # signcolumn = "yes"; - - # Enable cursor line highlight - cursorline = true; # Highlight the line where the cursor is located - - # Set fold settings - # These options were reccommended by nvim-ufo - # See: https://github.com/kevinhwang91/nvim-ufo#minimal-configuration - foldcolumn = "0"; - foldlevel = 99; - foldlevelstart = 99; - foldenable = true; - - # Always keep 8 lines above/below cursor unless at start/end of file - scrolloff = 8; - - # Place a column line - # colorcolumn = "80"; - - # Reduce which-key timeout to 10ms - timeoutlen = 10; - - # Set encoding type - encoding = "utf-8"; - fileencoding = "utf-8"; - - # More space in the neovim command line for displaying messages - cmdheight = 0; - - # We don't need to see things like INSERT anymore - showmode = false; - }; - }; -} diff --git a/modules/editors/nvf/default.nix b/modules/editors/nvf/default.nix index 688e37a..d2ecc42 100644 --- a/modules/editors/nvf/default.nix +++ b/modules/editors/nvf/default.nix @@ -1,4 +1,3 @@ -# credits to raf, his repo is in the README.md! { pkgs, config, @@ -6,10 +5,12 @@ inputs, ... }: let + cfg = config.modules.system.programs.editors.neovim; inherit (builtins) filter map toString elem; inherit (lib.filesystem) listFilesRecursive; inherit (lib.strings) hasSuffix; inherit (lib.lists) concatLists; + inherit (lib) mkIf; mkNeovimModule = { path, @@ -23,14 +24,16 @@ nvf = inputs.neovim-flake; in { - environment.systemPackages = with pkgs; [ - typstyle - ]; - imports = concatLists [ - # neovim-flake home-manager module - [nvf.nixosModules.default] - # construct this entire directory as a module - # which means all default.nix files will be imported automtically - (mkNeovimModule {path = ./.;}) - ]; + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + typstyle + ]; + imports = concatLists [ + # neovim-flake home-manager module + [nvf.nixosModules.default] + # construct this entire directory as a module + # which means all default.nix files will be imported automtically + (mkNeovimModule {path = ./.;}) + ]; + }; } diff --git a/modules/gui/default.nix b/modules/gui/default.nix index cfbe3da..7428284 100644 --- a/modules/gui/default.nix +++ b/modules/gui/default.nix @@ -8,7 +8,6 @@ _: { ./qt.nix ./zathura.nix ./spicetify.nix - ./anyrun ./rofi.nix ./kitty.nix #./vivado.nix diff --git a/modules/gui/foot.nix b/modules/gui/foot.nix index b45efd4..baa628a 100644 --- a/modules/gui/foot.nix +++ b/modules/gui/foot.nix @@ -5,23 +5,17 @@ pkgs, ... }: let - cfg = config.modules.programs.foot; + cfg = config.modules.system.programs.terminals.foot; inherit (config.modules.other.system) username; - inherit (lib) mkEnableOption mkIf; + inherit (lib) mkIf; in { - options.modules.programs.foot = { - enable = mkEnableOption "foot"; - server = mkEnableOption "foot server mode"; - }; - config = mkIf cfg.enable { environment.sessionVariables = {TERM = "foot";}; home-manager.users.${username} = { programs.foot = { enable = true; package = inputs.nixpkgs-wayland.packages.${pkgs.system}.foot; - server.enable = cfg.server; settings = { main = { term = "foot"; diff --git a/modules/gui/kitty.nix b/modules/gui/kitty.nix index 16c4f5b..5367313 100644 --- a/modules/gui/kitty.nix +++ b/modules/gui/kitty.nix @@ -1,26 +1,21 @@ { config, lib, - pkgs, ... }: with lib; let - cfg = config.modules.programs.kitty; - username = config.modules.other.system.username; + cfg = config.modules.system.programs.terminals.kitty; + inherit (config.modules.other.system) username; in { - options.modules.programs.kitty.enable = mkEnableOption "kitty"; - config = mkIf cfg.enable { home-manager.users.${username} = { programs.kitty = { enable = true; settings = { - # font_size = "13.0"; mouse_hide_wait = -1; allow_remote_control = true; url_style = "curly"; open_url_with = "default"; - #background_opacity = "0.9"; confirm_os_window_close = "0"; }; }; diff --git a/modules/gui/mpv.nix b/modules/gui/mpv.nix index 50a3f2c..9312f28 100644 --- a/modules/gui/mpv.nix +++ b/modules/gui/mpv.nix @@ -3,13 +3,11 @@ lib, pkgs, ... -}: -with lib; let - cfg = config.modules.programs.mpv; - username = config.modules.other.system.username; +}: let + cfg = config.modules.usrEnv.programs.media.mpv; + inherit (config.modules.other.system) username; + inherit (lib) mkIf; in { - options.modules.programs.mpv.enable = mkEnableOption "mpv"; - config = mkIf cfg.enable { home-manager.users.${username} = { programs.mpv = { diff --git a/modules/gui/schizofox.nix b/modules/gui/schizofox.nix deleted file mode 100644 index 3aa9994..0000000 --- a/modules/gui/schizofox.nix +++ /dev/null @@ -1,145 +0,0 @@ -{ - config, - inputs, - lib, - ... -}: let - cfg = config.modules.programs.schizofox; - inherit (config.modules.other.system) username; - - inherit (lib) mkEnableOption mkIf; -in { - options.modules.programs.schizofox = {enable = mkEnableOption "schizofox";}; - - config = mkIf cfg.enable { - home-manager.users.${username} = { - imports = [inputs.schizofox.homeManagerModule]; - - programs.schizofox = { - enable = true; - theme = { - # colors = { - # background-darker = "181825"; - # background = "1e1e2e"; - # foreground = "cdd6f4"; - # }; - colors = { - background-darker = "1d2021"; - background = "282828"; - foreground = "ebdbb2"; - }; - - font = "Lexend"; - extraUserChrome = '' - body { - color: red !important; - } - ''; - }; - search = { - defaultSearchEngine = "DuckDuckGo"; - removeEngines = ["Google" "Bing" "Amazon.com" "eBay" "Twitter" "Wikipedia"]; - addEngines = [ - { - Name = "NixOS Packages"; - Description = "NixOS Unstable package search"; - Alias = "!np"; - Method = "GET"; - URLTemplate = "https://search.nixos.org/packages?channel=unstable&query={searchTerms}"; - } - { - Name = "NixOS Options"; - Description = "NixOS Unstable option search"; - Alias = "!no"; - Method = "GET"; - URLTemplate = "https://search.nixos.org/options?channel=unstable&query={searchTerms}"; - } - { - Name = "NixOS Wiki"; - Description = "NixOS Wiki search"; - Alias = "!nw"; - Method = "GET"; - URLTemplate = "https://nixos.wiki/index.php?search={searchTerms}"; - } - { - Name = "Home Manager Options"; - Description = "Home Manager option search"; - Alias = "!hm"; - Method = "GET"; - URLTemplate = "https://home-manager-options.extranix.com/?query={searchTerms}&release=master"; - } - { - Name = "Arch Wiki"; - Description = "Arch Wiki search"; - Alias = "!aw"; - Method = "GET"; - URLTemplate = "https://wiki.archlinux.org/index.php?search={searchTerms}"; - } - { - Name = "Gentoo Wiki"; - Description = "Gentoo Wiki search"; - Alias = "!gw"; - Method = "GET"; - URLTemplate = "https://wiki.gentoo.org/index.php?search={searchTerms}"; - } - { - Name = "Debian Wiki"; - Description = "Debian Wiki search"; - Alias = "!dw"; - Method = "GET"; - URLTemplate = "https://wiki.debian.org/FrontPage?action=fullsearch&value={searchTerms}"; - } - { - Name = "noogle"; - Descriptiom = "Noogle Search"; - Alias = "!ng"; - Method = "GET"; - URLTemplate = "https://noogle.dev/"; - } - ]; - }; - extensions = { - simplefox.enable = true; - darkreader.enable = true; - extraExtensions = let - mkUrl = name: "https://addons.mozilla.org/firefox/downloads/latest/${name}/latest.xpi"; - extensions = [ - { - id = "1018e4d6-728f-4b20-ad56-37578a4de76"; - name = "flagfox"; - } - { - id = "{c2c003ee-bd69-42a2-b0e9-6f34222cb046}"; - name = "auto-tab-discard"; - } - { - id = "{a4c4eda4-fb84-4a84-b4a1-f7c1cbf2a1ad}"; - name = "refined-github-"; - } - { - id = "sponsorBlocker@ajay.app"; - name = "sponsorblock"; - } - { - id = "uBlock0@raymondhill.net"; - name = "UBlock Origin"; - } - ]; - extraExtensions = builtins.foldl' (acc: ext: acc // {ext.id = {install_url = mkUrl ext.name;};}) {} extensions; - in - extraExtensions; - }; - security = { - sanitizeOnShutdown = false; - sandbox = true; - userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0"; - }; - - misc = { - drm.enable = true; - disableWebgl = true; - }; - }; - }; - }; -} diff --git a/modules/gui/spicetify.nix b/modules/gui/spicetify.nix index 762b6c4..a4cbd4d 100644 --- a/modules/gui/spicetify.nix +++ b/modules/gui/spicetify.nix @@ -5,12 +5,11 @@ inputs, ... }: let - cfg = config.modules.programs.spicetify; - username = config.modules.other.system.username; + cfg = config.modules.system.programs.spotify; + inherit (config.modules.other.system) username; spicePkgs = inputs.spicetify-nix.packages.${pkgs.system}.default; # inherit (inputs.spicetify-nix.packages.${pkgs.system}) spicetify-nix; in { - options.modules.programs.spicetify.enable = lib.mkEnableOption "spicetify"; config = lib.mkIf cfg.enable { home-manager.users.${username} = { imports = [inputs.spicetify-nix.homeManagerModule]; diff --git a/modules/gui/vesktop.nix b/modules/gui/vesktop.nix index ca4c78a..2bd40fe 100644 --- a/modules/gui/vesktop.nix +++ b/modules/gui/vesktop.nix @@ -5,11 +5,9 @@ ... }: with lib; let - cfg = config.modules.programs.vesktop; - username = config.modules.other.system.username; + cfg = config.modules.system.programs.discord; + inherit (config.modules.other.system) username; in { - options.modules.programs.vesktop = {enable = mkEnableOption "vesktop";}; - config = mkIf cfg.enable { home-manager.users.${username} = { home.packages = with pkgs; [vesktop]; diff --git a/modules/gui/zathura.nix b/modules/gui/zathura.nix index 17e61de..088012d 100644 --- a/modules/gui/zathura.nix +++ b/modules/gui/zathura.nix @@ -5,7 +5,7 @@ ... }: with lib; let - cfg = config.modules.programs.zathura; + cfg = config.modules.system.programs.zathura; inherit (config.modules.other.system) username; catppuccin = pkgs.fetchFromGitHub { owner = "catppuccin"; @@ -14,8 +14,6 @@ with lib; let hash = "sha256-/vD/hOi6KcaGyAp6Az7jL5/tQSGRzIrf0oHjAJf4QbI="; }; in { - options.modules.programs.zathura.enable = mkEnableOption "zathura"; - config = mkIf cfg.enable { home-manager.users.${username} = { xdg.configFile."zathura/catppuccin-mocha".source = "${catppuccin}/src/catppuccin-mocha"; diff --git a/modules/options/style/gtk.nix b/modules/options/style/gtk.nix new file mode 100644 index 0000000..e69de29 diff --git a/modules/options/style/module.nix b/modules/options/style/module.nix new file mode 100644 index 0000000..b63d7b4 --- /dev/null +++ b/modules/options/style/module.nix @@ -0,0 +1,7 @@ +_: { + imports = [ + ./stylix.nix + # ./qt.nix + # ./gtk.nix + ]; +} diff --git a/modules/options/style/qt.nix b/modules/options/style/qt.nix new file mode 100644 index 0000000..e69de29 diff --git a/modules/options/style/stylix.nix b/modules/options/style/stylix.nix new file mode 100644 index 0000000..ed6a023 --- /dev/null +++ b/modules/options/style/stylix.nix @@ -0,0 +1,47 @@ +{ + config, + lib, + ... +}: let + inherit (lib) types mkEnableOption mkOption; +in { + options.modules.usrEnv.style.stylix = { + enable = mkEnableOption "Stylix style Manager"; + scheme = mkOption { + description = "Color Scheme"; + type = types.str; + }; + image = mkOption { + description = "Image"; + type = types.path; + }; + cursor = { + size = mkOption { + description = "Cursor Size"; + type = types.int; + }; + package = mkOption { + description = "Cursor Package"; + type = types.package; + }; + name = mkOption { + description = "Cursor Name"; + type = types.str; + }; + }; + fontsizes = { + terminal = mkOption { + description = "Terminal font size"; + type = types.int; + }; + popups = mkOption { + description = "Popup font size"; + type = types.int; + }; + applications = mkOption { + description = "Application font size"; + type = types.int; + }; + }; + }; +} diff --git a/modules/options/system/module.nix b/modules/options/system/module.nix new file mode 100644 index 0000000..c0b6787 --- /dev/null +++ b/modules/options/system/module.nix @@ -0,0 +1,118 @@ +{ + config, + lib, + ... +}: let + inherit (builtins) elemAt; + inherit (lib.options) mkOption mkEnableOption; + inherit (lib.modules) mkMerge; + inherit (lib.lists) optionals; + inherit (lib.types) enum listOf str nullOr bool package; +in { + imports = [ + # configuration options for nixos activation scripts + # ./activation.nix + + # boot/impermanence mounts + # ./boot.nix + # ./impermanence.nix + + # network and overall hardening + ./networking + # ./security.nix + # ./encryption.nix + + # filesystems + # ./fs.nix + + # emulation and virtualization + # ./emulation.nix + # ./virtualization.nix + + # package and program related options + # ./services + ./programs + + # systemd-nspawn containers + # ./containers.nix + ]; + config = { + warnings = mkMerge [ + (optionals (config.modules.system.users == []) [ + '' + You have not added any users to be supported by your system. You may end up with an unbootable system! + + Consider setting {option}`config.modules.system.users` in your configuration + '' + ]) + ]; + }; + + options.modules.system = { + mainUser = mkOption { + type = enum config.modules.system.users; + default = elemAt config.modules.system.users 0; + description = '' + The username of the main user for your system. + + In case of a multiple systems, this will be the user with priority in ordered lists and enabled options. + ''; + }; + + users = mkOption { + type = listOf str; + default = ["charlie"]; + description = "A list of home-manager users on the system."; + }; + + autoLogin = mkOption { + type = bool; + default = false; + description = '' + Whether to enable passwordless login. This is generally useful on systems with + FDE (Full Disk Encryption) enabled. It is a security risk for systems without FDE. + ''; + }; + + yubikeySupport = { + enable = mkEnableOption "yubikey support"; + deviceType = mkOption { + type = nullOr (enum ["NFC5" "nano"]); + default = null; + description = "A list of device models to enable Yubikey support for"; + }; + }; + + sound = { + enable = mkEnableOption "sound related programs and audio-dependent programs"; + }; + + video = { + enable = mkEnableOption "video drivers and programs that require a graphical user interface"; + }; + + bluetooth = { + enable = mkEnableOption "bluetooth modules, drivers and configuration program(s)"; + }; + + # should the device enable printing module and try to load common printer modules + # you might need to add more drivers to the printing module for your printer to work + printing = { + enable = mkEnableOption "printing"; + extraDrivers = mkOption { + type = listOf str; + default = []; + description = "A list of extra drivers to enable for printing"; + }; + + "3d" = { + enable = mkEnableOption "3D printing suite"; + extraPrograms = mkOption { + type = listOf package; + default = []; + description = "A list of extra programs to enable for 3D printing"; + }; + }; + }; + }; +} diff --git a/modules/options/system/networking/default.nix b/modules/options/system/networking/default.nix new file mode 100644 index 0000000..8a8c298 --- /dev/null +++ b/modules/options/system/networking/default.nix @@ -0,0 +1,7 @@ +{lib, ...}: let + inherit (lib) mkEnableOption mkOption types; +in { + options.modules.system.networking = { + nftbles.enable = mkEnableOption "Nftables firewall"; + }; +} diff --git a/modules/options/system/programs/default.nix b/modules/options/system/programs/default.nix new file mode 100644 index 0000000..2a18c33 --- /dev/null +++ b/modules/options/system/programs/default.nix @@ -0,0 +1,53 @@ +{lib, ...}: let + inherit (lib) mkEnableOption mkOption types; +in { + options.modules.system.programs = { + editors = { + emacs.enable = mkEnableOption "Emacs operatig system"; + neovim.enable = mkEnableOption "Neovim text editor"; + helix.enable = mkEnableOption "Helix text editor"; + kakoune.enable = mkEnableOption "Kakoune text editor"; + }; + + discord.enable = mkEnableOption "Discord messenger"; + spotify.enable = mkEnableOption "Spotify music client"; + zathura.enable = mkEnableOption "Zathura pdf viewer"; + nextcloud.enable = mkEnableOption "Nextcloud sync client"; + firefox.enable = mkEnableOption "Firefox web browser"; + + terminals = { + foot.enable = mkEnableOption "Foot terminal emulator"; + kitty.enable = mkEnableOption "Kitty terminal emulator"; + }; + + git = { + signingKey = mkOption { + type = types.str; + default = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILPiRe9OH/VtWFWyy5QbAVcN7CLxr4zUtRCwmxD6aeN6"; + description = "The default gpg key used for signing commits"; + }; + }; + default = { + terminal = mkOption { + type = types.enum ["foot" "kitty"]; + default = "foot"; + }; + fileManager = mkOption { + type = types.enum ["thunar" "dolphin" "nemo"]; + default = "thunar"; + }; + browser = mkOption { + type = types.enum ["firefox" "librewolf" "chromium"]; + default = "firefox"; + }; + editor = mkOption { + type = types.enum ["neovim" "helix" "emacs"]; + default = "emacs"; + }; + launcher = mkOption { + type = types.enum ["anyrun" "rofi" "wofi"]; + default = "anyrun"; + }; + }; + }; +} diff --git a/modules/options/usrEnv/desktop.nix b/modules/options/usrEnv/desktop.nix new file mode 100644 index 0000000..8ad6129 --- /dev/null +++ b/modules/options/usrEnv/desktop.nix @@ -0,0 +1,77 @@ +{ + inputs, + config, + pkgs, + lib, + ... +}: let + cfg = config.modules.usrEnv; + inherit (lib.options) mkOption; + inherit (lib.types) bool enum package; +in { + options.modules.usrEnv = { + desktop = mkOption { + type = enum ["none" "Hyprland" "awesomewm" "i3"]; + default = "none"; + description = '' + The desktop environment to be used. + ''; + }; + + desktops = { + hyprland = { + enable = mkOption { + type = bool; + default = cfg.desktop == "Hyprland"; + description = '' + Whether to enable Hyprland wayland compositor. + + Will be enabled automatically when `modules.usrEnv.desktop` + is set to "Hyprland". + + ''; + }; + + package = mkOption { + type = package; + default = inputs.hyprland.packages.${pkgs.system}.hyprland; + description = '' + The Hyprland package to be used. + ''; + }; + }; + + awesomwm.enable = mkOption { + type = bool; + default = cfg.desktop == "awesomewm"; + description = '' + Whether to enable Awesome window manager + + Will be enabled automatically when `modules.usrEnv.desktop` + is set to "awesomewm". + ''; + }; + + i3 = { + enable = mkOption { + type = bool; + default = cfg.desktop == "i3"; + description = '' + Whether to enable i3 window manager + + Will be enabled automatically when `modules.usrEnv.desktop` + is set to "i3". + ''; + }; + + package = mkOption { + type = package; + default = pkgs.i3; + description = '' + The i3 package to be used. + ''; + }; + }; + }; + }; +} diff --git a/modules/options/usrEnv/programs/launchers.nix b/modules/options/usrEnv/programs/launchers.nix new file mode 100644 index 0000000..bb9499c --- /dev/null +++ b/modules/options/usrEnv/programs/launchers.nix @@ -0,0 +1,9 @@ +{lib, ...}: let + inherit (lib.options) mkEnableOption; +in { + options.modules.usrEnv.programs.launchers = { + anyrun.enable = mkEnableOption "anyrun application launcher"; + rofi.enable = mkEnableOption "rofi application launcher"; + tofi.enable = mkEnableOption "tofi application launcher"; + }; +} diff --git a/modules/options/usrEnv/programs/media.nix b/modules/options/usrEnv/programs/media.nix new file mode 100644 index 0000000..209aa7a --- /dev/null +++ b/modules/options/usrEnv/programs/media.nix @@ -0,0 +1,60 @@ +{ + config, + pkgs, + lib, + ... +}: let + inherit (lib.options) mkOption mkEnableOption literalExpression; + inherit (lib.types) bool listOf package; +in { + options.modules.usrEnv.programs.media = { + addDefaultPackages = mkOption { + type = bool; + default = true; + description = '' + Whether to enable the default list of media-related packages ranging from audio taggers + to video editors. + ''; + }; + + extraPackages = mkOption { + type = listOf package; + default = []; + description = '' + Additional packages that will be appended to media related packages. + ''; + }; + + ncmpcpp.enable = mkEnableOption "ncmpcpp TUI music player"; + + beets.enable = + mkEnableOption '' + beets media library system. + + + Will be enabled automatically if {option}`config.modules.usrEnv.services.mpd.enabled` + is set to true + '' + // {default = config.modules.usrEnv.services.media.mpd.enable;}; + + mpv = { + enable = mkEnableOption "mpv media player"; + scripts = mkOption { + type = listOf package; + description = "A list of MPV scripts that will be enabled"; + example = literalExpression ''[ pkgs.mpvScripts.cutter ]''; + default = with pkgs.mpvScripts; [ + # from nixpkgs + cutter # cut and automatically concat videos + mpris # MPRIS plugin + thumbnail # OSC seekbar thumbnails + thumbfast # on-the-fly thumbnailer + sponsorblock # skip sponsored segments + uosc # proximity UI + quality-menu # ytdl-format quality menu + seekTo # seek to specific pos. + ]; + }; + }; + }; +} diff --git a/modules/options/usrEnv/services/default.nix b/modules/options/usrEnv/services/default.nix new file mode 100644 index 0000000..12e3ee4 --- /dev/null +++ b/modules/options/usrEnv/services/default.nix @@ -0,0 +1,14 @@ +{lib, ...}: let + inherit (lib.options) mkOption mkEnableOption; + inherit (lib) types; +in { + options.modules.usrEnv.services.media = { + mpd = { + enable = mkEnableOption "mpd service"; + musicDirectory = mkOption { + description = "music directory for mpd"; + type = types.str; + }; + }; + }; +} diff --git a/modules/other/home-manager.nix b/modules/other/home-manager.nix index 6f724cc..61d6176 100644 --- a/modules/other/home-manager.nix +++ b/modules/other/home-manager.nix @@ -7,7 +7,7 @@ }: with lib; let cfg = config.modules.other.home-manager; - username = config.modules.other.system.username; + inherit (config.modules.other.system) username; in { options.modules.other.home-manager = { enable = mkEnableOption "home-manager"; diff --git a/modules/gui/anyrun/anyrun.nix b/modules/runners/anyrun/anyrun.nix similarity index 94% rename from modules/gui/anyrun/anyrun.nix rename to modules/runners/anyrun/anyrun.nix index bafb125..46db3e4 100644 --- a/modules/gui/anyrun/anyrun.nix +++ b/modules/runners/anyrun/anyrun.nix @@ -7,9 +7,8 @@ }: with lib; let inherit (config.modules.other.system) username; - cfg = config.modules.programs.anyrun; + cfg = config.modules.usrEnv.programs.launchers.anyrun; in { - options.modules.programs.anyrun.enable = mkEnableOption "anyrun"; config = mkIf cfg.enable { home-manager.users.${username} = { imports = [inputs.anyrun.homeManagerModules.default]; diff --git a/modules/gui/anyrun/default.nix b/modules/runners/anyrun/default.nix similarity index 100% rename from modules/gui/anyrun/default.nix rename to modules/runners/anyrun/default.nix diff --git a/modules/gui/anyrun/style.css b/modules/runners/anyrun/style.css similarity index 100% rename from modules/gui/anyrun/style.css rename to modules/runners/anyrun/style.css diff --git a/modules/runners/default.nix b/modules/runners/default.nix new file mode 100644 index 0000000..83416d6 --- /dev/null +++ b/modules/runners/default.nix @@ -0,0 +1,6 @@ +_: { + imports = [ + ./rofi + ./anyrun + ]; +} diff --git a/modules/services/mpd.nix b/modules/services/mpd.nix index 7d72a5a..c336018 100644 --- a/modules/services/mpd.nix +++ b/modules/services/mpd.nix @@ -4,22 +4,11 @@ pkgs, ... }: let - cfg = config.modules.services.mpd; + cfg = config.modules.usrEnv.services.media.mpd; inherit (config.modules.other.system) username; - - inherit (lib) mkEnableOption mkIf mkOption; - inherit (lib.types) str; + inherit (lib) mkIf; in { - options.modules.services.mpd = { - enable = mkEnableOption "mpd"; - musicDirectory = mkOption { - description = "music directory for mpd"; - type = str; - }; - }; - config = mkIf cfg.enable { - environment.systemPackages = with pkgs; [mpc-cli]; systemd.services.mpd.environment = { # https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/609 XDG_RUNTIME_DIR = "/run/user/1000"; @@ -48,6 +37,7 @@ in { ''; }; home-manager.users.${username} = { + home.Packages = with pkgs; [mpc-cli]; services = { mpd-mpris = { enable = true; diff --git a/modules/services/pipewire.nix b/modules/services/pipewire.nix index 0219222..b2090c5 100644 --- a/modules/services/pipewire.nix +++ b/modules/services/pipewire.nix @@ -4,10 +4,8 @@ ... }: with lib; let - cfg = config.modules.services.pipewire; + cfg = config.modules.system.sound; in { - options.modules.services.pipewire.enable = mkEnableOption "pipewire"; - config = mkIf cfg.enable { hardware.pulseaudio.enable = false; services.pipewire = { diff --git a/modules/styling/stylix.nix b/modules/styling/stylix.nix index 00ffff1..97f7367 100644 --- a/modules/styling/stylix.nix +++ b/modules/styling/stylix.nix @@ -6,51 +6,11 @@ ... }: let cfg = config.modules.theming.stylix; - inherit (config.modules.theming.stylix) scheme image; - inherit (config.modules.theming.stylix.cursor) size; - inherit (config.modules.theming.stylix.fontsizes) terminal popups applications; + inherit (config.modules.usrEnv.style.stylix) scheme image cursor fontsizes; + inherit (lib) mkIf; in { imports = [inputs.stylix.nixosModules.stylix]; - options.modules.theming.stylix = { - enable = lib.mkEnableOption "stylix"; - scheme = lib.mkOption { - description = " Color Scheme"; - type = lib.types.str; - }; - image = lib.mkOption { - description = "Image"; - type = lib.types.path; - }; - cursor = { - size = lib.mkOption { - description = "Cursor Size"; - type = lib.types.int; - }; - package = lib.mkOption { - description = "Cursor Package"; - type = lib.types.package; - }; - name = lib.mkOption { - description = "Cursor Name"; - type = lib.types.str; - }; - }; - fontsizes = { - terminal = lib.mkOption { - description = "Terminal font size"; - type = lib.types.int; - }; - popups = lib.mkOption { - description = "Popup font size"; - type = lib.types.int; - }; - applications = lib.mkOption { - description = "Application font size"; - type = lib.types.int; - }; - }; - }; - config = lib.mkIf cfg.enable { + config = mkIf cfg.enable { stylix = { enable = true; homeManagerIntegration.followSystem = true; @@ -59,13 +19,13 @@ in { polarity = "dark"; autoEnable = true; cursor = { - inherit size; - package = pkgs.bibata-cursors; - name = "Bibata-Modern-Classic"; + inherit (cursor) size package name; + # package = pkgs.bibata-cursors; + # name = "Bibata-Modern-Classic"; }; fonts = { sizes = { - inherit terminal popups applications; + inherit (fontsizes) terminal popups applications; }; monospace = { package = diff --git a/modules/tui/ncmpcpp.nix b/modules/tui/ncmpcpp.nix index 38ec9e0..143713f 100644 --- a/modules/tui/ncmpcpp.nix +++ b/modules/tui/ncmpcpp.nix @@ -5,12 +5,10 @@ ... }: with lib; let - cfg = config.modules.programs.ncmpcpp; + cfg = config.modules.usrEnv.programs.media.ncmpcpp; inherit (config.modules.other.system) username; inherit (config.modules.services.mpd) musicDirectory; in { - options.modules.programs.ncmpcpp.enable = mkEnableOption "ncmpcpp"; - config = mkIf cfg.enable { home-manager.users.${username} = { programs.ncmpcpp = { diff --git a/modules/wms/wayland/hypr/land.nix b/modules/wms/wayland/hypr/land.nix index ff39231..37625a3 100644 --- a/modules/wms/wayland/hypr/land.nix +++ b/modules/wms/wayland/hypr/land.nix @@ -5,9 +5,8 @@ inputs, ... }: let - cfg = config.modules.wms.wayland.hyprland; + cfg = config.modules.usrEnv.desktops.hyprland; inherit (config.modules.other.system) username; - inherit (inputs.hyprland.packages.${pkgs.system}) hyprland; inherit (inputs.anyrun.packages.${pkgs.system}) anyrun; inherit (inputs.nixpkgs-wayland.packages.${pkgs.system}) @@ -20,13 +19,12 @@ split-monitor-workspaces ; in { - options.modules.wms.wayland.hyprland.enable = lib.mkEnableOption "hyprland"; config = lib.mkIf cfg.enable { # xdg Portal xdg.portal = { enable = true; configPackages = [ - hyprland + cfg.package # TODO Fix hyprland package ]; extraPortals = [ pkgs.xdg-desktop-portal-gtk @@ -37,7 +35,7 @@ in { home-manager.users.${username} = { wayland.windowManager.hyprland = { enable = true; - package = hyprland; + inherit (cfg) package; # Split-monitor-workspaces provides awesome-like workspace behaviour plugins = [ split-monitor-workspaces @@ -208,7 +206,7 @@ in { "$mainMod, F, fullscreen, 0" "$mainMod, D, exec, ${pkgs.procps}/bin/pkill anyrun || ${anyrun}/bin/anyrun" "$mainMod, SPACE, togglefloating, active" - "$mainMod, O, exec, obsidian --ozone-platform=wayland --enable-features=UseOzonePlatform --enable-features=WaylandWindowDecorations --enable-features=WebRTCPipeWireCpaturer --disable-gpu" + # workspaces # split-workspace is because of the split-workspace plugin # "$mainMod, 1, workspace, 1" @@ -259,8 +257,10 @@ in { "$mainMod SHIFT, J, movewindow, d" "$mainMod SHIFT, K, movewindow, u" "$mainMod SHIFT, L, movewindow, r" + # Screenshotting "$mainMod, S, exec, ${pkgs.grimblast}/bin/grimblast copy area" + # File manager "$mainMod, E, exec, ${pkgs.gnome.nautilus}/bin/nautilus" # Toggle the four different special workspaces. @@ -270,7 +270,7 @@ in { "$mainMod, X, togglespecialworkspace, keepassxc" # Reload hyprland - "$mainMod, R, exec, ${hyprland}/bin/hyprctl reload" + "$mainMod, R, exec, ${cfg.package}/bin/hyprctl reload" # Restart waybar "$mainMod CONTROL, B, exec, ${pkgs.procps}/bin/pkill waybar || ${pkgs.waybar}/bin/waybar" ];