users/foo-dogsquared/programs/nixvim: init

We've also set a conditional for Neovim module.
This commit is contained in:
Gabriel Arazas 2024-02-02 11:09:35 +08:00
parent 53783fc910
commit 2f389641cd
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
6 changed files with 95 additions and 24 deletions

View File

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }:
{ config, lib, options, pkgs, ... }:
{
imports = [ ./modules ];
@ -13,6 +13,7 @@
browsers.firefox.enable = true;
browsers.misc.enable = true;
doom-emacs.enable = true;
nixvim.enable = options?programs.nixvim.enable;
email.enable = true;
email.thunderbird.enable = true;
research.enable = true;

View File

@ -9,6 +9,7 @@
./programs/email.nix
./programs/git.nix
./programs/keys.nix
./programs/nixvim
./programs/research.nix
./programs/shell.nix
./programs/terminal-multiplexer.nix

View File

@ -11,27 +11,31 @@ in
options.users.foo-dogsquared.dotfiles.enable =
lib.mkEnableOption "custom outside dotfiles for other programs";
config = lib.mkIf cfg.enable {
home.mutableFile."library/dotfiles" = {
url = "https://github.com/foo-dogsquared/dotfiles.git";
type = "git";
};
config = lib.mkIf cfg.enable (lib.mkMerge [
{
home.mutableFile."library/dotfiles" = {
url = "https://github.com/foo-dogsquared/dotfiles.git";
type = "git";
};
home.sessionPath = [
"${config.home.mutableFile."library/dotfiles".path}/bin"
];
home.sessionPath = [
"${config.home.mutableFile."library/dotfiles".path}/bin"
];
xdg.configFile = {
doom.source =
lib.mkIf userCfg.programs.doom-emacs.enable (getDotfiles "emacs");
kitty.source =
lib.mkIf userCfg.setups.development.enable (getDotfiles "kitty");
nvim.source =
lib.mkIf userCfg.setups.development.enable (getDotfiles "nvim");
nyxt.source =
lib.mkIf userCfg.programs.browsers.misc.enable (getDotfiles "nyxt");
wezterm.source =
lib.mkIf userCfg.setups.development.enable (getDotfiles "wezterm");
};
};
xdg.configFile = {
doom.source =
lib.mkIf userCfg.programs.doom-emacs.enable (getDotfiles "emacs");
kitty.source =
lib.mkIf userCfg.setups.development.enable (getDotfiles "kitty");
nyxt.source =
lib.mkIf userCfg.programs.browsers.misc.enable (getDotfiles "nyxt");
wezterm.source =
lib.mkIf userCfg.setups.development.enable (getDotfiles "wezterm");
};
}
(lib.mkIf (!config.programs.nixvim.enable) {
xdg.configFile.nvim.source = getDotfiles "nvim";
})
]);
}

View File

@ -0,0 +1,19 @@
{ config, lib, pkgs, ... }:
let
userCfg = config.users.foo-dogsquared;
cfg = userCfg.programs.nixvim;
in
{
options.users.foo-dogsquared.programs.nixvim.enable =
lib.mkEnableOption "NixVim setup";
config = lib.mkIf cfg.enable {
programs.nixvim = {
enable = true;
imports = [
./note-taking.nix
];
};
};
}

View File

@ -0,0 +1,46 @@
{ config, lib, pkgs, ... }:
{
# The main star of the show.
plugins.neorg.enable = true;
# Set it up, set it up, set it up.
plugins.neorg.extraOptions = {
lazy_loading = true;
load = {
# Pretty much required with tree-sitter integration and all.
"core.defaults" = { __empty = null; };
# Conceal your blade (which is the markup, in which it is pretty sharp to
# look at).
"core.concealer" = { __empty = null; };
# Dear diary...
"core.journal" = {
strategy = "flat";
toc_format = [ "yy" "mm" "dd" "link" "title" ];
};
# Norg ripping a page from org-mode.
"core.ui.calendar" = { __empty = null; };
# Manage your note workspaces.
"core.dirman" = {
config.workspaces = {
personal = "~/library/notes";
};
};
};
};
# Install the tree-sitter parsers required for the core.defaults Neorg
# module.
plugins.treesitter.grammarPackages =
lib.mkIf
(config.plugins.neorg.extraOptions ? load."core.defaults")
(with pkgs.tree-sitter-grammars; [
tree-sitter-norg
tree-sitter-norg-meta
]);
}

View File

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }:
{ config, lib, pkgs, options, ... }:
let
userCfg = config.users.foo-dogsquared;
@ -26,7 +26,7 @@ in
servers.enable = true;
};
programs.neovim = {
programs.neovim = lib.mkIf (!config.programs.nixvim.enable) {
enable = true;
package = pkgs.neovim-nightly;
vimAlias = true;