From b3fde8e028d058e474b70ce3b34ce9cd4ee0dec8 Mon Sep 17 00:00:00 2001 From: xeovalyte Date: Tue, 24 Dec 2024 10:20:09 +0100 Subject: [PATCH] Reworked home manager configuration to modules --- hosts/laptop/default.nix | 2 +- hosts/laptop/home.nix | 36 +-- modules/home/applications/alacritty.nix | 62 +++++ modules/home/applications/common.nix | 24 ++ modules/home/applications/devenv.nix | 29 +++ modules/home/applications/firefox.nix | 171 ++++++++++++++ modules/home/applications/git.nix | 46 ++++ modules/home/applications/helix.nix | 218 ++++++++++++++++++ modules/home/applications/ssh.nix | 37 +++ modules/home/applications/thunderbird.nix | 101 ++++++++ modules/home/applications/yazi.nix | 35 +++ modules/home/applications/zellij.nix | 92 ++++++++ modules/home/applications/zsh.nix | 49 ++++ modules/home/cli/common/default.nix | 9 - modules/home/cli/common/git.nix | 23 -- modules/home/cli/common/helix.nix | 203 ---------------- modules/home/cli/common/shell.nix | 34 --- modules/home/cli/develop.nix | 87 ------- modules/home/cli/neovim/autocmd.lua | 24 -- modules/home/cli/neovim/colorscheme.lua | 4 - modules/home/cli/neovim/default.nix | 132 ----------- modules/home/cli/neovim/keymaps.lua | 90 -------- modules/home/cli/neovim/options.lua | 57 ----- .../home/cli/neovim/plugins/bufferline.lua | 12 - modules/home/cli/neovim/plugins/cmp.lua | 46 ---- modules/home/cli/neovim/plugins/harpoon.lua | 10 - modules/home/cli/neovim/plugins/lsp.lua | 57 ----- modules/home/cli/neovim/plugins/lualine.lua | 40 ---- .../cli/neovim/plugins/markdown-preview.lua | 2 - modules/home/cli/neovim/plugins/nvim-tree.lua | 20 -- .../home/cli/neovim/plugins/toggleterm.lua | 7 - .../home/cli/neovim/plugins/treesitter.lua | 9 - modules/home/cli/ssh.nix | 22 -- modules/home/cli/yazi.nix | 20 -- modules/home/default.nix | 24 ++ .../desktop-environments/hyprland/default.nix | 214 +++++++++++++++++ .../desktop-environments/hyprland/dunst.nix | 7 + .../hyprland/fixes.nix | 0 .../hyprland/hyprpaper.nix | 0 .../hyprland/kanshi.nix | 0 .../hyprland/rofi.nix | 2 +- .../hyprland/waybar.nix | 2 +- modules/home/gui/common/alacritty.nix | 47 ---- modules/home/gui/common/default.nix | 15 -- modules/home/gui/common/firefox.nix | 154 ------------- modules/home/gui/common/fonts.nix | 14 -- modules/home/gui/hyprland/default.nix | 197 ---------------- modules/home/gui/hyprland/dunst.nix | 7 - modules/home/gui/modrinth.nix | 8 - modules/home/gui/nextcloud.nix | 8 - modules/home/gui/thunderbird.nix | 86 ------- modules/home/services/nextcloud.nix | 23 ++ modules/home/theming/fonts.nix | 29 +++ .../theming.nix => theming/nix-colors.nix} | 18 +- 54 files changed, 1202 insertions(+), 1463 deletions(-) create mode 100644 modules/home/applications/alacritty.nix create mode 100644 modules/home/applications/common.nix create mode 100644 modules/home/applications/devenv.nix create mode 100644 modules/home/applications/firefox.nix create mode 100644 modules/home/applications/git.nix create mode 100644 modules/home/applications/helix.nix create mode 100644 modules/home/applications/ssh.nix create mode 100644 modules/home/applications/thunderbird.nix create mode 100644 modules/home/applications/yazi.nix create mode 100644 modules/home/applications/zellij.nix create mode 100644 modules/home/applications/zsh.nix delete mode 100644 modules/home/cli/common/default.nix delete mode 100644 modules/home/cli/common/git.nix delete mode 100644 modules/home/cli/common/helix.nix delete mode 100644 modules/home/cli/common/shell.nix delete mode 100644 modules/home/cli/develop.nix delete mode 100644 modules/home/cli/neovim/autocmd.lua delete mode 100644 modules/home/cli/neovim/colorscheme.lua delete mode 100644 modules/home/cli/neovim/default.nix delete mode 100644 modules/home/cli/neovim/keymaps.lua delete mode 100644 modules/home/cli/neovim/options.lua delete mode 100644 modules/home/cli/neovim/plugins/bufferline.lua delete mode 100644 modules/home/cli/neovim/plugins/cmp.lua delete mode 100644 modules/home/cli/neovim/plugins/harpoon.lua delete mode 100644 modules/home/cli/neovim/plugins/lsp.lua delete mode 100644 modules/home/cli/neovim/plugins/lualine.lua delete mode 100644 modules/home/cli/neovim/plugins/markdown-preview.lua delete mode 100644 modules/home/cli/neovim/plugins/nvim-tree.lua delete mode 100644 modules/home/cli/neovim/plugins/toggleterm.lua delete mode 100644 modules/home/cli/neovim/plugins/treesitter.lua delete mode 100644 modules/home/cli/ssh.nix delete mode 100644 modules/home/cli/yazi.nix create mode 100644 modules/home/default.nix create mode 100644 modules/home/desktop-environments/hyprland/default.nix create mode 100644 modules/home/desktop-environments/hyprland/dunst.nix rename modules/home/{gui => desktop-environments}/hyprland/fixes.nix (100%) rename modules/home/{gui => desktop-environments}/hyprland/hyprpaper.nix (100%) rename modules/home/{gui => desktop-environments}/hyprland/kanshi.nix (100%) rename modules/home/{gui => desktop-environments}/hyprland/rofi.nix (98%) rename modules/home/{gui => desktop-environments}/hyprland/waybar.nix (98%) delete mode 100644 modules/home/gui/common/alacritty.nix delete mode 100644 modules/home/gui/common/default.nix delete mode 100644 modules/home/gui/common/firefox.nix delete mode 100644 modules/home/gui/common/fonts.nix delete mode 100644 modules/home/gui/hyprland/default.nix delete mode 100644 modules/home/gui/hyprland/dunst.nix delete mode 100644 modules/home/gui/modrinth.nix delete mode 100644 modules/home/gui/nextcloud.nix delete mode 100644 modules/home/gui/thunderbird.nix create mode 100644 modules/home/services/nextcloud.nix create mode 100644 modules/home/theming/fonts.nix rename modules/home/{gui/theming.nix => theming/nix-colors.nix} (77%) diff --git a/hosts/laptop/default.nix b/hosts/laptop/default.nix index e880ee4..811e79e 100644 --- a/hosts/laptop/default.nix +++ b/hosts/laptop/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, inputs, ... }: +{ pkgs, ... }: { imports = [ diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index 54e1c37..a2d7dc2 100644 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -2,21 +2,10 @@ { imports = [ - # GUI - ../../modules/home/gui/common - ../../modules/home/gui/hyprland - ../../modules/home/gui/nextcloud.nix - ../../modules/home/gui/theming.nix - ../../modules/home/gui/thunderbird.nix - - # CLI - ../../modules/home/cli/common - ../../modules/home/cli/develop.nix - ../../modules/home/cli/ssh.nix - ../../modules/home/cli/yazi.nix + # Modules + ../../modules/home/default.nix ]; - options = { host = lib.mkOption { type = with lib.types; str; @@ -42,6 +31,27 @@ host = "xv-laptop"; headless = false; + settings = { + applications.common.enable = true; + applications.alacritty.enable = true; + applications.devenv.enable = true; + applications.firefox.enable = true; + applications.git.enable = true; + applications.helix.enable = true; + applications.zsh.enable = true; + applications.ssh.enable = true; + applications.thunderbird.enable = true; + applications.yazi.enable = true; + applications.zellij.enable = true; + + services.nextcloud-sync.enable = true; + + theming.fonts.enable = true; + theming.nix-colors.enable = true; + + desktop-environments.hyprland.enable = false; + }; + home.packages = with pkgs; [ # Desktop Applications kdenlive diff --git a/modules/home/applications/alacritty.nix b/modules/home/applications/alacritty.nix new file mode 100644 index 0000000..02c0486 --- /dev/null +++ b/modules/home/applications/alacritty.nix @@ -0,0 +1,62 @@ +{ config, lib, ... }: + +with lib; + +let + cfg = config.settings.applications.alacritty; +in { + options = { + settings.applications.alacritty.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable alacritty terimnal + ''; + }; + }; + + config = mkIf cfg.enable { + programs.alacritty = { + enable = true; + settings = { + font = { + normal = { family = "DejaVuSansM Nerd Font"; style = "Regular"; }; + }; + window = { + opacity = 0.8; + padding = { x = 10; y = 10; }; + }; + colors = { + draw_bold_text_with_bright_colors = false; + primary = { + background = "0x${config.colorScheme.palette.base00}"; + foreground = "0x${config.colorScheme.palette.base05}"; + }; + cursor = { + text = "0x${config.colorScheme.palette.base00}"; + cursor = "0x${config.colorScheme.palette.base05}"; + }; + normal = { + black = "0x${config.colorScheme.palette.base00}"; + red = "0x${config.colorScheme.palette.base08}"; + green = "0x${config.colorScheme.palette.base0B}"; + yellow = "0x${config.colorScheme.palette.base0A}"; + blue = "0x${config.colorScheme.palette.base0D}"; + magenta = "0x${config.colorScheme.palette.base0E}"; + cyan = "0x${config.colorScheme.palette.base0C}"; + white = "0x${config.colorScheme.palette.base05}"; + }; + bright = { + black = "0x${config.colorScheme.palette.base03}"; + red = "0x${config.colorScheme.palette.base09}"; + green = "0x${config.colorScheme.palette.base01}"; + yellow = "0x${config.colorScheme.palette.base02}"; + blue = "0x${config.colorScheme.palette.base04}"; + magenta = "0x${config.colorScheme.palette.base06}"; + cyan = "0x${config.colorScheme.palette.base0F}"; + white = "0x${config.colorScheme.palette.base07}"; + }; + }; + }; + }; + }; +} diff --git a/modules/home/applications/common.nix b/modules/home/applications/common.nix new file mode 100644 index 0000000..578b3ac --- /dev/null +++ b/modules/home/applications/common.nix @@ -0,0 +1,24 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.settings.applications.common; +in { + options = { + settings.applications.common.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable common applications + ''; + }; + }; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ + vlc + bitwarden + pavucontrol + ]; + }; +} diff --git a/modules/home/applications/devenv.nix b/modules/home/applications/devenv.nix new file mode 100644 index 0000000..0b80baa --- /dev/null +++ b/modules/home/applications/devenv.nix @@ -0,0 +1,29 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.settings.applications.devenv; +in { + options = { + settings.applications.devenv.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable common applications + ''; + }; + }; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ + unstable.devenv + cloc + ]; + + programs.direnv = { + enable = true; + enableBashIntegration = true; + }; + }; +} + diff --git a/modules/home/applications/firefox.nix b/modules/home/applications/firefox.nix new file mode 100644 index 0000000..42426c9 --- /dev/null +++ b/modules/home/applications/firefox.nix @@ -0,0 +1,171 @@ +{ config, lib, pkgs, ... }: + +# about:policies +# Check about:support for extension/add-on ID strings. +# Check about:config for options. + +with lib; + +let + cfg = config.settings.applications.firefox; +in { + options = { + settings.applications.firefox.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable firefox + ''; + }; + }; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ + unstable.firefoxpwa + ]; + + programs.firefox = { + enable = true; + nativeMessagingHosts = [ pkgs.unstable.firefoxpwa ]; + policies = { + DisableTelemetry = true; + DisableFirefoxStudies = true; + EnableTrackingProtection = { + Value = true; + Locked = true; + Cryptomining = true; + Fingerprinting = true; + }; + DisablePocket = true; + DisableFirefoxAccounts = true; + DisableAccounts = true; + DontCheckDefaultBrowser = true; + DisplayBookmarksToolbar = "newpage"; + ExtensionSettings = { + "nl-NL@dictionaries.addons.mozilla.org" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/woordenboek-nederlands/latest.xpi"; + installation_mode = "force_installed"; + }; + "uBlock0@raymondhill.net" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; + installation_mode = "force_installed"; + }; + "{446900e4-71c2-419f-a6a7-df9c091e268b}" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/bitwarden-password-manager/latest.xpi"; + installation_mode = "force_installed"; + }; + "firefoxpwa@filips.si" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/pwas-for-firefox/latest.xpi"; + installation_mode = "force_installed"; + }; + "markdown-viewer@outofindex.com" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/markdown-viewer-chrome/latest.xpi"; + installation_mode = "force_installed"; + }; + }; + }; + profiles.xeovalyte = { + bookmarks = [ + { + name = "Toolbar"; + toolbar = true; + bookmarks = [ + { + name = "Brightspace"; + bookmarks = [ + { + name = "Books"; + url = "https://drive.google.com/drive/folders/1L5OTbn5p3i7_Nc80hc5PztiEGHKwi-I4"; + } + { + name = "LCB"; + url = "https://brightspace.tudelft.nl/d2l/le/content/681010/Home"; + } + { + name = "Calculus"; + url = "https://brightspace.tudelft.nl/d2l/le/content/681024/Home"; + } + { + name = "IP1"; + url = "https://brightspace.tudelft.nl/d2l/le/content/681020/Home"; + } + ]; + } + ]; + } + ]; + search.engines = { + "Nix" = { + urls = [{ + template = "https://mynixos.com/search"; + params = [ + { name = "q"; value = "{searchTerms}"; } + ]; + }]; + + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@nix" ]; + }; + + "SearXNG" = { + urls = [{ + template = "https:/search.xeovalyte.dev/search"; + params = [ + { name = "q"; value = "{searchTerms}"; } + ]; + }]; + + definedAliases = [ "@searxng" ]; + }; + + "Startpage" = { + urls = [{ + template = "https:/startpage.com/sp/search"; + params = [ + { name = "q"; value = "{searchTerms}"; } + ]; + }]; + + definedAliases = [ "@sp" ]; + }; + + "Bing".metaData.hidden = true; + "Google".metaData.hidden = true; + "eBay".metaData.hidden = true; + }; + search.force = true; + search.default = "SearXNG"; + + settings = { + "browser.disableResetPrompt" = true; + "browser.download.panel.shown" = true; + "browser.download.useDownloadDir" = false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + "browser.shell.checkDefaultBrowser" = false; + "browser.shell.defaultBrowserCheckCount" = 1; + "dom.security.https_only_mode" = true; + "privacy.trackingProtection.enabled" = true; + "browser.toolbars.bookmarks.visibility" = "newtab"; + "browser.translations.neverTranslateLanguages" = "nl"; + "browser.newtabpage.pinned" = [ + { + label = "Server"; + url = "https://home.xeovalyte.dev"; + } + { + label = "Youtube"; + url = "https://youtube.com"; + } + { + label = "My TU Delft"; + url = "https://my.tudelft.nl/"; + } + ]; + "signon.rememberSignons" = false; + }; + }; + }; + }; +} + + + diff --git a/modules/home/applications/git.nix b/modules/home/applications/git.nix new file mode 100644 index 0000000..a82eeaa --- /dev/null +++ b/modules/home/applications/git.nix @@ -0,0 +1,46 @@ +{ config, lib, ... }: + +with lib; + +let + cfg = config.settings.applications.git; +in { + options = { + settings.applications.git.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable git version control + ''; + }; + + settings.applications.git.lazygit.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable lazygit + ''; + default = true; + }; + }; + + config = mkIf cfg.enable { + programs.lazygit = { + enable = true; + settings = { + services = { + "gitea.xeovalyte.dev" = "gitea:gitea.xeovalyte.dev"; + }; + }; + }; + + programs.git = mkIf cfg.lazygit.enable { + enable = true; + userEmail = "me+gitea@xeovalyte.dev"; + userName = "xeovalyte"; + extraConfig = { + commit.gpgsign = true; + gpg.format = "ssh"; + user.signingkey = "~/.ssh/gitea.pub"; + }; + }; + }; +} diff --git a/modules/home/applications/helix.nix b/modules/home/applications/helix.nix new file mode 100644 index 0000000..66b0ec4 --- /dev/null +++ b/modules/home/applications/helix.nix @@ -0,0 +1,218 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.settings.applications.helix; +in { + options = { + settings.applications.helix.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable helix text editor + ''; + }; + }; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ + unstable.marksman + unstable.markdown-oxide + unstable.svls + unstable.nil + unstable.nixpkgs-fmt + unstable.tectonic + unstable.texlab + dprint + ]; + + home.file.".config/.dprint.json".text ='' + { + "markdown": { + "lineWidth":120, + }, + "excludes": [], + "plugins": [ + "https://plugins.dprint.dev/markdown-0.16.1.wasm" + ] + } + ''; + + programs.helix = { + enable = true; + package = pkgs.unstable.helix; + defaultEditor = true; + settings = { + theme = "base16"; + editor.cursor-shape = { + insert = "bar"; + }; + }; + languages = { + # Rust + language-server.rust-analyzer.config = { + cargo = { + features = "all"; + }; + }; + + # Systemverilog + language-server.svls = { + command = "svls"; + }; + + language-server.texlab = { + config = { + texlab.chktex = { + onOpenAndSave = true; + onEdit = true; + }; + texlab.forwardSearch = { + executable = "zathura"; + args = [ + "--synctex-forward" + "%l:%c:%f" + "%p" + ]; + }; + texlab.build = { + auxDirectory = "build"; + logDirectory = "build"; + pdfDirectory = "build"; + forwardSearchAfter = true; + onSave = true; + executable = "tectonic"; + args = [ + "-X" + "compile" + "--synctex" + "--keep-logs" + "--keep-intermediates" + "--outdir=build" + "%f" + ]; + }; + }; + }; + + language = [ + { + name = "verilog"; + language-servers = [ "svls" ]; + } + { + name = "html"; + language-servers = [ "vscode-html-language-server" "tailwindcss-ls" ]; + } + { + name = "css"; + language-servers = [ "vscode-html-language-server" "tailwindcss-ls" ]; + } + { + name = "markdown"; + auto-format = true; + language-servers = [ "markdown-oxide" ]; + formatter.command = "dprint"; + formatter.args = ["fmt" "--stdin" "md" "--config" "/home/xeovalyte/.config/.dprint.json"]; + } + { + name = "typst"; + auto-format = false; + formatter.command = "${pkgs.typstfmt}/bin/typstfmt"; + } + ]; + }; + themes = { + base16 = let + base00 = "#${config.colorScheme.palette.base00}"; + base01 = "#${config.colorScheme.palette.base01}"; + base02 = "#${config.colorScheme.palette.base02}"; + base03 = "#${config.colorScheme.palette.base03}"; + base04 = "#${config.colorScheme.palette.base04}"; + base05 = "#${config.colorScheme.palette.base05}"; + base06 = "#${config.colorScheme.palette.base06}"; + base07 = "#${config.colorScheme.palette.base07}"; + base08 = "#${config.colorScheme.palette.base08}"; + base09 = "#${config.colorScheme.palette.base09}"; + base0A = "#${config.colorScheme.palette.base0A}"; + base0B = "#${config.colorScheme.palette.base0B}"; + base0C = "#${config.colorScheme.palette.base0C}"; + base0D = "#${config.colorScheme.palette.base0D}"; + base0E = "#${config.colorScheme.palette.base0E}"; + base0F = "#${config.colorScheme.palette.base0F}"; + in { + "attributes" = base09; + "comment" = { fg = base03; modifiers = ["italic"]; }; + "constant" = base09; + "constant.character.escape" = base0C; + "constant.numeric" = base09; + "constructor" = base0D; + "debug" = base03; + "diagnostic" = { modifiers = ["underlined"]; }; + "diff.delta" = base09; + "diff.minus" = base08; + "diff.plus" = base0B; + "error" = base08; + "function" = base0D; + "hint" = base03; + "info" = base0D; + "keyword" = base0E; + "label" = base0E; + "namespace" = base0E; + "operator" = base05; + "special" = base0D; + "string" = base0B; + "type" = base0A; + "variable" = base08; + "variable.other.member" = base0B; + "warning" = base09; + + "markup.bold" = { fg = base0A; modifiers = ["bold"]; }; + "markup.heading" = base0D; + "markup.italic" = { fg = base0E; modifiers = ["italic"]; }; + "markup.link.text" = base08; + "markup.link.url" = { fg = base09; modifiers = ["underlined"]; }; + "markup.list" = base08; + "markup.quote" = base0C; + "markup.raw" = base0B; + "markup.strikethrough" = { modifiers = ["crossed_out"]; }; + + "diagnostic.hint" = { underline = { style = "curl"; }; }; + "diagnostic.info" = { underline = { style = "curl"; }; }; + "diagnostic.warning" = { underline = { style = "curl"; }; }; + "diagnostic.error" = { underline = { style = "curl"; }; }; + + # "ui.background" = { bg = base00; }; + "ui.bufferline.active" = { fg = base00; bg = base03; modifiers = ["bold"]; }; + "ui.bufferline" = { fg = base04; bg = base00; }; + "ui.cursor" = { fg = base0A; modifiers = ["reversed"]; }; + "ui.cursor.insert" = { fg = base0A; modifiers = ["reversed"]; }; + "ui.cursorline.primary" = { fg = base05; bg = base01; }; + "ui.cursor.match" = { fg = base0A; modifiers = ["reversed"]; }; + "ui.cursor.select" = { fg = base0A; modifiers = ["reversed"]; }; + "ui.gutter" = { bg = base00; }; + "ui.help" = { fg = base06; bg = base01; }; + "ui.linenr" = { fg = base03; bg = base00; }; + "ui.linenr.selected" = { fg = base04; bg = base01; modifiers = ["bold"]; }; + "ui.menu" = { fg = base05; bg = base01; }; + "ui.menu.scroll" = { fg = base03; bg = base01; }; + "ui.menu.selected" = { fg = base01; bg = base04; }; + "ui.popup" = { bg = base01; }; + "ui.selection" = { bg = base02; }; + "ui.selection.primary" = { bg = base02; }; + "ui.statusline" = { fg = base04; bg = base01; }; + "ui.statusline.inactive" = { bg = base01; fg = base03; }; + "ui.statusline.insert" = { fg = base00; bg = base0B; }; + "ui.statusline.normal" = { fg = base00; bg = base03; }; + "ui.statusline.select" = { fg = base00; bg = base0F; }; + "ui.text" = base05; + "ui.text.focus" = base05; + "ui.virtual.indent-guide" = { fg = base03; }; + "ui.virtual.inlay-hint" = { fg = base01; }; + "ui.virtual.ruler" = { bg = base01; }; + "ui.window" = { bg = base01; }; + }; + }; + }; + }; +} diff --git a/modules/home/applications/ssh.nix b/modules/home/applications/ssh.nix new file mode 100644 index 0000000..031be8f --- /dev/null +++ b/modules/home/applications/ssh.nix @@ -0,0 +1,37 @@ +{ config, lib, ... }: + +with lib; + +let + cfg = config.settings.applications.ssh; +in { + options = { + settings.applications.ssh.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable ssh and configure some endpoints + ''; + }; + }; + + config = mkIf cfg.enable { + programs.ssh = { + enable = true; + matchBlocks = { + archserver = { + hostname = "192.168.1.20"; + user = "xeovalyte"; + identityFile = "~/.ssh/archserver"; + }; + + "gitea.xeovalyte.dev" = { + hostname = "gitea.xeovalyte.dev"; + port = 2222; + user = "git"; + identityFile = "~/.ssh/gitea"; + }; + }; + addKeysToAgent = "yes"; + }; + }; +} diff --git a/modules/home/applications/thunderbird.nix b/modules/home/applications/thunderbird.nix new file mode 100644 index 0000000..34cfe55 --- /dev/null +++ b/modules/home/applications/thunderbird.nix @@ -0,0 +1,101 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.settings.applications.thunderbird; +in { + options = { + settings.applications.thunderbird.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable thunderbird mail + ''; + }; + }; + + config = mkIf cfg.enable { + programs.thunderbird = { + enable = true; + package = pkgs.unstable.thunderbird; + profiles = { + default = { + isDefault = true; + }; + }; + }; + + accounts.email.accounts = { + ziggo = { + imap = { + host = "imap.ziggo.nl"; + port = 993; + tls = { + enable = true; + }; + }; + smtp = { + host = "smtp.ziggo.nl"; + port = 587; + tls = { + enable = true; + useStartTls = true; + }; + }; + address = "timo.boomers@ziggo.nl"; + realName = "Timo Boomers"; + userName = "timo.boomers@ziggo.nl"; + primary = true; + thunderbird.enable = true; + thunderbird.profiles = [ "default" ]; + }; + tudelft = { + imap = { + host = "outlook.office365.com"; + port = 993; + tls = { + enable = true; + }; + }; + smtp = { + host = "smtp.office365.com"; + port = 587; + tls = { + enable = true; + useStartTls = false; + }; + }; + address = "tboomers@tudelft.nl"; + realName = "Timo Boomers"; + userName = "tboomers@tudelft.nl"; + primary = false; + thunderbird.enable = true; + thunderbird.profiles = [ "default" ]; + }; + xeovalyte = { + imap = { + host = "mail.xeovalyte.dev"; + port = 993; + tls = { + enable = true; + }; + }; + smtp = { + host = "mail.xeovalyte.dev"; + port = 587; + tls = { + enable = true; + useStartTls = true; + }; + }; + address = "timo@xeovalyte.dev"; + aliases = [ "me@xeovalyte.dev" "contact@xeovalyte.dev" ]; + realName = "Timo Boomers"; + userName = "me@xeovalyte.dev"; + primary = false; + thunderbird.enable = true; + thunderbird.profiles = [ "default" ]; + }; + }; + }; +} diff --git a/modules/home/applications/yazi.nix b/modules/home/applications/yazi.nix new file mode 100644 index 0000000..62b14f5 --- /dev/null +++ b/modules/home/applications/yazi.nix @@ -0,0 +1,35 @@ +{ config, lib, ... }: + +with lib; + +let + cfg = config.settings.applications.yazi; +in { + options = { + settings.applications.yazi.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable yazi terminal file manager + ''; + }; + }; + + config = mkIf cfg.enable { + programs.yazi = { + enable = true; + enableZshIntegration = true; + settings = { + opener = { + open = [ + { run = "xdg-open $@"; desc = "xdg"; orphan = true; } + ]; + }; + open = { + prepend_rules = [ + { name = "*.rnote"; use = "open"; } + ]; + }; + }; + }; + }; +} diff --git a/modules/home/applications/zellij.nix b/modules/home/applications/zellij.nix new file mode 100644 index 0000000..e7c68f9 --- /dev/null +++ b/modules/home/applications/zellij.nix @@ -0,0 +1,92 @@ +{ config, lib, ... }: + +with lib; + +let + cfg = config.settings.applications.zellij; +in { + options = { + settings.applications.zellij.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable zellij tool + ''; + }; + }; + + config = mkIf cfg.enable { + programs.zellij = { + enable = true; + }; + + home.file.zellij = { + target = ".config/zellij/config.kdl"; + text = '' + pane_frames false + keybinds { + normal { + bind "Ctrl e" { ToggleFloatingPanes; SwitchToMode "normal"; } + bind "Alt 1" { GoToTab 1; } + bind "Alt 2" { GoToTab 2; } + bind "Alt 3" { GoToTab 3; } + bind "Alt 4" { GoToTab 4; } + bind "Alt 5" { GoToTab 5; } + } + } + ''; + }; + + home.file.zellij-layout-default = { + target = ".config/zellij/layouts/default.kdl"; + text = '' + layout { + pane + floating_panes { + pane { + width "80%" + height "80%" + x "10%" + y "10%" + } + } + } + ''; + }; + + home.file.zellij-layout-dioxus = { + target = ".config/zellij/layouts/dioxus.kdl"; + text = '' + layout { + tab { + pane { + command "hx" + args "." + focus true + } + floating_panes { + pane { + width "80%" + height "80%" + x "10%" + y "10%" + } + } + } + tab { + pane { + command "dx" + args "serve" + } + } + tab { + pane { + command "devenv" + args "up" + } + } + } + ''; + }; + }; +} + diff --git a/modules/home/applications/zsh.nix b/modules/home/applications/zsh.nix new file mode 100644 index 0000000..40fe514 --- /dev/null +++ b/modules/home/applications/zsh.nix @@ -0,0 +1,49 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.settings.applications.zsh; +in { + options = { + settings.applications.zsh.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable zsh shell + ''; + }; + }; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ + eza + bat + ]; + + home.shellAliases = { + ls = "eza"; + }; + + programs.bash = { + enable = false; + }; + + programs.zsh = { + enable = true; + enableCompletion = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + }; + + programs.starship = { + enable = true; + enableBashIntegration = true; + enableZshIntegration = true; + }; + + programs.skim = { + enable = true; + enableZshIntegration = true; + }; + }; +} diff --git a/modules/home/cli/common/default.nix b/modules/home/cli/common/default.nix deleted file mode 100644 index eb3022d..0000000 --- a/modules/home/cli/common/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ ... }: - -{ - imports = [ - ./git.nix - ./shell.nix - ./helix.nix - ]; -} diff --git a/modules/home/cli/common/git.nix b/modules/home/cli/common/git.nix deleted file mode 100644 index 5b1716b..0000000 --- a/modules/home/cli/common/git.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ pkgs, ... }: - -{ - programs.lazygit = { - enable = true; - settings = { - services = { - "gitea.xeovalyte.dev" = "gitea:gitea.xeovalyte.dev"; - }; - }; - }; - - programs.git = { - enable = true; - userEmail = "me+gitea@xeovalyte.dev"; - userName = "xeovalyte"; - extraConfig = { - commit.gpgsign = true; - gpg.format = "ssh"; - user.signingkey = "~/.ssh/gitea.pub"; - }; - }; -} diff --git a/modules/home/cli/common/helix.nix b/modules/home/cli/common/helix.nix deleted file mode 100644 index 09dfc54..0000000 --- a/modules/home/cli/common/helix.nix +++ /dev/null @@ -1,203 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.packages = with pkgs; [ - unstable.marksman - unstable.markdown-oxide - unstable.svls - unstable.nil - unstable.nixpkgs-fmt - unstable.tectonic - unstable.texlab - dprint - ]; - - home.file.".config/.dprint.json".text ='' - { - "markdown": { - "lineWidth":120, - }, - "excludes": [], - "plugins": [ - "https://plugins.dprint.dev/markdown-0.16.1.wasm" - ] - } - ''; - - programs.helix = { - enable = true; - package = pkgs.unstable.helix; - defaultEditor = true; - settings = { - theme = "base16"; - editor.cursor-shape = { - insert = "bar"; - }; - }; - languages = { - # Rust - language-server.rust-analyzer.config = { - cargo = { - features = "all"; - }; - }; - - # Systemverilog - language-server.svls = { - command = "svls"; - }; - - language-server.texlab = { - config = { - texlab.chktex = { - onOpenAndSave = true; - onEdit = true; - }; - texlab.forwardSearch = { - executable = "zathura"; - args = [ - "--synctex-forward" - "%l:%c:%f" - "%p" - ]; - }; - texlab.build = { - auxDirectory = "build"; - logDirectory = "build"; - pdfDirectory = "build"; - forwardSearchAfter = true; - onSave = true; - executable = "tectonic"; - args = [ - "-X" - "compile" - "--synctex" - "--keep-logs" - "--keep-intermediates" - "--outdir=build" - "%f" - ]; - }; - }; - }; - - language = [ - { - name = "verilog"; - language-servers = [ "svls" ]; - } - { - name = "html"; - language-servers = [ "vscode-html-language-server" "tailwindcss-ls" ]; - } - { - name = "css"; - language-servers = [ "vscode-html-language-server" "tailwindcss-ls" ]; - } - { - name = "markdown"; - auto-format = true; - language-servers = [ "markdown-oxide" ]; - formatter.command = "dprint"; - formatter.args = ["fmt" "--stdin" "md" "--config" "/home/xeovalyte/.config/.dprint.json"]; - } - { - name = "typst"; - auto-format = false; - formatter.command = "${pkgs.typstfmt}/bin/typstfmt"; - } - ]; - }; - themes = { - base16 = let - base00 = "#${config.colorScheme.palette.base00}"; - base01 = "#${config.colorScheme.palette.base01}"; - base02 = "#${config.colorScheme.palette.base02}"; - base03 = "#${config.colorScheme.palette.base03}"; - base04 = "#${config.colorScheme.palette.base04}"; - base05 = "#${config.colorScheme.palette.base05}"; - base06 = "#${config.colorScheme.palette.base06}"; - base07 = "#${config.colorScheme.palette.base07}"; - base08 = "#${config.colorScheme.palette.base08}"; - base09 = "#${config.colorScheme.palette.base09}"; - base0A = "#${config.colorScheme.palette.base0A}"; - base0B = "#${config.colorScheme.palette.base0B}"; - base0C = "#${config.colorScheme.palette.base0C}"; - base0D = "#${config.colorScheme.palette.base0D}"; - base0E = "#${config.colorScheme.palette.base0E}"; - base0F = "#${config.colorScheme.palette.base0F}"; - in { - "attributes" = base09; - "comment" = { fg = base03; modifiers = ["italic"]; }; - "constant" = base09; - "constant.character.escape" = base0C; - "constant.numeric" = base09; - "constructor" = base0D; - "debug" = base03; - "diagnostic" = { modifiers = ["underlined"]; }; - "diff.delta" = base09; - "diff.minus" = base08; - "diff.plus" = base0B; - "error" = base08; - "function" = base0D; - "hint" = base03; - "info" = base0D; - "keyword" = base0E; - "label" = base0E; - "namespace" = base0E; - "operator" = base05; - "special" = base0D; - "string" = base0B; - "type" = base0A; - "variable" = base08; - "variable.other.member" = base0B; - "warning" = base09; - - "markup.bold" = { fg = base0A; modifiers = ["bold"]; }; - "markup.heading" = base0D; - "markup.italic" = { fg = base0E; modifiers = ["italic"]; }; - "markup.link.text" = base08; - "markup.link.url" = { fg = base09; modifiers = ["underlined"]; }; - "markup.list" = base08; - "markup.quote" = base0C; - "markup.raw" = base0B; - "markup.strikethrough" = { modifiers = ["crossed_out"]; }; - - "diagnostic.hint" = { underline = { style = "curl"; }; }; - "diagnostic.info" = { underline = { style = "curl"; }; }; - "diagnostic.warning" = { underline = { style = "curl"; }; }; - "diagnostic.error" = { underline = { style = "curl"; }; }; - -# "ui.background" = { bg = base00; }; - "ui.bufferline.active" = { fg = base00; bg = base03; modifiers = ["bold"]; }; - "ui.bufferline" = { fg = base04; bg = base00; }; - "ui.cursor" = { fg = base0A; modifiers = ["reversed"]; }; - "ui.cursor.insert" = { fg = base0A; modifiers = ["reversed"]; }; - "ui.cursorline.primary" = { fg = base05; bg = base01; }; - "ui.cursor.match" = { fg = base0A; modifiers = ["reversed"]; }; - "ui.cursor.select" = { fg = base0A; modifiers = ["reversed"]; }; - "ui.gutter" = { bg = base00; }; - "ui.help" = { fg = base06; bg = base01; }; - "ui.linenr" = { fg = base03; bg = base00; }; - "ui.linenr.selected" = { fg = base04; bg = base01; modifiers = ["bold"]; }; - "ui.menu" = { fg = base05; bg = base01; }; - "ui.menu.scroll" = { fg = base03; bg = base01; }; - "ui.menu.selected" = { fg = base01; bg = base04; }; - "ui.popup" = { bg = base01; }; - "ui.selection" = { bg = base02; }; - "ui.selection.primary" = { bg = base02; }; - "ui.statusline" = { fg = base04; bg = base01; }; - "ui.statusline.inactive" = { bg = base01; fg = base03; }; - "ui.statusline.insert" = { fg = base00; bg = base0B; }; - "ui.statusline.normal" = { fg = base00; bg = base03; }; - "ui.statusline.select" = { fg = base00; bg = base0F; }; - "ui.text" = base05; - "ui.text.focus" = base05; - "ui.virtual.indent-guide" = { fg = base03; }; - "ui.virtual.inlay-hint" = { fg = base01; }; - "ui.virtual.ruler" = { bg = base01; }; - "ui.window" = { bg = base01; }; - }; - }; - }; -} diff --git a/modules/home/cli/common/shell.nix b/modules/home/cli/common/shell.nix deleted file mode 100644 index 0fc40c1..0000000 --- a/modules/home/cli/common/shell.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ pkgs, ... }: - -{ - home.packages = with pkgs; [ - eza - bat - ]; - - home.shellAliases = { - ls = "eza"; - }; - - programs.bash = { - enable = false; - }; - - programs.zsh = { - enable = true; - enableCompletion = true; - autosuggestion.enable = true; - syntaxHighlighting.enable = true; - }; - - programs.starship = { - enable = true; - enableBashIntegration = true; - enableZshIntegration = true; - }; - - programs.skim = { - enable = true; - enableZshIntegration = true; - }; -} diff --git a/modules/home/cli/develop.nix b/modules/home/cli/develop.nix deleted file mode 100644 index 27da1f8..0000000 --- a/modules/home/cli/develop.nix +++ /dev/null @@ -1,87 +0,0 @@ -{ pkgs, ... }: - -{ - home.packages = with pkgs; [ - unstable.devenv - cloc - ]; - - programs.direnv = { - enable = true; - enableBashIntegration = true; - }; - - programs.zellij = { - enable = true; - # enableBashIntegration = true; - }; - - home.file.zellij = { - target = ".config/zellij/config.kdl"; - text = '' - pane_frames false - keybinds { - normal { - bind "Ctrl e" { ToggleFloatingPanes; SwitchToMode "normal"; } - bind "Alt 1" { GoToTab 1; } - bind "Alt 2" { GoToTab 2; } - bind "Alt 3" { GoToTab 3; } - bind "Alt 4" { GoToTab 4; } - bind "Alt 5" { GoToTab 5; } - } - } - ''; - }; - - home.file.zellij-layout-default = { - target = ".config/zellij/layouts/default.kdl"; - text = '' - layout { - pane - floating_panes { - pane { - width "80%" - height "80%" - x "10%" - y "10%" - } - } - } - ''; - }; - - home.file.zellij-layout-dioxus = { - target = ".config/zellij/layouts/dioxus.kdl"; - text = '' - layout { - tab { - pane { - command "hx" - args "." - focus true - } - floating_panes { - pane { - width "80%" - height "80%" - x "10%" - y "10%" - } - } - } - tab { - pane { - command "dx" - args "serve" - } - } - tab { - pane { - command "devenv" - args "up" - } - } - } - ''; - }; -} diff --git a/modules/home/cli/neovim/autocmd.lua b/modules/home/cli/neovim/autocmd.lua deleted file mode 100644 index 4cbef5b..0000000 --- a/modules/home/cli/neovim/autocmd.lua +++ /dev/null @@ -1,24 +0,0 @@ -local api = vim.api - -api.nvim_create_autocmd( - "FileType", - { pattern = "markdown", command = "setlocal spell" } -) - -api.nvim_create_autocmd( - "FileType", - { pattern = "markdown", command = "setlocal complete+=kspell" } -) - -api.nvim_create_autocmd({ - "BufNewFile", "BufRead" - }, - { pattern = "*.mcfunction", command = "set filetype=mcfunction" } -) - -api.nvim_create_autocmd({ - - "VimEnter" - }, - { callback = require('lualine').setup } -) diff --git a/modules/home/cli/neovim/colorscheme.lua b/modules/home/cli/neovim/colorscheme.lua deleted file mode 100644 index bf480e1..0000000 --- a/modules/home/cli/neovim/colorscheme.lua +++ /dev/null @@ -1,4 +0,0 @@ -require('onedark').setup { - style = 'deep' -} -require('onedark').load() diff --git a/modules/home/cli/neovim/default.nix b/modules/home/cli/neovim/default.nix deleted file mode 100644 index ef1e840..0000000 --- a/modules/home/cli/neovim/default.nix +++ /dev/null @@ -1,132 +0,0 @@ -{ - inputs, - outputs, - lib, - config, - pkgs, - ... -}: { - home.packages = with pkgs; [ - ripgrep - marksman - wl-clipboard - nodejs_20 - ]; - - programs.neovim = - let - toLua = str: "lua << EOF\n${str}\nEOF\n"; - toLuaFile = file: "lua << EOF\n${builtins.readFile file}\nEOF\n"; - in - { - enable = true; - coc = { - enable = false; - settings = { - languageserver = { - arduino = { - command = ["steam-run" "arduino-language-server"]; - rootPatterns = ["*.ino"]; - filetypes = ["arduino"]; - args = ["-cli" "steam-run" "arduino-cli" "-clangd" "steam-run" "clangd" "-cli-config" "/home/xeovalyte/.arduino15/arduino-cli.yaml"]; - }; - }; - }; - }; - - viAlias = true; - vimAlias = true; - vimdiffAlias = true; - - extraLuaConfig = '' - ${builtins.readFile ./options.lua} - ${builtins.readFile ./keymaps.lua} - ${builtins.readFile ./autocmd.lua} - ''; - - plugins = with pkgs.vimPlugins; [ - nvim-web-devicons - - { - plugin = nvim-autopairs; - config = toLua "require(\"nvim-autopairs\").setup{}"; - } - - { - plugin = telescope-nvim; - } - plenary-nvim - - { - plugin = nvim-lspconfig; - config = toLuaFile ./plugins/lsp.lua; - } - neodev-nvim - mason-nvim - mason-lspconfig-nvim - which-key-nvim - rustaceanvim - lsp-inlayhints-nvim - nvim-dap - - { - plugin = markdown-preview-nvim; - config = toLuaFile ./plugins/markdown-preview.lua; - } - - { - plugin = nvim-cmp; - config = toLuaFile ./plugins/cmp.lua; - } - cmp_luasnip - cmp-nvim-lsp - luasnip - friendly-snippets - - { - plugin = nvim-tree-lua; - config = toLuaFile ./plugins/nvim-tree.lua; - } - - { - plugin = toggleterm-nvim; - config = toLuaFile ./plugins/toggleterm.lua; - } - - { - plugin = (nvim-treesitter.withPlugins (p: [ - p.tree-sitter-nix - p.tree-sitter-bash - p.tree-sitter-json - p.tree-sitter-rust - p.tree-sitter-vue - p.tree-sitter-arduino - p.tree-sitter-html - p.tree-sitter-css - p.tree-sitter-javascript - ])); - config = toLuaFile ./plugins/treesitter.lua; - } - - { - plugin = onedark-nvim; - config = toLuaFile ./colorscheme.lua; - } - - { - plugin = presence-nvim; - config = toLua "require(\"presence\").setup()"; - } - - { - plugin = lualine-nvim; - config = toLuaFile ./plugins/lualine.lua; - } - - { - plugin =harpoon; - config = toLuaFile ./plugins/harpoon.lua; - } - ]; - }; -} diff --git a/modules/home/cli/neovim/keymaps.lua b/modules/home/cli/neovim/keymaps.lua deleted file mode 100644 index 6ee9be0..0000000 --- a/modules/home/cli/neovim/keymaps.lua +++ /dev/null @@ -1,90 +0,0 @@ -local function map(mode, lhs, rhs, opts) - opts = opts or {} - opts.silent = opts.silent ~= false - if opts.remap and not vim.g.vscode then - opts.remap = nil - end - vim.keymap.set(mode, lhs, rhs, opts) -end - --- better up/down -map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) -map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) - --- Move to window using the hjkl keys -map("n", "", "h", { desc = "Go to left window", remap = true }) -map("n", "", "j", { desc = "Go to lower window", remap = true }) -map("n", "", "k", { desc = "Go to upper window", remap = true }) -map("n", "", "l", { desc = "Go to right window", remap = true }) - --- Resize window using arrow keys -map("n", "", "resize +2", { desc = "Increase window height" }) -map("n", "", "resize -2", { desc = "Decrease window height" }) -map("n", "", "vertical resize -2", { desc = "Decrease window width" }) -map("n", "", "vertical resize +2", { desc = "Increase window width" }) - --- Move Lines -map("n", "", "m .+1==", { desc = "Move down" }) -map("n", "", "m .-2==", { desc = "Move up" }) -map("i", "", "m .+1==gi", { desc = "Move down" }) -map("i", "", "m .-2==gi", { desc = "Move up" }) -map("v", "", ":m '>+1gv=gv", { desc = "Move down" }) -map("v", "", ":m '<-2gv=gv", { desc = "Move up" }) - --- Clear search with -map({ "i", "n" }, "", "noh", { desc = "Escape and clear hlsearch" }) - --- Clear search, diff update and redraw --- taken from runtime/lua/_editor.lua -map( - "n", - "ur", - "nohlsearchdiffupdatenormal! ", - { desc = "Redraw / clear hlsearch / diff update" } -) - --- https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n -map("n", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" }) -map("x", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" }) -map("o", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" }) -map("n", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" }) -map("x", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" }) -map("o", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" }) - --- Add undo break-points -map("i", ",", ",u") -map("i", ".", ".u") -map("i", ";", ";u") - --- save file -map({ "i", "x", "n", "s" }, "", "w", { desc = "Save file" }) - ---keywordprg -map("n", "K", "norm! K", { desc = "Keywordprg" }) - --- better indenting -map("v", "<", "", ">gv") - --- new file -map("n", "fn", "enew", { desc = "New File" }) - --- Toggle NeoTree -map("n", "e", "NvimTreeToggle", { desc = "Toggle file explorer" }) - --- Telescope -map("n", "ff", "Telescope find_files", { desc = "Telescope find files" }) -map("n", "fg", "Telescope live_grep", { desc = "Telescope find files" }) -map("n", "fb", "Telescope buffers", { desc = "Telescope find files" }) - --- LSP -map("n", "gl", "lua vim.diagnostic.open_float()", { desc = "Show diagnostics" }) -map("n", "gd", "lua vim.lsp.buf.definition()", { desc = "Show diagnostics" }) -map("n", "gD", "lua vim.lsp.buf.declaration()", { desc = "Show diagnostics" }) -map("n", "K", "lua vim.lsp.buf.hover()", { desc = "Show diagnostics" }) - --- Buffers -map("n", "", "bn", { desc = "Cycle to next buffer" }) -map("n", "", "bp", { desc = "Cycle to previous buffer" }) -map("n", "bq", "b#|bd#", { desc = "Close current buffer" }) -map("n", "bq", "BufferLineCloseOthers", { desc = "Close all other buffers" }) diff --git a/modules/home/cli/neovim/options.lua b/modules/home/cli/neovim/options.lua deleted file mode 100644 index d605f76..0000000 --- a/modules/home/cli/neovim/options.lua +++ /dev/null @@ -1,57 +0,0 @@ -vim.g.mapleader = " " -vim.g.maplocalleader = "\\" - -local opt = vim.opt - -opt.autowrite = true -- Enable auto write -opt.clipboard = "unnamedplus" -- Sync with system clipboard -opt.completeopt = "menu,menuone,noselect" -opt.conceallevel = 3 -- Hide * markup for bold and italic -opt.confirm = true -- Confirm to save changes before exiting modified buffer -opt.cursorline = true -- Enable highlighting of the current line -opt.expandtab = true -- Use spaces instead of tabs -opt.formatoptions = "jcroqlnt" -- tcqj -opt.grepformat = "%f:%l:%c:%m" -opt.grepprg = "rg --vimgrep" -opt.ignorecase = true -- Ignore case -opt.inccommand = "nosplit" -- preview incremental substitute -opt.laststatus = 0 -opt.list = true -- Show some invisible characters (tabs... -opt.mouse = "a" -- Enable mouse mode -opt.number = true -- Print line number -opt.pumblend = 10 -- Popup blend -opt.pumheight = 10 -- Maximum number of entries in a popup -opt.relativenumber = true -- Relative line numbers -opt.scrolloff = 4 -- Lines of context -opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" } -opt.shiftround = true -- Round indent -opt.shiftwidth = 2 -- Size of an indent -opt.shortmess:append({ W = true, I = true, c = true }) -opt.showmode = true -- Dont show mode since we have a statusline -opt.sidescrolloff = 8 -- Columns of context -opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time -opt.smartcase = true -- Don't ignore case with capitals -opt.smartindent = true -- Insert indents automatically -opt.spelllang = { "en", "nl" } -opt.spell = false -- Enable spell -opt.splitbelow = true -- Put new windows below current -opt.splitright = true -- Put new windows right of current -opt.tabstop = 2 -- Number of spaces tabs count for -opt.termguicolors = true -- True color support -opt.timeoutlen = 300 -opt.undofile = true -opt.undolevels = 10000 -opt.updatetime = 200 -- Save swap file and trigger CursorHold -opt.wildmode = "longest:full,full" -- Command-line completion mode -opt.winminwidth = 5 -- Minimum window width -opt.wrap = false -- Disable line wrap - -if vim.fn.has("nvim-0.9.0") == 1 then - opt.splitkeep = "screen" - opt.shortmess:append({ C = true }) -end - --- Fix markdown indentation settings -vim.g.markdown_recommended_style = 0 - -vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]] diff --git a/modules/home/cli/neovim/plugins/bufferline.lua b/modules/home/cli/neovim/plugins/bufferline.lua deleted file mode 100644 index 0a53ed3..0000000 --- a/modules/home/cli/neovim/plugins/bufferline.lua +++ /dev/null @@ -1,12 +0,0 @@ -require('bufferline').setup{ - options = { - offsets = { - { - filetype = "NvimTree", - text = "File Explorer", - highlight = "Directory", - separator = true -- use a "true" to enable the default, or set your own character - } - } - } -} diff --git a/modules/home/cli/neovim/plugins/cmp.lua b/modules/home/cli/neovim/plugins/cmp.lua deleted file mode 100644 index cf2b7a7..0000000 --- a/modules/home/cli/neovim/plugins/cmp.lua +++ /dev/null @@ -1,46 +0,0 @@ -local cmp = require('cmp') -local luasnip = require('luasnip') - -require('luasnip.loaders.from_vscode').lazy_load() -luasnip.config.setup {} - -cmp.setup { - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - mapping = cmp.mapping.preset.insert { - [''] = cmp.mapping.select_next_item(), - [''] = cmp.mapping.select_prev_item(), - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete {}, - [''] = cmp.mapping.confirm { - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }, - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_locally_jumpable() then - luasnip.expand_or_jump() - else - fallback() - end - end, { 'i', 's' }), - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.locally_jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { 'i', 's' }), - }, - sources = { - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - }, -} diff --git a/modules/home/cli/neovim/plugins/harpoon.lua b/modules/home/cli/neovim/plugins/harpoon.lua deleted file mode 100644 index d24130e..0000000 --- a/modules/home/cli/neovim/plugins/harpoon.lua +++ /dev/null @@ -1,10 +0,0 @@ -local mark = require('harpoon.mark') -local ui = require('harpoon.ui') - -vim.keymap.set("n", "q", mark.add_file) -vim.keymap.set("n", "", ui.toggle_quick_menu) - -vim.keymap.set("n", "", function() ui.nav_file(1) end) -vim.keymap.set("n", "", function() ui.nav_file(2) end) -vim.keymap.set("n", "", function() ui.nav_file(3) end) -vim.keymap.set("n", "", function() ui.nav_file(4) end) diff --git a/modules/home/cli/neovim/plugins/lsp.lua b/modules/home/cli/neovim/plugins/lsp.lua deleted file mode 100644 index 54ede15..0000000 --- a/modules/home/cli/neovim/plugins/lsp.lua +++ /dev/null @@ -1,57 +0,0 @@ -require("mason").setup{ - PATH = "append", -} -require("mason-lspconfig").setup() -require('neodev').setup() -require('lsp-inlayhints').setup() - -local lspconfig = require('lspconfig') - -vim.g.rustaceanvim = { - tools = { - hover_actions = { - auto_focus = true, - }, - }, - server = { - on_attach = function(client, bufnr) - require("lsp-inlayhints").on_attach(client, bufnr) - require("lsp-inlayhints").show() - end, - default_settings = { - ['rust-analyzer'] = { - cargo = { - features = "all" - }, - }, - }, - }, -} - -lspconfig.tsserver.setup{} - -lspconfig.spyglassmc_language_server.setup{ - cmd = { - "/home/xeovalyte/.npm-global/bin/spyglassmc-language-server", "--stdio" - } -} - -lspconfig.arduino_language_server.setup{ - cmd = { - "steam-run","arduino-language-server", - "-cli-config", "/home/xeovalyte/.arduino15/arduino-cli.yaml", - "-cli", "/usr/bin/arduino-cli", - "-clangd", "steam-run clangd" - } -} - -lspconfig.tailwindcss.setup{ - filetypes = { - "rust", - "css", - } -} - -lspconfig.volar.setup{} - -lspconfig.marksman.setup{} diff --git a/modules/home/cli/neovim/plugins/lualine.lua b/modules/home/cli/neovim/plugins/lualine.lua deleted file mode 100644 index 75ec32a..0000000 --- a/modules/home/cli/neovim/plugins/lualine.lua +++ /dev/null @@ -1,40 +0,0 @@ -require('lualine').setup { - options = { - icons_enabled = true, - theme = 'auto', - component_separators = { left = '', right = ''}, - section_separators = { left = '', right = ''}, - disabled_filetypes = { - statusline = {}, - winbar = {}, - }, - ignore_focus = {}, - always_divide_middle = true, - globalstatus = true, - refresh = { - statusline = 1000, - tabline = 1000, - winbar = 1000, - } - }, - sections = { - lualine_a = {'mode'}, - lualine_b = {'branch', 'diff', 'diagnostics'}, - lualine_c = {'filename'}, - lualine_x = {'encoding', 'fileformat', 'filetype'}, - lualine_y = {'progress'}, - lualine_z = {'location'} - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = {'filename'}, - lualine_x = {'location'}, - lualine_y = {}, - lualine_z = {} - }, - tabline = {}, - winbar = {}, - inactive_winbar = {}, - extensions = {} -} diff --git a/modules/home/cli/neovim/plugins/markdown-preview.lua b/modules/home/cli/neovim/plugins/markdown-preview.lua deleted file mode 100644 index 5004380..0000000 --- a/modules/home/cli/neovim/plugins/markdown-preview.lua +++ /dev/null @@ -1,2 +0,0 @@ -vim.g.mkdp_auto_start = 0 -vim.g.mkdp_auto_close = 0 diff --git a/modules/home/cli/neovim/plugins/nvim-tree.lua b/modules/home/cli/neovim/plugins/nvim-tree.lua deleted file mode 100644 index 6314204..0000000 --- a/modules/home/cli/neovim/plugins/nvim-tree.lua +++ /dev/null @@ -1,20 +0,0 @@ -local function my_on_attach(bufnr) - local api = require "nvim-tree.api" - - local function opts(desc) - return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true } - end - - -- default mappings - api.config.mappings.default_on_attach(bufnr) - - -- custom mappings - vim.keymap.set('n', '', api.tree.change_root_to_parent, opts('Up')) - vim.keymap.set('n', '?', api.tree.toggle_help, opts('Help')) - vim.keymap.set('n', '.', api.tree.change_root_to_node, opts('CD')) -end - --- pass to setup along with your other options -require("nvim-tree").setup { - on_attach = my_on_attach, -} diff --git a/modules/home/cli/neovim/plugins/toggleterm.lua b/modules/home/cli/neovim/plugins/toggleterm.lua deleted file mode 100644 index c5fa966..0000000 --- a/modules/home/cli/neovim/plugins/toggleterm.lua +++ /dev/null @@ -1,7 +0,0 @@ -require("toggleterm").setup{ - open_mapping = [[]], - direction = 'float', - float_opts = { - border = 'curved' - } -} diff --git a/modules/home/cli/neovim/plugins/treesitter.lua b/modules/home/cli/neovim/plugins/treesitter.lua deleted file mode 100644 index 1c1ab24..0000000 --- a/modules/home/cli/neovim/plugins/treesitter.lua +++ /dev/null @@ -1,9 +0,0 @@ -require("nvim-treesitter.configs").setup{ - ensure_installed = {}, - - auto_install = false, - - highlight = { enable = true }, - - indent = { enable = true }, -} diff --git a/modules/home/cli/ssh.nix b/modules/home/cli/ssh.nix deleted file mode 100644 index 498e2fc..0000000 --- a/modules/home/cli/ssh.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ pkgs, ... }: - -{ - programs.ssh = { - enable = true; - matchBlocks = { - archserver = { - hostname = "192.168.1.20"; - user = "xeovalyte"; - identityFile = "~/.ssh/archserver"; - }; - - "gitea.xeovalyte.dev" = { - hostname = "gitea.xeovalyte.dev"; - port = 2222; - user = "git"; - identityFile = "~/.ssh/gitea"; - }; - }; - addKeysToAgent = "yes"; - }; -} diff --git a/modules/home/cli/yazi.nix b/modules/home/cli/yazi.nix deleted file mode 100644 index 7986e39..0000000 --- a/modules/home/cli/yazi.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ pkgs, ... }: - -{ - programs.yazi = { - enable = true; - enableZshIntegration = true; - settings = { - opener = { - open = [ - { run = "xdg-open $@"; desc = "xdg"; orphan = true; } - ]; - }; - open = { - prepend_rules = [ - { name = "*.rnote"; use = "open"; } - ]; - }; - }; - }; -} diff --git a/modules/home/default.nix b/modules/home/default.nix new file mode 100644 index 0000000..5b96d3d --- /dev/null +++ b/modules/home/default.nix @@ -0,0 +1,24 @@ +{ ... }: + +{ + imports = [ + ./applications/alacritty.nix + ./applications/common.nix + ./applications/devenv.nix + ./applications/firefox.nix + ./applications/git.nix + ./applications/helix.nix + ./applications/zsh.nix + ./applications/ssh.nix + ./applications/thunderbird.nix + ./applications/yazi.nix + ./applications/zellij.nix + + ./services/nextcloud.nix + + ./theming/fonts.nix + ./theming/nix-colors.nix + + ./desktop-environments/hyprland/default.nix + ]; +} diff --git a/modules/home/desktop-environments/hyprland/default.nix b/modules/home/desktop-environments/hyprland/default.nix new file mode 100644 index 0000000..0926746 --- /dev/null +++ b/modules/home/desktop-environments/hyprland/default.nix @@ -0,0 +1,214 @@ +{ config, pkgs, lib, ... }: + +with lib; + +let + cfg = config.settings.desktop-environments.hyprland; +in { + options = { + settings.desktop-environments.hyprland.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable hyprland window manager configuration + ''; + }; + }; + + imports = [ + ./waybar.nix + ./fixes.nix + ./dunst.nix + ./rofi.nix + ]; + + config = mkIf cfg.enable { + + home.packages = with pkgs; [ + alacritty + wev + brightnessctl + playerctl + wl-clipboard + grimblast + nwg-bar + powertop + lxqt.lxqt-policykit + + networkmanagerapplet + ]; + + wayland.windowManager.hyprland = { + enable = true; + settings = { + monitor = lib.mkIf (config.host == "xv-laptop") [ + "eDP-1,preferred,3840x0,1.333" + "DP-10,preferred,0x0,1" + "DP-9,preferred,1920x0,1" + ]; + + exec-once = [ + "waybar" + "lxqt-policykit-agent" + "nm-applet" + "blueman-applet" + ]; + + env = lib.mkIf (config.host == "xv-desktop") [ + "LIBVA_DRIVER_NAME,nvidia" + "XDG_SESSION_TYPE,wayland" + "GBM_BACKEND,nvidia-drm" + "__GLX_VENDOR_LIBRARY_NAME,nvidia" + ]; + + "$mod" = "SUPER"; + + input = { + follow_mouse = 2; + touchpad = { + natural_scroll = true; + scroll_factor = 0.5; + clickfinger_behavior = true; + }; + }; + + general = { + gaps_in = "5"; + gaps_out = "10"; + border_size = "2"; + + "col.active_border" = "rgba(00bfffee) rgba(36b7e2ee) 45deg"; + "col.inactive_border" = "rgba(0a3543aa)"; + + layout = "dwindle"; + }; + + decoration = { + rounding = "5"; + blur.enabled = "false"; + }; + + gestures = { + workspace_swipe = "on"; + workspace_swipe_distance = "200"; + }; + + misc = { + vfr = "true"; + vrr = 2; + force_default_wallpaper = "0"; + }; + + xwayland = { + force_zero_scaling = true; + }; + + workspace = lib.mkMerge [[ + + ] + (lib.mkIf (config.host == "xv-desktop") [ + "1, monitor:DP-1" + "2, monitor:DP-1" + "3, monitor:DP-1" + "4, monitor:DP-1" + "5, monitor:DP-1" + "6, monitor:HDMI-A-1" + "7, monitor:HDMI-A-1" + "8, monitor:HDMI-A-1" + "9, monitor:HDMI-A-1" + "10, monitor:HDMI-A-1" + ]) + (lib.mkIf (config.host == "xv-laptop") [ + "1, monitor:DP-10" + "2, monitor:DP-10" + "3, monitor:DP-10" + "4, monitor:DP-10" + "5, monitor:DP-9" + "6, monitor:DP-9" + "7, monitor:DP-9" + "8, monitor:eDP-1" + "9, monitor:eDP-1" + "10, monitor:eDP-1" + ])]; + + bind = [ + "$mod, Q, exec, alacritty" + "$mod, SPACE, exec, rofi -show drun" + ",Print, exec, grimblast copy area" + "$mod,ESCAPE, exec, nwg-bar" + "$mod, P, exit" + + "$mod, C, killactive" + "$mod SHIFT, C, exec, hyprctl kill" + "$mod, V, togglefloating" + "$mod, F, fullscreen, 0" + "$mod, M, fullscreen, 1" + "$mod SHIFT, L, exec, hyprlock" + "$mod, S, exec, systemctl suspend" + + "$mod, h, movefocus, l" + "$mod, l, movefocus, r" + "$mod, k, movefocus, u" + "$mod, j, movefocus, d" + + "$mod SHIFT, h, movewindow, l" + "$mod SHIFT, l, movewindow, r" + "$mod SHIFT, k, movewindow, u" + "$mod SHIFT, j, movewindow, d" + + "$mod ALT, h, resizeactive, -20 0" + "$mod ALT, l, resizeactive, 20 0" + "$mod ALT, k, resizeactive, 0 -20" + "$mod ALT, j, resizeactive, 0 20" + + "$mod, 1, workspace, 1" + "$mod, 2, workspace, 2" + "$mod, 3, workspace, 3" + "$mod, 4, workspace, 4" + "$mod, 5, workspace, 5" + "$mod, 6, workspace, 6" + "$mod, 7, workspace, 7" + "$mod, 8, workspace, 8" + "$mod, 9, workspace, 9" + "$mod, 0, workspace, 10" + + "$mod SHIFT, 1, movetoworkspace, 1" + "$mod SHIFT, 2, movetoworkspace, 2" + "$mod SHIFT, 3, movetoworkspace, 3" + "$mod SHIFT, 4, movetoworkspace, 4" + "$mod SHIFT, 5, movetoworkspace, 5" + "$mod SHIFT, 6, movetoworkspace, 6" + "$mod SHIFT, 7, movetoworkspace, 7" + "$mod SHIFT, 8, movetoworkspace, 8" + "$mod SHIFT, 9, movetoworkspace, 9" + "$mod SHIFT, 0, movetoworkspace, 10" + ]; + + bindle = [ + # Volume control + ",XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+" + ",XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" + + # Brightness control + ",XF86MonBrightnessUp, exec, brightnessctl set 5%+" + ",XF86MonBrightnessDown, exec, brightnessctl set 5%-" + ]; + + bindl= [ + # Toggle audio mute + ",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + + # Media control + ",XF86AudioPlay, exec, playerctl play-pause" + ",XF86AudioNext, exec, playerctl next" + ",XF86AudioPrev, exec, playerctl previous" + ]; + + bindm = [ + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + ]; + }; + }; + }; +} + diff --git a/modules/home/desktop-environments/hyprland/dunst.nix b/modules/home/desktop-environments/hyprland/dunst.nix new file mode 100644 index 0000000..3b1e039 --- /dev/null +++ b/modules/home/desktop-environments/hyprland/dunst.nix @@ -0,0 +1,7 @@ +{ config, ... }: + +{ + services.dunst = { + enable = config.settings.desktop-environments.hyprland.enable; + }; +} diff --git a/modules/home/gui/hyprland/fixes.nix b/modules/home/desktop-environments/hyprland/fixes.nix similarity index 100% rename from modules/home/gui/hyprland/fixes.nix rename to modules/home/desktop-environments/hyprland/fixes.nix diff --git a/modules/home/gui/hyprland/hyprpaper.nix b/modules/home/desktop-environments/hyprland/hyprpaper.nix similarity index 100% rename from modules/home/gui/hyprland/hyprpaper.nix rename to modules/home/desktop-environments/hyprland/hyprpaper.nix diff --git a/modules/home/gui/hyprland/kanshi.nix b/modules/home/desktop-environments/hyprland/kanshi.nix similarity index 100% rename from modules/home/gui/hyprland/kanshi.nix rename to modules/home/desktop-environments/hyprland/kanshi.nix diff --git a/modules/home/gui/hyprland/rofi.nix b/modules/home/desktop-environments/hyprland/rofi.nix similarity index 98% rename from modules/home/gui/hyprland/rofi.nix rename to modules/home/desktop-environments/hyprland/rofi.nix index 4bbfe91..1e88ab0 100644 --- a/modules/home/gui/hyprland/rofi.nix +++ b/modules/home/desktop-environments/hyprland/rofi.nix @@ -1,7 +1,7 @@ { config, pkgs, ... }: { programs.rofi = { - enable = true; + enable = config.settings.desktop-environments.hyprland.enable; package = pkgs.rofi-wayland; theme = let inherit (config.lib.formats.rasi) mkLiteral; diff --git a/modules/home/gui/hyprland/waybar.nix b/modules/home/desktop-environments/hyprland/waybar.nix similarity index 98% rename from modules/home/gui/hyprland/waybar.nix rename to modules/home/desktop-environments/hyprland/waybar.nix index 193948a..c305f96 100644 --- a/modules/home/gui/hyprland/waybar.nix +++ b/modules/home/desktop-environments/hyprland/waybar.nix @@ -2,7 +2,7 @@ { programs.waybar = { - enable = true; + enable = config.settings.desktop-environments.hyprland.enable; settings = { mainBar = { layer = "top"; diff --git a/modules/home/gui/common/alacritty.nix b/modules/home/gui/common/alacritty.nix deleted file mode 100644 index abbbcc9..0000000 --- a/modules/home/gui/common/alacritty.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ config, ... }: - -{ - programs.alacritty = { - enable = true; - settings = { - font = { - normal = { family = "DejaVuSansM Nerd Font"; style = "Regular"; }; - }; - window = { - opacity = 0.8; - padding = { x = 10; y = 10; }; - }; - colors = { - draw_bold_text_with_bright_colors = false; - primary = { - background = "0x${config.colorScheme.palette.base00}"; - foreground = "0x${config.colorScheme.palette.base05}"; - }; - cursor = { - text = "0x${config.colorScheme.palette.base00}"; - cursor = "0x${config.colorScheme.palette.base05}"; - }; - normal = { - black = "0x${config.colorScheme.palette.base00}"; - red = "0x${config.colorScheme.palette.base08}"; - green = "0x${config.colorScheme.palette.base0B}"; - yellow = "0x${config.colorScheme.palette.base0A}"; - blue = "0x${config.colorScheme.palette.base0D}"; - magenta = "0x${config.colorScheme.palette.base0E}"; - cyan = "0x${config.colorScheme.palette.base0C}"; - white = "0x${config.colorScheme.palette.base05}"; - }; - bright = { - black = "0x${config.colorScheme.palette.base03}"; - red = "0x${config.colorScheme.palette.base09}"; - green = "0x${config.colorScheme.palette.base01}"; - yellow = "0x${config.colorScheme.palette.base02}"; - blue = "0x${config.colorScheme.palette.base04}"; - magenta = "0x${config.colorScheme.palette.base06}"; - cyan = "0x${config.colorScheme.palette.base0F}"; - white = "0x${config.colorScheme.palette.base07}"; - }; - }; - }; - }; -} diff --git a/modules/home/gui/common/default.nix b/modules/home/gui/common/default.nix deleted file mode 100644 index 05d2bb8..0000000 --- a/modules/home/gui/common/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ pkgs, ...}: - -{ - imports = [ - ./alacritty.nix - ./firefox.nix - ./fonts.nix - ]; - - home.packages = with pkgs; [ - vlc - bitwarden - pavucontrol - ]; -} diff --git a/modules/home/gui/common/firefox.nix b/modules/home/gui/common/firefox.nix deleted file mode 100644 index 5bf5cb5..0000000 --- a/modules/home/gui/common/firefox.nix +++ /dev/null @@ -1,154 +0,0 @@ -{ inputs, pkgs, ... }: - -{ - # about:policies - # Check about:support for extension/add-on ID strings. - # Check about:config for options. - - - home.packages = with pkgs; [ - unstable.firefoxpwa - ]; - - programs.firefox = { - enable = true; - nativeMessagingHosts = [ pkgs.unstable.firefoxpwa ]; - policies = { - DisableTelemetry = true; - DisableFirefoxStudies = true; - EnableTrackingProtection = { - Value = true; - Locked = true; - Cryptomining = true; - Fingerprinting = true; - }; - DisablePocket = true; - DisableFirefoxAccounts = true; - DisableAccounts = true; - DontCheckDefaultBrowser = true; - DisplayBookmarksToolbar = "newpage"; - ExtensionSettings = { - "nl-NL@dictionaries.addons.mozilla.org" = { - install_url = "https://addons.mozilla.org/firefox/downloads/latest/woordenboek-nederlands/latest.xpi"; - installation_mode = "force_installed"; - }; - "uBlock0@raymondhill.net" = { - install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; - installation_mode = "force_installed"; - }; - "{446900e4-71c2-419f-a6a7-df9c091e268b}" = { - install_url = "https://addons.mozilla.org/firefox/downloads/latest/bitwarden-password-manager/latest.xpi"; - installation_mode = "force_installed"; - }; - "firefoxpwa@filips.si" = { - install_url = "https://addons.mozilla.org/firefox/downloads/latest/pwas-for-firefox/latest.xpi"; - installation_mode = "force_installed"; - }; - "markdown-viewer@outofindex.com" = { - install_url = "https://addons.mozilla.org/firefox/downloads/latest/markdown-viewer-chrome/latest.xpi"; - installation_mode = "force_installed"; - }; - }; - }; - profiles.xeovalyte = { - bookmarks = [ - { - name = "Toolbar"; - toolbar = true; - bookmarks = [ - { - name = "Brightspace"; - bookmarks = [ - { - name = "Books"; - url = "https://drive.google.com/drive/folders/1L5OTbn5p3i7_Nc80hc5PztiEGHKwi-I4"; - } - { - name = "LCB"; - url = "https://brightspace.tudelft.nl/d2l/le/content/681010/Home"; - } - { - name = "Calculus"; - url = "https://brightspace.tudelft.nl/d2l/le/content/681024/Home"; - } - { - name = "IP1"; - url = "https://brightspace.tudelft.nl/d2l/le/content/681020/Home"; - } - ]; - } - ]; - } - ]; - search.engines = { - "Nix" = { - urls = [{ - template = "https://mynixos.com/search"; - params = [ - { name = "q"; value = "{searchTerms}"; } - ]; - }]; - - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = [ "@nix" ]; - }; - - "SearXNG" = { - urls = [{ - template = "https:/search.xeovalyte.dev/search"; - params = [ - { name = "q"; value = "{searchTerms}"; } - ]; - }]; - - definedAliases = [ "@searxng" ]; - }; - - "Startpage" = { - urls = [{ - template = "https:/startpage.com/sp/search"; - params = [ - { name = "q"; value = "{searchTerms}"; } - ]; - }]; - - definedAliases = [ "@sp" ]; - }; - - "Bing".metaData.hidden = true; - "Google".metaData.hidden = true; - "eBay".metaData.hidden = true; - }; - search.force = true; - search.default = "SearXNG"; - - settings = { - "browser.disableResetPrompt" = true; - "browser.download.panel.shown" = true; - "browser.download.useDownloadDir" = false; - "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; - "browser.shell.checkDefaultBrowser" = false; - "browser.shell.defaultBrowserCheckCount" = 1; - "dom.security.https_only_mode" = true; - "privacy.trackingProtection.enabled" = true; - "browser.toolbars.bookmarks.visibility" = "newtab"; - "browser.translations.neverTranslateLanguages" = "nl"; - "browser.newtabpage.pinned" = [ - { - label = "Server"; - url = "https://home.xeovalyte.dev"; - } - { - label = "Youtube"; - url = "https://youtube.com"; - } - { - label = "My TU Delft"; - url = "https://my.tudelft.nl/"; - } - ]; - "signon.rememberSignons" = false; - }; - }; - }; -} diff --git a/modules/home/gui/common/fonts.nix b/modules/home/gui/common/fonts.nix deleted file mode 100644 index fc58e8a..0000000 --- a/modules/home/gui/common/fonts.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ pkgs, ... }: - -{ - fonts.fontconfig.enable = true; - - home.packages = with pkgs; [ - noto-fonts - fira-code - font-awesome - dejavu_fonts - roboto - (nerdfonts.override { fonts = [ "DejaVuSansMono" ]; }) - ]; -} diff --git a/modules/home/gui/hyprland/default.nix b/modules/home/gui/hyprland/default.nix deleted file mode 100644 index 3bc6c8a..0000000 --- a/modules/home/gui/hyprland/default.nix +++ /dev/null @@ -1,197 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ - imports = [ - ./waybar.nix - ./fixes.nix - ./dunst.nix - ./rofi.nix - ]; - - home.packages = with pkgs; [ - alacritty - wev - brightnessctl - playerctl - wl-clipboard - grimblast - nwg-bar - powertop - lxqt.lxqt-policykit - - networkmanagerapplet - ]; - - wayland.windowManager.hyprland = { - enable = true; - settings = { - monitor = lib.mkIf (config.host == "xv-laptop") [ - "eDP-1,preferred,3840x0,1.333" - "DP-10,preferred,0x0,1" - "DP-9,preferred,1920x0,1" - ]; - - exec-once = [ - "waybar" - "lxqt-policykit-agent" - "nm-applet" - "blueman-applet" - ]; - - env = lib.mkIf (config.host == "xv-desktop") [ - "LIBVA_DRIVER_NAME,nvidia" - "XDG_SESSION_TYPE,wayland" - "GBM_BACKEND,nvidia-drm" - "__GLX_VENDOR_LIBRARY_NAME,nvidia" - ]; - - "$mod" = "SUPER"; - - input = { - follow_mouse = 2; - touchpad = { - natural_scroll = true; - scroll_factor = 0.5; - clickfinger_behavior = true; - }; - }; - - general = { - gaps_in = "5"; - gaps_out = "10"; - border_size = "2"; - - "col.active_border" = "rgba(00bfffee) rgba(36b7e2ee) 45deg"; - "col.inactive_border" = "rgba(0a3543aa)"; - - layout = "dwindle"; - }; - - decoration = { - rounding = "5"; - blur.enabled = "false"; - }; - - gestures = { - workspace_swipe = "on"; - workspace_swipe_distance = "200"; - }; - - misc = { - vfr = "true"; - vrr = 2; - force_default_wallpaper = "0"; - }; - - xwayland = { - force_zero_scaling = true; - }; - - workspace = lib.mkMerge [[ - - ] - (lib.mkIf (config.host == "xv-desktop") [ - "1, monitor:DP-1" - "2, monitor:DP-1" - "3, monitor:DP-1" - "4, monitor:DP-1" - "5, monitor:DP-1" - "6, monitor:HDMI-A-1" - "7, monitor:HDMI-A-1" - "8, monitor:HDMI-A-1" - "9, monitor:HDMI-A-1" - "10, monitor:HDMI-A-1" - ]) - (lib.mkIf (config.host == "xv-laptop") [ - "1, monitor:DP-10" - "2, monitor:DP-10" - "3, monitor:DP-10" - "4, monitor:DP-10" - "5, monitor:DP-9" - "6, monitor:DP-9" - "7, monitor:DP-9" - "8, monitor:eDP-1" - "9, monitor:eDP-1" - "10, monitor:eDP-1" - ])]; - - bind = [ - "$mod, Q, exec, alacritty" - "$mod, SPACE, exec, rofi -show drun" - ",Print, exec, grimblast copy area" - "$mod,ESCAPE, exec, nwg-bar" - "$mod, P, exit" - - "$mod, C, killactive" - "$mod SHIFT, C, exec, hyprctl kill" - "$mod, V, togglefloating" - "$mod, F, fullscreen, 0" - "$mod, M, fullscreen, 1" - "$mod SHIFT, L, exec, hyprlock" - "$mod, S, exec, systemctl suspend" - - "$mod, h, movefocus, l" - "$mod, l, movefocus, r" - "$mod, k, movefocus, u" - "$mod, j, movefocus, d" - - "$mod SHIFT, h, movewindow, l" - "$mod SHIFT, l, movewindow, r" - "$mod SHIFT, k, movewindow, u" - "$mod SHIFT, j, movewindow, d" - - "$mod ALT, h, resizeactive, -20 0" - "$mod ALT, l, resizeactive, 20 0" - "$mod ALT, k, resizeactive, 0 -20" - "$mod ALT, j, resizeactive, 0 20" - - "$mod, 1, workspace, 1" - "$mod, 2, workspace, 2" - "$mod, 3, workspace, 3" - "$mod, 4, workspace, 4" - "$mod, 5, workspace, 5" - "$mod, 6, workspace, 6" - "$mod, 7, workspace, 7" - "$mod, 8, workspace, 8" - "$mod, 9, workspace, 9" - "$mod, 0, workspace, 10" - - "$mod SHIFT, 1, movetoworkspace, 1" - "$mod SHIFT, 2, movetoworkspace, 2" - "$mod SHIFT, 3, movetoworkspace, 3" - "$mod SHIFT, 4, movetoworkspace, 4" - "$mod SHIFT, 5, movetoworkspace, 5" - "$mod SHIFT, 6, movetoworkspace, 6" - "$mod SHIFT, 7, movetoworkspace, 7" - "$mod SHIFT, 8, movetoworkspace, 8" - "$mod SHIFT, 9, movetoworkspace, 9" - "$mod SHIFT, 0, movetoworkspace, 10" - ]; - - bindle = [ - # Volume control - ",XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+" - ",XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" - - # Brightness control - ",XF86MonBrightnessUp, exec, brightnessctl set 5%+" - ",XF86MonBrightnessDown, exec, brightnessctl set 5%-" - ]; - - bindl= [ - # Toggle audio mute - ",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" - - # Media control - ",XF86AudioPlay, exec, playerctl play-pause" - ",XF86AudioNext, exec, playerctl next" - ",XF86AudioPrev, exec, playerctl previous" - ]; - - bindm = [ - "$mod, mouse:272, movewindow" - "$mod, mouse:273, resizewindow" - ]; - }; - }; -} diff --git a/modules/home/gui/hyprland/dunst.nix b/modules/home/gui/hyprland/dunst.nix deleted file mode 100644 index f3fb5e1..0000000 --- a/modules/home/gui/hyprland/dunst.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ ... }: - -{ - services.dunst = { - enable = true; - }; -} diff --git a/modules/home/gui/modrinth.nix b/modules/home/gui/modrinth.nix deleted file mode 100644 index 2b6bfe8..0000000 --- a/modules/home/gui/modrinth.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ input, pkgs, lib, ... }: - -{ - - home.packages = with pkgs; [ - unstable.modrinth-app - ]; -} diff --git a/modules/home/gui/nextcloud.nix b/modules/home/gui/nextcloud.nix deleted file mode 100644 index af8e4de..0000000 --- a/modules/home/gui/nextcloud.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ ... }: - -{ - services.nextcloud-client = { - enable = true; - startInBackground = true; - }; -} diff --git a/modules/home/gui/thunderbird.nix b/modules/home/gui/thunderbird.nix deleted file mode 100644 index 24f4149..0000000 --- a/modules/home/gui/thunderbird.nix +++ /dev/null @@ -1,86 +0,0 @@ -{ pkgs, ... }: - -{ - programs.thunderbird = { - enable = true; - package = pkgs.unstable.thunderbird; - profiles = { - default = { - isDefault = true; - }; - }; - }; - - accounts.email.accounts = { - ziggo = { - imap = { - host = "imap.ziggo.nl"; - port = 993; - tls = { - enable = true; - }; - }; - smtp = { - host = "smtp.ziggo.nl"; - port = 587; - tls = { - enable = true; - useStartTls = true; - }; - }; - address = "timo.boomers@ziggo.nl"; - realName = "Timo Boomers"; - userName = "timo.boomers@ziggo.nl"; - primary = true; - thunderbird.enable = true; - thunderbird.profiles = [ "default" ]; - }; - tudelft = { - imap = { - host = "outlook.office365.com"; - port = 993; - tls = { - enable = true; - }; - }; - smtp = { - host = "smtp.office365.com"; - port = 587; - tls = { - enable = true; - useStartTls = false; - }; - }; - address = "tboomers@tudelft.nl"; - realName = "Timo Boomers"; - userName = "tboomers@tudelft.nl"; - primary = false; - thunderbird.enable = true; - thunderbird.profiles = [ "default" ]; - }; - xeovalyte = { - imap = { - host = "mail.xeovalyte.dev"; - port = 993; - tls = { - enable = true; - }; - }; - smtp = { - host = "mail.xeovalyte.dev"; - port = 587; - tls = { - enable = true; - useStartTls = true; - }; - }; - address = "timo@xeovalyte.dev"; - aliases = [ "me@xeovalyte.dev" "contact@xeovalyte.dev" ]; - realName = "Timo Boomers"; - userName = "me@xeovalyte.dev"; - primary = false; - thunderbird.enable = true; - thunderbird.profiles = [ "default" ]; - }; - }; -} diff --git a/modules/home/services/nextcloud.nix b/modules/home/services/nextcloud.nix new file mode 100644 index 0000000..cdab162 --- /dev/null +++ b/modules/home/services/nextcloud.nix @@ -0,0 +1,23 @@ +{ config, lib, ... }: + +with lib; + +let + cfg = config.settings.services.nextcloud-sync; +in { + options = { + settings.services.nextcloud-sync.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable Nextcloud syncronisation + ''; + }; + }; + + config = mkIf cfg.enable { + services.nextcloud-client = { + enable = true; + startInBackground = true; + }; + }; +} diff --git a/modules/home/theming/fonts.nix b/modules/home/theming/fonts.nix new file mode 100644 index 0000000..28682b7 --- /dev/null +++ b/modules/home/theming/fonts.nix @@ -0,0 +1,29 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.settings.theming.fonts; +in { + options = { + settings.theming.fonts.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable fonts + ''; + }; + }; + + config = mkIf cfg.enable { + fonts.fontconfig.enable = true; + + home.packages = with pkgs; [ + noto-fonts + fira-code + font-awesome + dejavu_fonts + roboto + (nerdfonts.override { fonts = [ "DejaVuSansMono" ]; }) + ]; + }; +} diff --git a/modules/home/gui/theming.nix b/modules/home/theming/nix-colors.nix similarity index 77% rename from modules/home/gui/theming.nix rename to modules/home/theming/nix-colors.nix index b858239..78652b4 100644 --- a/modules/home/gui/theming.nix +++ b/modules/home/theming/nix-colors.nix @@ -1,15 +1,27 @@ { config, nix-colors, pkgs, lib, ... }: + +with lib; + let + cfg = config.settings.theming.nix-colors; inherit (nix-colors.lib-contrib { inherit pkgs; }) gtkThemeFromScheme; -in -{ +in { + options = { + settings.theming.nix-colors.enable = lib.mkOption { + type = lib.types.bool; + description = '' + Enable nix colors configuration + ''; + }; + }; + imports = [ nix-colors.homeManagerModules.default ]; - config = { + config = mkIf cfg.enable { colorScheme = nix-colors.colorSchemes.da-one-sea; gtk = lib.mkIf (config.headless == false) {