From d390969fca0c3cbc03dedab1821e7bfcaf20e1dd Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Sat, 30 Dec 2023 12:22:04 +0100 Subject: [PATCH 1/6] Fix xdg directories --- modules/home-manager/desktop/sway/default.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/home-manager/desktop/sway/default.nix b/modules/home-manager/desktop/sway/default.nix index ca0d43a..ec4e4b3 100644 --- a/modules/home-manager/desktop/sway/default.nix +++ b/modules/home-manager/desktop/sway/default.nix @@ -91,14 +91,14 @@ in userDirs = { enable = true; createDirectories = true; - documents = "documents"; - download = "downloads"; - music = "medias/musics"; - pictures = "medias/images"; - videos = "medias/videos"; - templates = "tmp"; - desktop = "documents"; - publicShare = "tmp/public"; + documents = "${config.home.homeDirectory}/documents"; + download = "${config.home.homeDirectory}/downloads"; + music = "${config.home.homeDirectory}/medias/musics"; + pictures = "${config.home.homeDirectory}/medias/images"; + videos = "${config.home.homeDirectory}/medias/videos"; + templates = "${config.home.homeDirectory}/tmp"; + desktop = "${config.home.homeDirectory}/documents"; + publicShare = "${config.home.homeDirectory}/tmp/public"; }; }; }; From f65ec32010032eaee05cac982a95b86abbce28ad Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Sat, 30 Dec 2023 12:23:20 +0100 Subject: [PATCH 2/6] Update Firefox configuration --- .../web/firefox/conf/preferences.nix | 3 --- .../home-manager/web/firefox/conf/privacy.nix | 19 +-------------- .../home-manager/web/firefox/conf/suggest.nix | 13 ++++++++++ .../home-manager/web/firefox/conf/theme.nix | 12 +++++----- modules/home-manager/web/firefox/default.nix | 24 +++++++++++++++++++ .../home-manager/web/qutebrowser/default.nix | 2 +- 6 files changed, 45 insertions(+), 28 deletions(-) diff --git a/modules/home-manager/web/firefox/conf/preferences.nix b/modules/home-manager/web/firefox/conf/preferences.nix index 376d50b..9158bf0 100644 --- a/modules/home-manager/web/firefox/conf/preferences.nix +++ b/modules/home-manager/web/firefox/conf/preferences.nix @@ -29,9 +29,6 @@ # Allow fullscreen in Firefox windows "full-screen-api.ignore-widgets" = true; -# Download preferences - "browser.download.dir" = "~/downloads"; - # About:config show warning "browser.aboutConfig.showWarning" = false; diff --git a/modules/home-manager/web/firefox/conf/privacy.nix b/modules/home-manager/web/firefox/conf/privacy.nix index 20fa927..bd8a499 100644 --- a/modules/home-manager/web/firefox/conf/privacy.nix +++ b/modules/home-manager/web/firefox/conf/privacy.nix @@ -100,26 +100,9 @@ # from a web page, and it lets them know which part of the page had been selected. "dom.event.clipboardevents.enabled" = false; -# Disable Search Suggestions -# Firefox suggests search terms in the search field. This will send everything -# typed or pasted in the search field to the chosen search engine, even when you -# did not press enter. - - "browser.search.suggest.enabled" = true; -# Disable Search Keyword -# When you mistype some url, Firefox starts a search even from urlbar. This -# feature is useful for quick searching, but may harm your privacy, when it's -# unintended. - - "keyword.enabled" = true; # Disable Fixup URLs # When you type "something" in the urlbar and press enter, Firefox tries # "something.com", if Fixup URLs is enabled. - "browser.fixup.alternate.enabled" = true; + "browser.fixup.alternate.enabled" = false; -# Tracking protection - "privacy.trackingprotection.enabled" = true; - "privacy.trackingprotection.pbmode.enabled" = true; - "privacy.trackingprotection.cryptomining.enabled" = true; - "privacy.trackingprotection.fingerprinting.enabled" = true; } diff --git a/modules/home-manager/web/firefox/conf/suggest.nix b/modules/home-manager/web/firefox/conf/suggest.nix index 77d236b..34c01fc 100644 --- a/modules/home-manager/web/firefox/conf/suggest.nix +++ b/modules/home-manager/web/firefox/conf/suggest.nix @@ -8,4 +8,17 @@ # serve advertisements. "browser.urlbar.groupLabels.enabled" = false; "browser.urlbar.quicksuggest.enabled" = false; + "browser.urlbar.suggest.addons" = false; + "browser.urlbar.suggest.mdn" = false; + "browser.urlbar.suggest.pocket" = false; + "browser.search.suggest.enabled" = false; + "browser.urlbar.suggest.trending" = false; + "browser.urlbar.suggest.weather" = false; + "browser.urlbar.suggest.searches" = false; + +# Disable Search Keyword +# When you mistype some url, Firefox starts a search even from urlbar. This +# feature is useful for quick searching, but may harm your privacy, when it's +# unintended. + "keyword.enabled" = false; } diff --git a/modules/home-manager/web/firefox/conf/theme.nix b/modules/home-manager/web/firefox/conf/theme.nix index 6ef7039..1e77222 100644 --- a/modules/home-manager/web/firefox/conf/theme.nix +++ b/modules/home-manager/web/firefox/conf/theme.nix @@ -19,16 +19,16 @@ "browser.preferences.moreFromMozilla" = false; # Do not save my logins - "signon.rememberSignons" = true; + "signon.rememberSignons" = false; -# Do not suggest some research - "browser.urlbar.suggest.searches" = true; - "browser.search.suggest.enabled" = true; - -# do not override startus page +# do not override status page "startup.homepage_override_url" = ""; "startup.homepage_welcome_url" = ""; # do not show bookmark page "browser.toolbars.bookmarks.visibility" = "never"; + +# disable funsking malwares + "browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts.havePinned" = ""; + "browser.newtabpage.pinned" = ""; } diff --git a/modules/home-manager/web/firefox/default.nix b/modules/home-manager/web/firefox/default.nix index 67d6e4f..40336cd 100644 --- a/modules/home-manager/web/firefox/default.nix +++ b/modules/home-manager/web/firefox/default.nix @@ -42,6 +42,30 @@ in search = { force = true; default = "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://nixos.wiki/index.php?search={searchTerms}"; }]; + iconUpdateURL = "https://nixos.wiki/favicon.png"; + updateInterval = 24 * 60 * 60 * 1000; # every day + definedAliases = [ "@nw" ]; + }; + + "Bing".metaData.hidden = true; + "Google".metaData.hidden = true; + "Amazon.fr".metaData.hidden = true; + }; }; settings = merge [ (import ./conf/doh.nix) diff --git a/modules/home-manager/web/qutebrowser/default.nix b/modules/home-manager/web/qutebrowser/default.nix index 212a428..caa7e0f 100644 --- a/modules/home-manager/web/qutebrowser/default.nix +++ b/modules/home-manager/web/qutebrowser/default.nix @@ -5,7 +5,7 @@ let in { options.modules.web.qutebrowser = { - enable = mkEnableOption "enable Kdenlive video editor"; + enable = mkEnableOption "enable Qutebrowser web browser"; }; config = mkIf cfg.enable { programs.qutebrowser = { From a0e567229062bb148694d3a1952d4f162e833416 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Sat, 30 Dec 2023 13:04:55 +0100 Subject: [PATCH 3/6] Convert Neovim configuration to module --- home-manager/cli/default.nix | 1 - home-manager/cli/neovim/default.nix | 122 ----------------- hosts/luci/home-config.nix | 1 + modules/home-manager/cli/neovim/default.nix | 128 ++++++++++++++++++ .../home-manager}/cli/neovim/files/cmp.lua | 0 .../cli/neovim/files/lspconfig.lua | 0 .../cli/neovim/files/lualine.lua | 0 .../cli/neovim/files/luasnip.lua | 0 .../cli/neovim/files/neotree.lua | 0 .../cli/neovim/files/options.lua | 0 .../cli/neovim/files/treesitter.lua | 0 .../cli/neovim/files/whichkey.lua | 0 modules/home-manager/default.nix | 1 + 13 files changed, 130 insertions(+), 123 deletions(-) delete mode 100644 home-manager/cli/neovim/default.nix create mode 100644 modules/home-manager/cli/neovim/default.nix rename {home-manager => modules/home-manager}/cli/neovim/files/cmp.lua (100%) rename {home-manager => modules/home-manager}/cli/neovim/files/lspconfig.lua (100%) rename {home-manager => modules/home-manager}/cli/neovim/files/lualine.lua (100%) rename {home-manager => modules/home-manager}/cli/neovim/files/luasnip.lua (100%) rename {home-manager => modules/home-manager}/cli/neovim/files/neotree.lua (100%) rename {home-manager => modules/home-manager}/cli/neovim/files/options.lua (100%) rename {home-manager => modules/home-manager}/cli/neovim/files/treesitter.lua (100%) rename {home-manager => modules/home-manager}/cli/neovim/files/whichkey.lua (100%) diff --git a/home-manager/cli/default.nix b/home-manager/cli/default.nix index 1eb4ae3..dc0a3b6 100644 --- a/home-manager/cli/default.nix +++ b/home-manager/cli/default.nix @@ -5,7 +5,6 @@ ./git.nix ./pass.nix ./gnupg.nix - ./neovim ./vifm ./bat.nix ./eza.nix diff --git a/home-manager/cli/neovim/default.nix b/home-manager/cli/neovim/default.nix deleted file mode 100644 index c1eecbe..0000000 --- a/home-manager/cli/neovim/default.nix +++ /dev/null @@ -1,122 +0,0 @@ -{ pkgs, config, ... }: -let - nvim-spell-fr-utf8-dictionary = builtins.fetchurl { - url = "http://ftp.vim.org/vim/runtime/spell/fr.utf-8.spl"; - sha256 = "abfb9702b98d887c175ace58f1ab39733dc08d03b674d914f56344ef86e63b61"; - }; - - nvim-spell-fr-utf8-suggestions = builtins.fetchurl { - url = "http://ftp.vim.org/vim/runtime/spell/fr.utf-8.sug"; - sha256 = "0294bc32b42c90bbb286a89e23ca3773b7ef50eff1ab523b1513d6a25c6b3f58"; - }; -in -{ - home.file."${config.xdg.configHome}/nvim/spell/fr.utf-8.spl".source = nvim-spell-fr-utf8-dictionary; - home.file."${config.xdg.configHome}/nvim/spell/fr.utf-8.sug".source = nvim-spell-fr-utf8-suggestions; - programs.neovim = { - enable = true; - defaultEditor = true; - vimAlias = true; - withNodeJs = true; - withPython3 = true; - extraPackages = with pkgs; [ - # LSP Servers - clang-tools - lua-language-server - marksman - nil - nodePackages.bash-language-server - python3Packages.python-lsp-server - rnix-lsp - shellcheck - - # Formatters - nixfmt - shfmt - ]; - extraLuaConfig = (builtins.readFile ./files/options.lua); - plugins = with pkgs.vimPlugins; [ - { - plugin = nvim-autopairs; - type = "lua"; - config = '' - local autopair = require("nvim-autopairs").setup {} - ''; - } - { - plugin = nvim-base16; - type = "lua"; - config = '' - vim.cmd.colorscheme 'base16-default-dark' - ''; - } - { - plugin = nvim-cmp; - type = "lua"; - config = (builtins.readFile ./files/cmp.lua); - } - cmp-buffer - cmp-nvim-lsp - cmp-path - cmp-cmdline - cmp_luasnip - { - plugin = gitsigns-nvim; - type = "lua"; - config = (builtins.readFile ./files/luasnip.lua); - } - { - plugin = indent-blankline-nvim; - type = "lua"; - config ='' - require("ibl").setup{ - indent = { char = "│"}, - } - ''; - } - { - plugin = nvim-lspconfig; - type = "lua"; - config = (builtins.readFile ./files/lspconfig.lua); - } - { - plugin = lualine-nvim; - type = "lua"; - config = (builtins.readFile ./files/lualine.lua); - } - luasnip - { - plugin = neo-tree-nvim; - type = "lua"; - config = (builtins.readFile ./files/neotree.lua); - } - nui-nvim - plenary-nvim - { - plugin = (nvim-treesitter.withPlugins (p: [ - p.bash - p.c - p.cpp - p.cmake - p.dockerfile - p.latex - p.lua - p.llvm - p.markdown - p.markdown_inline - p.python - p.vim - p.yaml - ]) - ); - type = "lua"; - config = ( builtins.readFile ./files/treesitter.lua); - } - { - plugin = which-key-nvim; - type = "lua"; - config = ( builtins.readFile ./files/whichkey.lua ); - } - ]; - }; -} diff --git a/hosts/luci/home-config.nix b/hosts/luci/home-config.nix index 169bcf1..9c26a36 100644 --- a/hosts/luci/home-config.nix +++ b/hosts/luci/home-config.nix @@ -1,5 +1,6 @@ { ... }: { config.modules = { + cli.neovim.enable = true; video.kdenlive.enable = false; web.firefox.enable = true; web.qutebrowser.enable = true; diff --git a/modules/home-manager/cli/neovim/default.nix b/modules/home-manager/cli/neovim/default.nix new file mode 100644 index 0000000..341cda8 --- /dev/null +++ b/modules/home-manager/cli/neovim/default.nix @@ -0,0 +1,128 @@ +{ lib, pkgs, config, ... }: +with lib; +let + cfg = config.modules.cli.neovim; + nvim-spell-fr-utf8-dictionary = builtins.fetchurl { + url = "http://ftp.vim.org/vim/runtime/spell/fr.utf-8.spl"; + sha256 = "abfb9702b98d887c175ace58f1ab39733dc08d03b674d914f56344ef86e63b61"; + }; + nvim-spell-fr-utf8-suggestions = builtins.fetchurl { + url = "http://ftp.vim.org/vim/runtime/spell/fr.utf-8.sug"; + sha256 = "0294bc32b42c90bbb286a89e23ca3773b7ef50eff1ab523b1513d6a25c6b3f58"; + }; +in +{ + options.modules.cli.neovim = { + enable = mkEnableOption "enable Neovim text editor"; + }; + config = mkIf cfg.enable { + home.file."${config.xdg.configHome}/nvim/spell/fr.utf-8.spl".source = nvim-spell-fr-utf8-dictionary; + home.file."${config.xdg.configHome}/nvim/spell/fr.utf-8.sug".source = nvim-spell-fr-utf8-suggestions; + programs.neovim = { + enable = true; + defaultEditor = true; + vimAlias = true; + withNodeJs = true; + withPython3 = true; + extraPackages = with pkgs; [ + # LSP Servers + clang-tools + lua-language-server + marksman + nil + nodePackages.bash-language-server + python3Packages.python-lsp-server + rnix-lsp + shellcheck + + # Formatters + nixfmt + shfmt + ]; + extraLuaConfig = (builtins.readFile ./files/options.lua); + plugins = with pkgs.vimPlugins; [ + { + plugin = nvim-autopairs; + type = "lua"; + config = '' + local autopair = require("nvim-autopairs").setup {} + ''; + } + { + plugin = nvim-base16; + type = "lua"; + config = '' + vim.cmd.colorscheme 'base16-default-dark' + ''; + } + { + plugin = nvim-cmp; + type = "lua"; + config = (builtins.readFile ./files/cmp.lua); + } + cmp-buffer + cmp-nvim-lsp + cmp-path + cmp-cmdline + cmp_luasnip + { + plugin = gitsigns-nvim; + type = "lua"; + config = (builtins.readFile ./files/luasnip.lua); + } + { + plugin = indent-blankline-nvim; + type = "lua"; + config ='' + require("ibl").setup{ + indent = { char = "│"}, + } + ''; + } + { + plugin = nvim-lspconfig; + type = "lua"; + config = (builtins.readFile ./files/lspconfig.lua); + } + { + plugin = lualine-nvim; + type = "lua"; + config = (builtins.readFile ./files/lualine.lua); + } + luasnip + { + plugin = neo-tree-nvim; + type = "lua"; + config = (builtins.readFile ./files/neotree.lua); + } + nui-nvim + plenary-nvim + { + plugin = (nvim-treesitter.withPlugins (p: [ + p.bash + p.c + p.cpp + p.cmake + p.dockerfile + p.latex + p.lua + p.llvm + p.markdown + p.markdown_inline + p.python + p.vim + p.yaml + ]) + ); + type = "lua"; + config = ( builtins.readFile ./files/treesitter.lua); + } + { + plugin = which-key-nvim; + type = "lua"; + config = ( builtins.readFile ./files/whichkey.lua ); + } + ]; + }; + }; +} diff --git a/home-manager/cli/neovim/files/cmp.lua b/modules/home-manager/cli/neovim/files/cmp.lua similarity index 100% rename from home-manager/cli/neovim/files/cmp.lua rename to modules/home-manager/cli/neovim/files/cmp.lua diff --git a/home-manager/cli/neovim/files/lspconfig.lua b/modules/home-manager/cli/neovim/files/lspconfig.lua similarity index 100% rename from home-manager/cli/neovim/files/lspconfig.lua rename to modules/home-manager/cli/neovim/files/lspconfig.lua diff --git a/home-manager/cli/neovim/files/lualine.lua b/modules/home-manager/cli/neovim/files/lualine.lua similarity index 100% rename from home-manager/cli/neovim/files/lualine.lua rename to modules/home-manager/cli/neovim/files/lualine.lua diff --git a/home-manager/cli/neovim/files/luasnip.lua b/modules/home-manager/cli/neovim/files/luasnip.lua similarity index 100% rename from home-manager/cli/neovim/files/luasnip.lua rename to modules/home-manager/cli/neovim/files/luasnip.lua diff --git a/home-manager/cli/neovim/files/neotree.lua b/modules/home-manager/cli/neovim/files/neotree.lua similarity index 100% rename from home-manager/cli/neovim/files/neotree.lua rename to modules/home-manager/cli/neovim/files/neotree.lua diff --git a/home-manager/cli/neovim/files/options.lua b/modules/home-manager/cli/neovim/files/options.lua similarity index 100% rename from home-manager/cli/neovim/files/options.lua rename to modules/home-manager/cli/neovim/files/options.lua diff --git a/home-manager/cli/neovim/files/treesitter.lua b/modules/home-manager/cli/neovim/files/treesitter.lua similarity index 100% rename from home-manager/cli/neovim/files/treesitter.lua rename to modules/home-manager/cli/neovim/files/treesitter.lua diff --git a/home-manager/cli/neovim/files/whichkey.lua b/modules/home-manager/cli/neovim/files/whichkey.lua similarity index 100% rename from home-manager/cli/neovim/files/whichkey.lua rename to modules/home-manager/cli/neovim/files/whichkey.lua diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 750f0cf..0256121 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -1,6 +1,7 @@ { ... }: { imports = [ + ./cli/neovim ./desktop/sway ./gaming/lutris ./video/kdenlive From 46384d49c1c6c1ad7d7f744fc2a551c352da544e Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Sat, 30 Dec 2023 13:12:33 +0100 Subject: [PATCH 4/6] Convert Vifm configuration to module --- home-manager/cli/default.nix | 1 - home-manager/cli/vifm/default.nix | 12 ----------- hosts/luci/home-config.nix | 1 + modules/home-manager/cli/vifm/default.nix | 21 +++++++++++++++++++ .../cli/vifm/files/base16-default-dark.vifm | 0 .../cli/vifm/files/devicons.vifm | 0 .../home-manager}/cli/vifm/files/vifmrc | 0 modules/home-manager/default.nix | 1 + 8 files changed, 23 insertions(+), 13 deletions(-) delete mode 100644 home-manager/cli/vifm/default.nix create mode 100644 modules/home-manager/cli/vifm/default.nix rename {home-manager => modules/home-manager}/cli/vifm/files/base16-default-dark.vifm (100%) rename {home-manager => modules/home-manager}/cli/vifm/files/devicons.vifm (100%) rename {home-manager => modules/home-manager}/cli/vifm/files/vifmrc (100%) diff --git a/home-manager/cli/default.nix b/home-manager/cli/default.nix index dc0a3b6..d6db79e 100644 --- a/home-manager/cli/default.nix +++ b/home-manager/cli/default.nix @@ -5,7 +5,6 @@ ./git.nix ./pass.nix ./gnupg.nix - ./vifm ./bat.nix ./eza.nix ./direnv.nix diff --git a/home-manager/cli/vifm/default.nix b/home-manager/cli/vifm/default.nix deleted file mode 100644 index d1c5620..0000000 --- a/home-manager/cli/vifm/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs, ...}: -{ - home.packages = with pkgs; [ - vifm - chafa # Preview images - poppler_utils # Preview PDF file - ]; - - home.file.".config/vifm/vifmrc".source = ./files/vifmrc; - home.file.".config/vifm/colors/base16-default-dark.vifm".source = ./files/base16-default-dark.vifm; - home.file.".config/vifm/devicons.vifm".source = ./files/devicons.vifm; -} diff --git a/hosts/luci/home-config.nix b/hosts/luci/home-config.nix index 9c26a36..246d67d 100644 --- a/hosts/luci/home-config.nix +++ b/hosts/luci/home-config.nix @@ -1,6 +1,7 @@ { ... }: { config.modules = { cli.neovim.enable = true; + cli.vifm.enable = true; video.kdenlive.enable = false; web.firefox.enable = true; web.qutebrowser.enable = true; diff --git a/modules/home-manager/cli/vifm/default.nix b/modules/home-manager/cli/vifm/default.nix new file mode 100644 index 0000000..bced364 --- /dev/null +++ b/modules/home-manager/cli/vifm/default.nix @@ -0,0 +1,21 @@ +{ lib, config, pkgs, ... }: +with lib; +let + cfg = config.modules.cli.vifm; +in +{ + options.modules.cli.vifm = { + enable = mkEnableOption "enable Vifm file browser"; + }; + config = mkIf cfg.enable { + home.packages = with pkgs; [ + vifm + chafa # Preview images + poppler_utils # Preview PDF file + ]; + + home.file.".config/vifm/vifmrc".source = ./files/vifmrc; + home.file.".config/vifm/colors/base16-default-dark.vifm".source = ./files/base16-default-dark.vifm; + home.file.".config/vifm/devicons.vifm".source = ./files/devicons.vifm; + }; +} diff --git a/home-manager/cli/vifm/files/base16-default-dark.vifm b/modules/home-manager/cli/vifm/files/base16-default-dark.vifm similarity index 100% rename from home-manager/cli/vifm/files/base16-default-dark.vifm rename to modules/home-manager/cli/vifm/files/base16-default-dark.vifm diff --git a/home-manager/cli/vifm/files/devicons.vifm b/modules/home-manager/cli/vifm/files/devicons.vifm similarity index 100% rename from home-manager/cli/vifm/files/devicons.vifm rename to modules/home-manager/cli/vifm/files/devicons.vifm diff --git a/home-manager/cli/vifm/files/vifmrc b/modules/home-manager/cli/vifm/files/vifmrc similarity index 100% rename from home-manager/cli/vifm/files/vifmrc rename to modules/home-manager/cli/vifm/files/vifmrc diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 0256121..97f7cb2 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -2,6 +2,7 @@ { imports = [ ./cli/neovim + ./cli/vifm ./desktop/sway ./gaming/lutris ./video/kdenlive From 20823fcb7b264a94a4a7757a89f288f0d3ec0f70 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Sat, 30 Dec 2023 13:20:08 +0100 Subject: [PATCH 5/6] Convert Zsh configuration to module --- home-manager/cli/default.nix | 1 - home-manager/cli/zsh.nix | 68 --------------------- modules/home-manager/cli/zsh/default.nix | 76 ++++++++++++++++++++++++ modules/home-manager/default.nix | 1 + 4 files changed, 77 insertions(+), 69 deletions(-) delete mode 100644 home-manager/cli/zsh.nix create mode 100644 modules/home-manager/cli/zsh/default.nix diff --git a/home-manager/cli/default.nix b/home-manager/cli/default.nix index d6db79e..60c17db 100644 --- a/home-manager/cli/default.nix +++ b/home-manager/cli/default.nix @@ -1,7 +1,6 @@ { ... }: { imports = [ - ./zsh.nix ./git.nix ./pass.nix ./gnupg.nix diff --git a/home-manager/cli/zsh.nix b/home-manager/cli/zsh.nix deleted file mode 100644 index 3f14b12..0000000 --- a/home-manager/cli/zsh.nix +++ /dev/null @@ -1,68 +0,0 @@ -{ pkgs, ... }: -{ - programs.zsh = { - enable = true; - dotDir = ".config/zsh"; - defaultKeymap = "viins"; - enableCompletion = true; - history = { - ignoreAllDups = true; - save = 10000; - share = true; - path = "$HOME/.local/share/zsh/history"; - }; - historySubstringSearch = { - enable = true; - searchDownKey = "^[OB"; - searchUpKey = "^[OA"; - }; - completionInit = '' -autoload -Uz compinit -for dump in ''${ZDOTDIR}/.zcompdump(N.mh+24); do - compinit -done -compinit -C - - ''; - plugins = [ - { - name = "pure"; - src = pkgs.fetchFromGitHub { - owner = "sindresorhus"; - repo = "pure"; - rev = "v1.21.0"; - hash = "sha256-YfasTKCABvMtncrfoWR1Su9QxzCqPED18/BTXaJHttg="; - }; - } - { - name = "base16-shell"; - src = pkgs.fetchFromGitHub { - owner = "chriskempson"; - repo = "base16-shell"; - rev = "588691ba71b47e75793ed9edfcfaa058326a6f41"; - hash = "sha256-X89FsG9QICDw3jZvOCB/KsPBVOLUeE7xN3VCtf0DD3E="; - }; - } - { - name = "fast-syntax-highlighting"; - src = pkgs.fetchFromGitHub { - owner = "zdharma-continuum"; - repo = "fast-syntax-highlighting"; - rev = "v1.55"; - hash = "sha256-DWVFBoICroKaKgByLmDEo4O+xo6eA8YO792g8t8R7kA="; - }; - } - { - name = "history-search-multi-word"; - src = pkgs.fetchFromGitHub { - owner = "zdharma-continuum"; - repo = "history-search-multi-word"; - rev = "c4dcddc1cd17e7e0909471703f3526170db0f475"; - hash = "sha256-KgKm9qzFnwXDXwmTruPgC0tjmiTY5AiGdrWW4zDWUF4="; - }; - }]; - localVariables = { - BASE16_THEME = "$HOME/.config/zsh/plugins/base16"; - }; - }; -} diff --git a/modules/home-manager/cli/zsh/default.nix b/modules/home-manager/cli/zsh/default.nix new file mode 100644 index 0000000..8fde37b --- /dev/null +++ b/modules/home-manager/cli/zsh/default.nix @@ -0,0 +1,76 @@ +{ lib, config, pkgs, ... }: +with lib; +let + cfg = config.modules.cli.zsh; +in +{ + options.modules.cli.zsh = { + enable = mkEnableOption "enable Zsh configuration"; + }; + config = mkIf cfg.enable { + programs.zsh = { + enable = true; + dotDir = ".config/zsh"; + defaultKeymap = "viins"; + enableCompletion = true; + history = { + ignoreAllDups = true; + save = 10000; + share = true; + path = "$HOME/.local/share/zsh/history"; + }; + historySubstringSearch = { + enable = true; + searchDownKey = "^[OB"; + searchUpKey = "^[OA"; + }; + completionInit = '' + autoload -Uz compinit + for dump in ''${ZDOTDIR}/.zcompdump(N.mh+24); do + compinit + done + compinit -C + ''; + plugins = [ + { + name = "pure"; + src = pkgs.fetchFromGitHub { + owner = "sindresorhus"; + repo = "pure"; + rev = "v1.21.0"; + hash = "sha256-YfasTKCABvMtncrfoWR1Su9QxzCqPED18/BTXaJHttg="; + }; + } + { + name = "base16-shell"; + src = pkgs.fetchFromGitHub { + owner = "chriskempson"; + repo = "base16-shell"; + rev = "588691ba71b47e75793ed9edfcfaa058326a6f41"; + hash = "sha256-X89FsG9QICDw3jZvOCB/KsPBVOLUeE7xN3VCtf0DD3E="; + }; + } + { + name = "fast-syntax-highlighting"; + src = pkgs.fetchFromGitHub { + owner = "zdharma-continuum"; + repo = "fast-syntax-highlighting"; + rev = "v1.55"; + hash = "sha256-DWVFBoICroKaKgByLmDEo4O+xo6eA8YO792g8t8R7kA="; + }; + } + { + name = "history-search-multi-word"; + src = pkgs.fetchFromGitHub { + owner = "zdharma-continuum"; + repo = "history-search-multi-word"; + rev = "c4dcddc1cd17e7e0909471703f3526170db0f475"; + hash = "sha256-KgKm9qzFnwXDXwmTruPgC0tjmiTY5AiGdrWW4zDWUF4="; + }; + }]; + localVariables = { + BASE16_THEME = "$HOME/.config/zsh/plugins/base16"; + }; + }; + }; +} diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 97f7cb2..0e02297 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -3,6 +3,7 @@ imports = [ ./cli/neovim ./cli/vifm + ./cli/zsh ./desktop/sway ./gaming/lutris ./video/kdenlive From 5eb724a0c4fdfc5c9ff0b54e723d37d21c15d49a Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Sat, 30 Dec 2023 13:24:08 +0100 Subject: [PATCH 6/6] Remove unseless statement --- modules/home-manager/web/firefox/default.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/home-manager/web/firefox/default.nix b/modules/home-manager/web/firefox/default.nix index 40336cd..018c873 100644 --- a/modules/home-manager/web/firefox/default.nix +++ b/modules/home-manager/web/firefox/default.nix @@ -9,10 +9,6 @@ in enable = mkEnableOption "enable Firefox web browser"; }; config = mkIf cfg.enable { - - nixpkgs.overlays = [ - inputs.nur.overlay - ]; programs.browserpass = { enable = true; browsers = ["firefox"];