feat(home): move nvf config to homes and use home-manager modules

This commit is contained in:
Mohammad Rafiq 2025-06-14 18:52:44 +08:00
parent af7226d30e
commit 1a3ff4b92a
No known key found for this signature in database
21 changed files with 40 additions and 50 deletions

View file

@ -0,0 +1,38 @@
{ lib, pkgs, ... }:
let
inherit (lib) singleton;
in
{
home.sessionVariables.EDITOR = "nvim";
persistDirs = singleton ".local/share/nvf";
programs.nvf.enable = true;
programs.nvf.settings.vim = {
startPlugins = [ pkgs.pantheon.snippets ];
hideSearchHighlight = true;
syntaxHighlighting = true;
telescope.enable = true;
searchCase = "ignore";
undoFile.enable = true;
fzf-lua.enable = true;
git.enable = true;
git.gitsigns.enable = false;
autopairs.nvim-autopairs.enable = true;
autocomplete = import ./_nvf/autocomplete.nix { inherit lib; };
binds = import ./_nvf/binds.nix;
clipboard = import ./_nvf/clipboard.nix;
diagnostics = import ./_nvf/diagnostics.nix;
keymaps = import ./_nvf/keymaps.nix;
languages = import ./_nvf/languages.nix;
lsp = import ./_nvf/lsp.nix;
navigation = import ./_nvf/navigation.nix;
notes = import ./_nvf/notes.nix;
options = import ./_nvf/options.nix;
notify = import ./_nvf/notify.nix;
snippets = import ./_nvf/snippets.nix;
statusline = import ./_nvf/statusline.nix;
treesitter = import ./_nvf/treesitter.nix;
ui = import ./_nvf/ui.nix;
utility = import ./_nvf/utility.nix;
visuals = import ./_nvf/visuals.nix;
};
}

View file

@ -6,7 +6,7 @@
...
}:
let
inherit (lib) optional;
inherit (lib) singleton optional;
inherit (inputs) import-tree;
mkEmailAccount = address: {
inherit address;
@ -26,7 +26,7 @@ let
};
in
{
imports = optional osConfig.desktop.enable (import-tree ./desktop);
imports = (optional osConfig.desktop.enable (import-tree ./desktop)) ++ singleton (import-tree ./cli);
config = {
accounts = {
@ -46,7 +46,6 @@ in
screensaver.enable = true;
screensaver.timeout = "100";
screensaver.command = "cbonsai -S -w 0.1 -L 40 -M 2 -b 2";
editor = "nvf";
file-browser = "yazi";
multiplexer = "zellij";
fetch = "hyfetch";

View file

@ -11,7 +11,6 @@
screensaver.enable = lib.mkEnableOption "";
screensaver.timeout = lib.pantheon.mkStrOption;
screensaver.command = lib.pantheon.mkStrOption;
editor = lib.pantheon.mkStrOption;
file-browser = lib.pantheon.mkStrOption;
multiplexer = lib.pantheon.mkStrOption;
fetch = lib.pantheon.mkStrOption;

View file

@ -1,46 +0,0 @@
{
config,
lib,
pkgs,
...
}:
{
config = lib.mkIf (config.cli.editor == "nvf") {
home.sessionVariables.EDITOR = "nvim";
home.persistence."/persist/home/${config.snowfallorg.user.name}".directories = [
".local/share/nvf"
];
programs.nvf = {
enable = true;
settings.vim = {
startPlugins = [ pkgs.pantheon.snippets ];
hideSearchHighlight = true;
syntaxHighlighting = true;
telescope.enable = true;
searchCase = "ignore";
undoFile.enable = true;
fzf-lua.enable = true;
git.enable = true;
git.gitsigns.enable = false;
autocomplete = import ./autocomplete.nix { inherit lib; };
autopairs.nvim-autopairs.enable = true;
binds = import ./binds.nix;
clipboard = import ./clipboard.nix;
diagnostics = import ./diagnostics.nix;
keymaps = import ./keymaps.nix;
languages = import ./languages.nix;
lsp = import ./lsp.nix;
navigation = import ./navigation.nix;
notes = import ./notes.nix;
options = import ./options.nix;
notify = import ./notify.nix;
snippets = import ./snippets.nix;
statusline = import ./statusline.nix;
treesitter = import ./treesitter.nix;
ui = import ./ui.nix;
utility = import ./utility.nix;
visuals = import ./visuals.nix;
};
};
};
}