added enable option to nvim

changed home-manager personal config namespace from home.* to user.*
This commit is contained in:
Gabe Venberg 2024-05-29 13:40:03 -05:00
parent 322788aa3a
commit 6f0e167087
30 changed files with 539 additions and 525 deletions

View file

@ -60,7 +60,7 @@ inputs.nixpkgs.lib.nixosSystem {
... ...
}: { }: {
host = osConfig.host; host = osConfig.host;
home = { user = {
git = { git = {
profile = { profile = {
name = "Gabe Venberg"; name = "Gabe Venberg";

View file

@ -14,12 +14,8 @@ inputs.home-manager.lib.homeManagerConfiguration {
... ...
}: { }: {
# machine specific options # machine specific options
home = { user = {
enable-speech = true; enable-speech = true;
nvim = {
enable-lsp = true;
enable-treesitter = true;
};
git = { git = {
profile = { profile = {
name = "Gabe Venberg"; name = "Gabe Venberg";

View file

@ -15,7 +15,7 @@ inputs.home-manager.lib.homeManagerConfiguration {
... ...
}: { }: {
# machine specific options # machine specific options
home = { user = {
nvim = { nvim = {
enable-lsp = true; enable-lsp = true;
enable-treesitter = true; enable-treesitter = true;

View file

@ -65,11 +65,7 @@ inputs.nixpkgs.lib.nixosSystem {
... ...
}: { }: {
host = osConfig.host; host = osConfig.host;
home = { user = {
nvim = {
enable-lsp = true;
enable-treesitter = true;
};
git = { git = {
profile = { profile = {
name = "Gabe Venberg"; name = "Gabe Venberg";
@ -87,11 +83,6 @@ inputs.nixpkgs.lib.nixosSystem {
# Enable the OpenSSH daemon. # Enable the OpenSSH daemon.
services.openssh.enable = true; services.openssh.enable = true;
services.nfs.server = {
enable = true;
exports = "/srv/nfs *(rw,sync,no_root_squash,no_subtree_check)";
};
# Bootloader. # Bootloader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;

View file

@ -41,7 +41,7 @@ inputs.nixpkgs.lib.nixosSystem {
... ...
}: { }: {
host = osConfig.host; host = osConfig.host;
home = { user = {
nvim = { nvim = {
enable-lsp = true; enable-lsp = true;
enable-treesitter = true; enable-treesitter = true;

View file

@ -4,15 +4,10 @@
lib, lib,
... ...
}: { }: {
options = { options.user.nvim.enable-completions = lib.mkEnableOption "basic completion in nvim";
home.nvim.enable-completions =
(lib.mkEnableOption "basic completion in nvim")
// {
default = false;
};
};
config = config =
lib.mkIf config.home.nvim.enable-completions lib.mkIf (config.user.nvim.enable-completions && config.user.nvim.enable)
{ {
programs.nixvim = { programs.nixvim = {
plugins.luasnip.enable = true; plugins.luasnip.enable = true;

View file

@ -3,8 +3,11 @@
pkgs, pkgs,
helpers, helpers,
lib, lib,
config,
... ...
}: { }: {
options.user.nvim.enable = lib.mkEnableOption "enable nvim";
config = lib.mkIf config.user.nvim.enable {
programs.nixvim = { programs.nixvim = {
enable = true; enable = true;
viAlias = true; viAlias = true;
@ -26,6 +29,7 @@
$env.EDITOR = nvim $env.EDITOR = nvim
$env.VISUAL = nvim $env.VISUAL = nvim
''; '';
};
imports = [ imports = [
./keybinds.nix ./keybinds.nix

View file

@ -1,8 +1,10 @@
{ {
configs, config,
lib,
pkgs, pkgs,
... ...
}: { }: {
config = lib.mkIf config.user.nvim.enable {
programs.nixvim = { programs.nixvim = {
plugins.gitsigns = { plugins.gitsigns = {
enable = true; enable = true;
@ -22,4 +24,5 @@
} }
]; ];
}; };
};
} }

View file

@ -1,8 +1,10 @@
{ {
configs, config,
lib,
pkgs, pkgs,
... ...
}: { }: {
config = lib.mkIf config.user.nvim.enable {
programs.nixvim = { programs.nixvim = {
globals = { globals = {
mapleader = ";"; mapleader = ";";
@ -94,4 +96,5 @@
} }
]; ];
}; };
};
} }

View file

@ -4,6 +4,7 @@
lib, lib,
... ...
}: { }: {
config = lib.mkIf (config.user.nvim.enable && config.user.nvim.enable-lsp) {
home.file = { home.file = {
".clangd".text = '' ".clangd".text = ''
# keeps clangd from choking when it sees a compiler flag for a different # keeps clangd from choking when it sees a compiler flag for a different
@ -28,7 +29,7 @@
BreakBeforeBinaryOperators: NonAssignment BreakBeforeBinaryOperators: NonAssignment
... ...
''; '';
"work/.clang-format" = lib.mkIf config.home.git.workProfile.enable { "work/.clang-format" = lib.mkIf config.user.git.workProfile.enable {
text = '' text = ''
--- ---
#this syncronizes with settings used by neovims treesitters so that the lsp formatting and treesitter formatting do not fight eatch other. #this syncronizes with settings used by neovims treesitters so that the lsp formatting and treesitter formatting do not fight eatch other.
@ -46,4 +47,5 @@
''; '';
}; };
}; };
};
} }

View file

@ -4,14 +4,12 @@
lib, lib,
... ...
}: { }: {
options = { options.user.nvim.enable-lsp = lib.mkEnableOption "nvim lsp";
home.nvim.enable-lsp = lib.mkEnableOption "nvim lsp";
};
config = config =
lib.mkIf config.home.nvim.enable-lsp lib.mkIf (config.user.nvim.enable-lsp && config.user.nvim.enable)
{ {
home.nvim.enable-completions = true; user.nvim.enable-completions = true;
programs.nixvim = { programs.nixvim = {
plugins.lsp = { plugins.lsp = {
enable = true; enable = true;

View file

@ -5,7 +5,7 @@
... ...
}: { }: {
config = config =
lib.mkIf config.home.nvim.enable-lsp lib.mkIf (config.user.nvim.enable-lsp && config.user.nvim.enable)
{ {
programs.nixvim = { programs.nixvim = {
plugins.rust-tools = { plugins.rust-tools = {

View file

@ -1,8 +1,10 @@
{ {
configs, config,
lib,
pkgs, pkgs,
... ...
}: { }: {
config = lib.mkIf config.user.nvim.enable {
programs.nixvim = { programs.nixvim = {
plugins.lualine = { plugins.lualine = {
enable = true; enable = true;
@ -74,4 +76,5 @@
}; };
}; };
}; };
};
} }

View file

@ -1,8 +1,10 @@
{ {
configs, config,
lib,
pkgs, pkgs,
... ...
}: { }: {
config = lib.mkIf config.user.nvim.enable {
programs.nixvim = { programs.nixvim = {
plugins.nvim-tree = { plugins.nvim-tree = {
enable = true; enable = true;
@ -28,4 +30,5 @@
} }
]; ];
}; };
};
} }

View file

@ -1,9 +1,10 @@
{ {
configs, config,
pkgs, pkgs,
lib, lib,
... ...
}: { }: {
config = lib.mkIf config.user.nvim.enable {
programs.nixvim = { programs.nixvim = {
opts = { opts = {
mouse = "a"; mouse = "a";
@ -67,4 +68,5 @@
showbreak = ""; showbreak = "";
}; };
}; };
};
} }

View file

@ -1,8 +1,10 @@
{ {
configs, config,
lib,
pkgs, pkgs,
... ...
}: { }: {
config = lib.mkIf config.user.nvim.enable {
programs.nixvim = { programs.nixvim = {
plugins.comment.enable = true; plugins.comment.enable = true;
plugins.marks.enable = true; plugins.marks.enable = true;
@ -18,4 +20,5 @@
]; ];
extraConfigLua = ''require("dressing").setup({})''; extraConfigLua = ''require("dressing").setup({})'';
}; };
};
} }

View file

@ -1,8 +1,10 @@
{ {
configs, config,
lib,
pkgs, pkgs,
... ...
}: { }: {
config = lib.mkIf config.user.nvim.enable {
programs.nixvim = { programs.nixvim = {
plugins.telescope = { plugins.telescope = {
enable = true; enable = true;
@ -113,4 +115,5 @@
} }
]; ];
}; };
};
} }

View file

@ -1,8 +1,10 @@
{ {
configs, config,
lib,
pkgs, pkgs,
... ...
}: { }: {
config = lib.mkIf config.user.nvim.enable {
programs.nixvim = { programs.nixvim = {
plugins.toggleterm = { plugins.toggleterm = {
enable = true; enable = true;
@ -33,4 +35,5 @@
}) })
''; '';
}; };
};
} }

View file

@ -5,7 +5,7 @@
... ...
}: { }: {
config = config =
lib.mkIf config.home.nvim.enable-treesitter lib.mkIf (config.user.nvim.enable-treesitter && config.user.nvim.enable)
{ {
programs.nixvim = { programs.nixvim = {
keymaps = [ keymaps = [

View file

@ -4,19 +4,12 @@
lib, lib,
... ...
}: { }: {
options = { options.user.nvim.enable-treesitter = lib.mkEnableOption "enable nvim treesitter";
home.nvim.enable-treesitter = lib.mkOption {
default = false;
type = lib.types.bool;
description = ''
enable nvim treesitter
'';
};
};
config = config =
lib.mkIf config.home.nvim.enable-treesitter lib.mkIf (config.user.nvim.enable-treesitter && config.user.nvim.enable)
{ {
home.nvim.enable-completions = true; user.nvim.enable-completions = true;
programs.nixvim = { programs.nixvim = {
plugins.treesitter = { plugins.treesitter = {
enable = true; enable = true;

View file

@ -5,7 +5,7 @@
... ...
}: { }: {
config = config =
lib.mkIf config.home.nvim.enable-treesitter lib.mkIf (config.user.nvim.enable-treesitter && config.user.nvim.enable)
{ {
programs.nixvim = { programs.nixvim = {
plugins.rainbow-delimiters = { plugins.rainbow-delimiters = {

View file

@ -5,7 +5,7 @@
... ...
}: { }: {
config = config =
lib.mkIf config.home.nvim.enable-treesitter lib.mkIf (config.user.nvim.enable-treesitter && config.user.nvim.enable)
{ {
programs.nixvim = let programs.nixvim = let
nu-grammar = pkgs.tree-sitter.buildGrammar { nu-grammar = pkgs.tree-sitter.buildGrammar {

View file

@ -1,8 +1,10 @@
{ {
configs, config,
lib,
pkgs, pkgs,
... ...
}: { }: {
config = lib.mkIf config.user.nvim.enable {
programs.nixvim = { programs.nixvim = {
opts = { opts = {
timeout = true; timeout = true;
@ -12,4 +14,5 @@
enable = true; enable = true;
}; };
}; };
};
} }

View file

@ -5,7 +5,7 @@
... ...
}: { }: {
options = { options = {
home.git = { user.git = {
workProfile = { workProfile = {
enable = lib.mkEnableOption "git work profile"; enable = lib.mkEnableOption "git work profile";
email = lib.mkOption { email = lib.mkOption {
@ -45,8 +45,8 @@
}; };
# difftastic.enable=true; # difftastic.enable=true;
# difftastic.background="dark"; # difftastic.background="dark";
userEmail = config.home.git.profile.email; userEmail = config.user.git.profile.email;
userName = config.home.git.profile.name; userName = config.user.git.profile.name;
extraConfig = { extraConfig = {
init = { init = {
defaultBranch = "main"; defaultBranch = "main";
@ -75,11 +75,11 @@
}; };
}; };
includes = includes =
if config.home.git.workProfile.enable if config.user.git.workProfile.enable
then [ then [
{ {
condition = "gitdir:~/work/**"; condition = "gitdir:~/work/**";
contents.user.email = config.home.git.workProfile.email; contents.user.email = config.user.git.workProfile.email;
} }
] ]
else []; else [];

View file

@ -46,7 +46,7 @@
hostname = { hostname = {
ssh_only = false; ssh_only = false;
ssh_symbol = "🌐"; ssh_symbol = "🌐";
format = "[$hostname$ssh_symbol]($style)"; format = "[$hostname $ssh_symbol]($style)";
style = "bg:color_orange"; style = "bg:color_orange";
}; };
shell = { shell = {

View file

@ -5,11 +5,11 @@
... ...
}: { }: {
options = { options = {
home.enable-speech = lib.mkEnableOption "espeak"; user.enable-speech = lib.mkEnableOption "espeak";
}; };
config = config =
lib.mkIf config.home.enable-speech lib.mkIf config.user.enable-speech
{ {
home.shellAliases = { home.shellAliases = {
say = "espeak -p 10 -s 150 -a 200"; say = "espeak -p 10 -s 150 -a 200";

View file

@ -11,7 +11,11 @@
../../modules/home-manager/terminal/ssh-agent.nix ../../modules/home-manager/terminal/ssh-agent.nix
../../modules/home-manager/terminal/direnv.nix ../../modules/home-manager/terminal/direnv.nix
../../modules/home-manager/terminal/btop.nix ../../modules/home-manager/terminal/btop.nix
../../modules/home-manager/nvim
]; ];
user.nvim.enable = true;
home.packages = with pkgs; [ home.packages = with pkgs; [
sshfs sshfs
just just

View file

@ -9,8 +9,13 @@
../../modules/home-manager/terminal/nushell ../../modules/home-manager/terminal/nushell
../../modules/home-manager/terminal/starship.nix ../../modules/home-manager/terminal/starship.nix
../../modules/home-manager/terminal/tiny-irc.nix ../../modules/home-manager/terminal/tiny-irc.nix
../../modules/home-manager/nvim
]; ];
user.nvim = {
enable-lsp = true;
enable-treesitter = true;
};
home.packages = with pkgs; [ home.packages = with pkgs; [
tre-command tre-command
diskonaut diskonaut

View file

@ -6,12 +6,12 @@
}: { }: {
programs.steam = { programs.steam = {
enable = true; enable = true;
extraCompatPackages = with pkgs;[ extraCompatPackages = with pkgs; [
proton-ge-bin proton-ge-bin
]; ];
gamescopeSession.enable=true; gamescopeSession.enable = true;
}; };
programs.gamemode.enable=true; programs.gamemode.enable = true;
hardware.steam-hardware.enable = true; hardware.steam-hardware.enable = true;
} }

View file

@ -3,9 +3,9 @@
outputs, outputs,
... ...
}: { }: {
default={ default = {
path=./default; path = ./default;
description="a basic blank devshell flake"; description = "a basic blank devshell flake";
}; };
hugo = { hugo = {
path = ./hugo; path = ./hugo;