simplify nixvim

This commit is contained in:
Patrick Neff 2024-07-10 06:53:49 +02:00
parent 11d2fae459
commit d5bbb09e78
14 changed files with 66 additions and 104 deletions

View File

@ -24,6 +24,13 @@
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINs89u4Kvwlmq67eV+H/n+x9M8gsKDxQU+dCPSEb2vJe odie"
];
domain = "odie.home.arpa";
notes = rec {
root = "${homeDirectory}/Notes/";
workspaces = {
general = "${root}/general";
games = "${root}/games";
};
};
};
overlays = [
inputs.nixvim.overlays.default
@ -107,14 +114,14 @@
vars
// {
hostName = "odie-dev";
domain = "niederkasse.neff-steindesign.de";
domain = "niederkassel.neff-steindesign.de";
};
system = "x86_64-linux";
};
}
// flake-utils.lib.eachDefaultSystem (system: {
packages = {
neovim-ide = import ./pkgs/nixvim {inherit inputs system flakeLib nixpkgs;};
neovim-ide = import ./pkgs/nixvim {inherit inputs system flakeLib nixpkgs vars;};
};
});

View File

@ -1,10 +1,5 @@
{
mkPkgs = import ./mkPkgs.nix;
mkNixVim = import ./mkNixVim.nix;
mkNixVimLib = import ./mkNixVimLib.nix;
mkNixVimModule = import ./mkNixVimModule.nix;
mkNixosConfiguration = import ./mkNixosConfiguration.nix;
mkHomeConfiguration = import ./mkHomeConfiguration.nix;
mkHomeManagerDefaults = import ./mkHomeManagerDefaults.nix;
mkNixosHomeConfiguration = import ./mkNixosHomeConfiguration.nix;
}

View File

@ -1,6 +1,7 @@
moduleInputs @ {
{
nixpkgs,
inputs,
outputs,
flakeLib,
system,
vars,
@ -11,14 +12,18 @@ moduleInputs @ {
profile = "${username}@${hostName}";
in {
${profile} = let
config = flakeLib.mkHomeManagerDefaults moduleInputs;
pkgs = flakeLib.mkPkgs {
inherit nixpkgs system overlays;
};
in
inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
inherit (config) extraSpecialArgs;
extraSpecialArgs = {
inherit inputs outputs vars flakeLib;
inherit (inputs) nix-colors;
};
useGlobalPkgs = true;
useUserPackages = true;
modules = [
../profiles/home-manager/${profile}/home.nix

View File

@ -1,14 +0,0 @@
{
inputs,
outputs,
vars,
flakeLib,
...
}: {
extraSpecialArgs = {
inherit inputs outputs vars flakeLib;
inherit (inputs) nix-colors;
};
useGlobalPkgs = true;
useUserPackages = true;
}

View File

@ -1,10 +0,0 @@
{
pkgs,
module,
inputs,
...
}: let
nixvim' = inputs.nixvim.legacyPackages.${pkgs.system};
nvim = nixvim'.makeNixvimWithModule module;
in
nvim

View File

@ -1,11 +0,0 @@
let
mkNixVimLib = {
inputs,
system,
...
}: let
nixvimLib = inputs.nixvim.lib.${system};
in
nixvimLib;
in
mkNixVimLib

View File

@ -1,8 +0,0 @@
{
pkgs,
module,
extraSpecialArgs ? {},
...
}: {
inherit pkgs module extraSpecialArgs;
}

View File

@ -1,10 +0,0 @@
{vars, ...}: let
inherit (vars) username hostName;
profile = "${username}@${hostName}";
in {
${username} = {
imports = [
../profiles/home-manager/${profile}/home.nix
];
};
}

View File

@ -1,10 +1,28 @@
moduleInputs @ {flakeLib, inputs, ...}: let
config = flakeLib.mkHomeManagerDefaults moduleInputs;
{
flakeLib,
inputs,
outputs,
vars,
...
}: let
inherit (vars) username hostName;
profile = "${username}@${hostName}";
in {
imports = [
inputs.home-manager.nixosModules.home-manager
];
home-manager = {
inherit (config) extraSpecialArgs useGlobalPkgs useUserPackages;
extraSpecialArgs = {
inherit inputs outputs vars flakeLib;
inherit (inputs) nix-colors;
};
useGlobalPkgs = true;
useUserPackages = true;
users.${username} = {
imports = [
../../../profiles/home-manager/${profile}/home.nix
];
};
};
}

View File

@ -69,11 +69,11 @@
'';
completion.completeopt = "menu,preview";
sources = [
{name = "luasnip";}
{name = "nvim_lsp";}
{name = "nvim_lsp_signature_help";}
{name = "nvim_lsp_document_symbol";}
{name = "codeium";}
{name = "luasnip";}
{name = "path";}
{name = "buffer";}
{name = "treesitter";}

View File

@ -1,4 +1,4 @@
_: {
{vars, ...}: {
plugins.neorg = {
enable = true;
modules = {
@ -12,10 +12,8 @@ _: {
};
"core.dirman" = {
config = {
workspaces = {
notes = "~/Sync/norg/notes";
};
default_workspace = "notes";
inherit (vars.notes) workspaces;
default_workspace = "general";
};
};
"core.completion" = {
@ -40,11 +38,15 @@ _: {
"core.esupports.metagen" = {
config = {
type = "auto";
author = vars.name;
};
};
"core.integrations.telescope" = {
__empty = null;
};
"core.ui.calendar" = {
__empty = null;
};
};
};
keymaps = [
@ -52,5 +54,17 @@ _: {
key = "<leader>ni";
action = ":Neorg index<CR>";
}
{
key = "<leader>nt";
action = ":Neorg toc<CR>";
}
{
key = "<leader>nw";
action = ":Telescope neorg switch-workspace<CR>";
}
{
key = "<leader>nc";
action = ":Neorg toggle-concealer<CR>";
}
];
}

View File

@ -3,28 +3,14 @@
keymaps = [
{
key = "<leader>xx";
action = "<cmd>TroubleToggle<CR>";
options = {
silent = true;
};
}
{
key = "<leader>xd";
action = "<cmd>TroubleToggle document_diagnostics<CR>";
options = {
silent = true;
};
}
{
key = "<leader>xw";
action = "<cmd>TroubleToggle workspace_diagnostics<CR>";
action = "<cmd>Trouble diagnostics toggle<CR>";
options = {
silent = true;
};
}
{
key = "<leader>xq";
action = "<cmd>TroubleToggle quickfix<CR>";
action = "<cmd>TroubleToggle quickfix toggle<CR>";
options = {
silent = true;
};

View File

@ -3,8 +3,10 @@
system,
inputs,
flakeLib,
vars,
...
}: let
nixvim' = inputs.nixvim.legacyPackages.${system};
pkgs = flakeLib.mkPkgs {
inherit system nixpkgs;
overlays = [
@ -12,15 +14,12 @@
inputs.neorg-overlay.overlays.default
];
};
module = flakeLib.mkNixVimModule {
module = {
inherit pkgs;
extraSpecialArgs = {
inherit inputs;
};
inherit inputs vars;
};
module = import ../../modules/nixvim;
};
nvim = flakeLib.mkNixVim {
inherit pkgs inputs module;
};
in
nvim
nixvim'.makeNixvimWithModule module

View File

@ -1,12 +1,9 @@
{
inputs,
outputs,
vars,
flakeLib,
...
}: {
imports = [
#inputs.home-manager.nixosModules.home-manager
outputs.nixosModules.home-manager
outputs.nixosModules.base
outputs.nixosModules.wsl
@ -19,11 +16,5 @@
inherit (vars) hostName domain;
};
home-manager.extraSpecialArgs = {
inherit inputs outputs vars;
};
home-manager.users = flakeLib.mkNixosHomeConfiguration {inherit vars;};
system.stateVersion = "23.11";
}