Skip to content

Commit

Permalink
Handle nixvim as modules+profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
dwarfmaster committed Nov 27, 2022
1 parent 8664a7a commit d5803d1
Show file tree
Hide file tree
Showing 28 changed files with 552 additions and 574 deletions.
9 changes: 9 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
colors = colors.homeManagerModules.colorScheme;
impermanence = impermanence.nixosModules.home-manager.impermanence;
};
nixvim = self.nixvimModules // {profiles = {...}: {imports = profiles.nixvim;};};
};
# All attributes to add to lib in modules
extraLib = {
Expand Down Expand Up @@ -149,6 +150,7 @@
profiles = {
nixos = importProfiles ./profiles/nixos;
hm = importProfiles ./profiles/hm;
nixvim = importProfiles ./profiles/nixvim;
};

pkgImport = system: unfree: pkgs:
Expand Down Expand Up @@ -229,6 +231,13 @@
in
pathsToImportedAttrs modulesPaths;

nixvimModules = let
modulesDir = ./modules/nixvim;
fullPath = name: modulesDir + "/${name}";
modulesPaths = map fullPath (attrNames (readVisible modulesDir));
in
pathsToImportedAttrs modulesPaths;

nixosConfigurations = builtins.mapAttrs (_: config:
lib.nixosSystem {
inherit (config) modules;
Expand Down
6 changes: 5 additions & 1 deletion hosts/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@

home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.sharedModules = builtins.attrValues modules.hm;
home-manager.sharedModules = (builtins.attrValues modules.hm) ++ [{
programs.nixvim = { ... }: {
imports = builtins.attrValues modules.nixvim;
};
}];

networking.hostName = hostName;
nix.nixPath = let
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,21 @@
}: let
tab = 2;
in {
imports = [
./telescope.nix
./treesitter.nix
./windows.nix
./projects.nix
./comments.nix
./escape.nix
./notify.nix
./gitgutter.nix
./lsp.nix
./direnv.nix
./cmp.nix
];

colorScheme.nixvimIntegration = true;

programs.nixvim = {
profiles.telescope.enable = true;
profiles.treesitter.enable = true;
profiles.windows.enable = true;
profiles.projects.enable = true;
profiles.comments.enable = true;
profiles.escape.enable = true;
profiles.notify.enable = true;
profiles.gitgutter.enable = true;
profiles.lsp.enable = true;
profiles.direnv.enable = true;
profiles.cmp.enable = true;

# __ __ _
# | \/ (_)___ __
# | |\/| | (_-</ _|
Expand Down
14 changes: 2 additions & 12 deletions profiles/hm/programs/neovim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
}: {
imports = [
# Profiles
./profiles/core.nix

# HM Plugins
./plugins/nix-colors.nix
./config.nix
];

home.packages = [
Expand All @@ -18,13 +15,6 @@
pkgs.fzy
];

# The functional syntax is necessary because of https://github.com/NixOS/nixpkgs/issues/70638
programs.nixvim = {...}: {
enable = true;
imports = [
# Nixvim plugins
./plugins/which-keys.nix
];
};
programs.nixvim.enable = true;
# programs.neovim.package = pkgs.neovim-nightly;
}
100 changes: 0 additions & 100 deletions profiles/hm/programs/neovim/profiles/cmp.nix

This file was deleted.

38 changes: 0 additions & 38 deletions profiles/hm/programs/neovim/profiles/comments.nix

This file was deleted.

25 changes: 0 additions & 25 deletions profiles/hm/programs/neovim/profiles/direnv.nix

This file was deleted.

32 changes: 0 additions & 32 deletions profiles/hm/programs/neovim/profiles/escape.nix

This file was deleted.

75 changes: 0 additions & 75 deletions profiles/hm/programs/neovim/profiles/gitgutter.nix

This file was deleted.

Loading

0 comments on commit d5803d1

Please sign in to comment.