flake.nix: split overlays

This commit is contained in:
Mihai Fufezan 2023-02-10 19:45:23 +02:00
parent 2f84ce13c4
commit a946045a7c
No known key found for this signature in database
GPG key ID: 5899325F2F120900
2 changed files with 26 additions and 24 deletions

View file

@ -4,22 +4,7 @@
nixpkgs,
flake-parts,
...
} @ inputs: let
inherit (import ./extra.nix inputs) neovimConfiguration mainConfig;
tidalConfig = {
config.vim.tidal.enable = true;
};
buildPkg = pkgs: modules:
(neovimConfiguration {
inherit pkgs modules;
})
.neovim;
nixConfig = mainConfig false;
maximalConfig = mainConfig true;
in
} @ inputs:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
@ -28,13 +13,14 @@
{_module.args = {inherit (nixpkgs) lib;};}
./flake/apps.nix
./flake/legacyPackages.nix
./flake/overlays.nix
./flake/packages.nix
];
flake = {
lib = {
inherit (import ./lib/stdlib-extended.nix nixpkgs.lib) nvim;
inherit neovimConfiguration;
inherit (import ./extra.nix inputs) neovimConfiguration;
};
nixosModules.default = {
@ -44,13 +30,6 @@
inputs.self.overlays.default
];
};
overlays.default = final: prev: {
inherit neovimConfiguration;
neovim-nix = buildPkg prev [nixConfig];
neovim-maximal = buildPkg prev [maximalConfig];
neovim-tidal = buildPkg prev [tidalConfig];
};
};
perSystem = {

23
flake/overlays.nix Normal file
View file

@ -0,0 +1,23 @@
{inputs, ...}: let
inherit (import ../extra.nix inputs) neovimConfiguration mainConfig;
tidalConfig = {
config.vim.tidal.enable = true;
};
buildPkg = pkgs: modules:
(neovimConfiguration {
inherit pkgs modules;
})
.neovim;
nixConfig = mainConfig false;
maximalConfig = mainConfig true;
in {
flake.overlays.default = final: prev: {
inherit neovimConfiguration;
neovim-nix = buildPkg prev [nixConfig];
neovim-maximal = buildPkg prev [maximalConfig];
neovim-tidal = buildPkg prev [tidalConfig];
};
}