diff --git a/modules/home/default.nix b/modules/home/default.nix index 3f52cf2..bd53f66 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -1,9 +1,13 @@ { imports = [ ./direnv.nix + ./firefox.nix ./git.nix ./kitty.nix ./packages.nix + ./ssh.nix ./starship.nix + ./vim.nix + ./vscode.nix ]; } diff --git a/modules/home/firefox.nix b/modules/home/firefox.nix new file mode 100644 index 0000000..9f793a9 --- /dev/null +++ b/modules/home/firefox.nix @@ -0,0 +1,86 @@ +{ pkgs, ... }: +{ + programs.firefox = { + enable = true; + + # Next release of HomeManger + # languagePacks = [ + # "en-US" + # "it" + # ]; + + nativeMessagingHosts = [ pkgs.kdePackages.plasma-browser-integration ]; + + profiles.default = { + name = "Default"; + # Use Firefox Sync instead + # extensions = [ + # "ublock-origin" + # "augmented-steam" + # "bitwarden-password-manager" + # "bloody-vikings" + # "private-relay" + # "flagfox" + # "imagus-mod" + # "materialdesignicons-picker" + # "old-reddit-redirect" + # "reddit-enhancement-suite" + # "tampermonkey" + # "vimium-ff" + # "xirvik-torrent-to-seedbox-uplo" + # ]; + + search = { + default = "DuckDuckGo"; + privateDefault = "DuckDuckGo"; + engines = { + "Nix Packages" = { + urls = [ + { + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; + + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@np" ]; + }; + + "NixOS Wiki" = { + urls = [{ template = "https://wiki.nixos.org/index.php?search={searchTerms}"; }]; + iconUpdateURL = "https://wiki.nixos.org/favicon.png"; + updateInterval = 24 * 60 * 60 * 1000; # every day + definedAliases = [ "@nw" ]; + }; + }; + }; + + settings = { + # Pazpi config + "browser.backspace_action" = 0; # Backspace previous tab + "browser.translation.neverForLanguages" = "it"; + "browser.translations.neverTranslateLanguages" = "it"; + + "extensions.activeThemeID" = "firefox-compact@mozilla.org"; + + # For Firefox GNOME theme: + # "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + # "browser.tabs.drawInTitlebar" = true; + # "svg.context-properties.content.enabled" = true; + }; + # userChrome = '' + # @import "firefox-gnome-theme/userChrome.css"; + # @import "firefox-gnome-theme/theme/colors/dark.css"; + # ''; + }; + }; +} diff --git a/modules/home/ssh.nix b/modules/home/ssh.nix new file mode 100644 index 0000000..1f3a796 --- /dev/null +++ b/modules/home/ssh.nix @@ -0,0 +1,25 @@ +{ ... }: +{ + programs.ssh = { + enable = true; + addKeysToAgent = "yes"; + matchBlocks = { + "ts.pazpi.top" = { + hostname = "linux-krzo.neon-dory.ts.net"; + user = "pazpi"; + }; + + "vps.spain.1" = { + hostname = "93.93.112.9"; + user = "pazpi"; + }; + + "vps.dutch.1" = { + hostname = "192.71.151.141"; + user = "root"; + }; + + }; + + }; +} diff --git a/modules/home/vim.nix b/modules/home/vim.nix new file mode 100644 index 0000000..1679d71 --- /dev/null +++ b/modules/home/vim.nix @@ -0,0 +1,81 @@ +{ pkgs, ... }: +{ + programs.vim = { + enable = true; + + defaultEditor = true; + + plugins = with pkgs.vimPlugins; [ + vim-clap + switch-vim # switch between two world (TRUE<->FALSE) + vim-easy-align # allign text + vim-highlightedyank # see what you have yanked + + # Vim Functional Enchancements + nerdcommenter # quick comment line of code + ale # error checking multiple language + tagbar # left panel with tag (es function or macro for different programming language) + + # GUI enhancements + vim-airline # status line + vim-airline-themes # themes for airline + + # Git + vim-gitgutter # git diff next to line number + vim-fugitive # manage git inside vim + gv-vim # git tree :GV + + # Syntactic language support + vim-polyglot # A collection of language packs for Vim. + + # Fuzzy Finders + fzf-vim # Fzf fuzzy finder + + # Colorschema + # catppuccin-vim + ]; + + settings = { + background = "dark"; + copyindent = true; + directory = [ + "~/.vim/.tmp" + "~/tmp" + "/tmp" + ]; + hidden = true; + history = 3000; + ignorecase = true; + modeline = false; + mouse = "a"; + number = true; + relativenumber = true; + shiftwidth = 4; + smartcase = true; + tabstop = 4; + undofile = true; + undodir = [ + "~/.vim/undo" + "~/tmp" + "/tmp" + ]; + }; + + extraConfig = '' + let mapleader="," + let mapocalleader="\\" + set termguicolors + set clipboard=unnamedplus " normal OS clipboard interaction + set foldenable + set incsearch + set pastetoggle= " when in insert mode, press to go to paste mode, where you can paste mass data that won't be autoindented + set scrolloff=4 " keep 4 lines off the edges of the screen when scrolling + set wrap + set wildmenu " make tab completion for files/buffers act like bash + set wildmode=longest:full,full " show a list when pressing tab and complete first full match + set wildignore=*.swp,*.bak,*.pyc,*.class,.hg,.svn,*~,*.png,*.jpg,*.gif + set title " change the terminal's title + ''; + + }; +} diff --git a/modules/home/vscode.nix b/modules/home/vscode.nix new file mode 100644 index 0000000..5520666 --- /dev/null +++ b/modules/home/vscode.nix @@ -0,0 +1,179 @@ +{ pkgs, ... }: +{ + programs.vscode = { + + enable = true; + enableUpdateCheck = false; + + extensions = + (with pkgs.vscode-extensions; [ + # Bash + timonwong.shellcheck + + # C# + ms-dotnettools.vscodeintellicode-csharp + ms-dotnettools.vscode-dotnet-runtime + ms-dotnettools.csharp + ms-dotnettools.csdevkit + + # Nix + arrterian.nix-env-selector + jnoortheen.nix-ide + + # Theme and Icons + catppuccin.catppuccin-vsc-icons + catppuccin.catppuccin-vsc + + # General Dev + continue.continue + dotenv.dotenv-vscode + ms-vscode.hexeditor + mkhl.direnv + skellock.just + ms-vscode-remote.remote-ssh + + # Formatter + redhat.vscode-xml + + ]) + ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ + { + name = "remote-ssh-edit"; + publisher = "ms-vscode-remote"; + version = "0.47.2"; + sha256 = "1hp6gjh4xp2m1xlm1jsdzxw9d8frkiidhph6nvl24d0h8z34w49g"; + } + ]; + + # ++ (with extensions.vscode-marketplace; [ + # # C# + # patcx.vscode-nuget-gallery + # # Tool + # jetpack-io.devbox + # rangav.vscode-thunder-client + # ]); + + keybindings = [ + { + "key" = "ctrl+k ctrl+c"; + "command" = "editor.action.commentLine"; + "when" = "editorTextFocus && !editorReadonly"; + } + { + "key" = "ctrl+k ctrl+u"; + "command" = "editor.action.removeCommentLine"; + "when" = "editorTextFocus && !editorReadonly"; + } + { + "key" = "ctrl+r ctrl+r"; + "command" = "editor.action.rename"; + "when" = "editorHasRenameProvider && editorTextFocus && !editorReadonly"; + } + { + "key" = "alt+d"; + "command" = "editor.action.copyLinesDownAction"; + "when" = "editorTextFocus && !editorReadonly"; + } + { + "key" = "ctrl+shift+alt+down"; + "command" = "-editor.action.copyLinesDownAction"; + "when" = "editorTextFocus && !editorReadonly"; + } + { + "key" = "shift+alt+d"; + "command" = "editor.action.copyLinesUpAction"; + "when" = "editorTextFocus && !editorReadonly"; + } + { + "key" = "ctrl+shift+alt+up"; + "command" = "-editor.action.copyLinesUpAction"; + "when" = "editorTextFocus && !editorReadonly"; + } + ]; + + userSettings = { + # Editor + "telemetry.telemetryLevel" = "off"; + "update.mode" = "none"; + + "workbench.colorTheme" = "Flexoki Light"; + "workbench.iconTheme" = "catppuccin-latte"; + "workbench.editor.wrapTabs" = true; + "explorer.excludeGitIgnore" = true; + "files.autoSave" = "afterDelay"; + "files.autoSaveDelay" = 5000; + "diffEditor.codeLens" = true; + "diffEditor.ignoreTrimWhitespace" = false; + "editor.bracketPairColorization.enabled" = true; + "editor.formatOnPaste" = true; + "editor.formatOnSave" = true; + "editor.formatOnType" = true; + "editor.quickSuggestions" = { + "comments" = "on"; + "strings" = "on"; + "other" = "on"; + }; + + "window.titleBarStyle" = "custom"; + + # Git + "git.enableSmartCommit" = true; + "git.autofetch" = true; + + # C# + # "csharp.maxProjectFileCountForDiagnosticAnalysis" = 100; + # "csharp.semanticHighlighting.enabled" = true; + # "csharp.suppressHiddenDiagnostics" = false; + # "dotnetAcquisitionExtension.enableTelemetry" = false; + # "omnisharp.enableEditorConfigSupport" = true; + # "omnisharp.useModernNet" = true; + # "omnisharp.useGlobalMono" = "never"; + #"dotnet.dotnetPath" = "/home/${config.home.username}/.nix-profile/bin/dotnet"; + #"omnisharp.sdkPath" = "/home/${config.home.username}/.nix-profile/bin/dotnet"; + #"dotnet.preferCSharpExtension" = false; + # "dotnetAcquisitionExtension.existingDotnetPath" = [ + # { + # "extensionId" = "ms-dotnettools.csdevkit"; + # "path" = "/home/${config.home.username}/.nix-profile/bin/dotnet"; + # } + # ]; + # "NugetGallery.sources" = [ + # "{\"name\": \"nuget.org\",\"url\": \"https://api.nuget.org/v3/index.json\"}" + # ]; + + # Markdown + "markdown-preview-enhanced.previewTheme" = "github-dark.css"; + + # Python + "python.experiments.enabled" = false; + "python.analysis.inlayHints.variableTypes" = true; + "python.analysis.inlayHints.pytestParameters" = true; + "python.analysis.inlayHints.functionReturnTypes" = true; + + # Bash + "shellcheck.customArgs" = [ "-x" ]; + "shellcheck.exclude" = [ "2001" ]; + + # Nix + "nix.formatterPath" = [ + "nix" + "fmt" + "--" + "-" + ]; + "nix.serverPath" = "nil"; + "nix.enableLanguageServer" = true; + "nix.serverSettings" = { + "nil" = { + "diagnostics" = { + "ignored" = [ + "unused_binding" + "unused_with" + ]; + }; + }; + }; + }; + + }; +}