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;
home = {
user = {
git = {
profile = {
name = "Gabe Venberg";

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -4,6 +4,7 @@
lib,
...
}: {
config = lib.mkIf (config.user.nvim.enable && config.user.nvim.enable-lsp) {
home.file = {
".clangd".text = ''
# keeps clangd from choking when it sees a compiler flag for a different
@ -28,7 +29,7 @@
BreakBeforeBinaryOperators: NonAssignment
...
'';
"work/.clang-format" = lib.mkIf config.home.git.workProfile.enable {
"work/.clang-format" = lib.mkIf config.user.git.workProfile.enable {
text = ''
---
#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,
...
}: {
options = {
home.nvim.enable-lsp = lib.mkEnableOption "nvim lsp";
};
options.user.nvim.enable-lsp = lib.mkEnableOption "nvim lsp";
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 = {
plugins.lsp = {
enable = true;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -4,19 +4,12 @@
lib,
...
}: {
options = {
home.nvim.enable-treesitter = lib.mkOption {
default = false;
type = lib.types.bool;
description = ''
enable nvim treesitter
'';
};
};
options.user.nvim.enable-treesitter = lib.mkEnableOption "enable nvim treesitter";
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 = {
plugins.treesitter = {
enable = true;

View file

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

View file

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

View file

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

View file

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

View file

@ -5,11 +5,11 @@
...
}: {
options = {
home.enable-speech = lib.mkEnableOption "espeak";
user.enable-speech = lib.mkEnableOption "espeak";
};
config =
lib.mkIf config.home.enable-speech
lib.mkIf config.user.enable-speech
{
home.shellAliases = {
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/direnv.nix
../../modules/home-manager/terminal/btop.nix
../../modules/home-manager/nvim
];
user.nvim.enable = true;
home.packages = with pkgs; [
sshfs
just

View file

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