47 lines
1.3 KiB
Nix
47 lines
1.3 KiB
Nix
{
|
|
description = "";
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
nix2lua.url = "git+https://git.pleshevski.ru/mynix/nix2lua";
|
|
};
|
|
outputs =
|
|
{ self
|
|
, nixpkgs
|
|
, flake-utils
|
|
, nix2lua
|
|
, ...
|
|
} @ inputs:
|
|
let
|
|
inherit (builtins) listToAttrs readDir attrNames;
|
|
inherit (nixpkgs) lib;
|
|
|
|
mkNixeovim = { system, config, specialArgs ? { } }:
|
|
let pkgs = import nixpkgs { inherit system; }; in
|
|
import ./. { inherit config pkgs nix2lua specialArgs; };
|
|
mkNixeovimPackage = args: (mkNixeovim args).build.neovim.toplevel;
|
|
|
|
profiles = listToAttrs
|
|
(map
|
|
(fileName:
|
|
lib.nameValuePair (lib.removeSuffix ".nix" fileName) (./modules/profiles + "/${fileName}")
|
|
)
|
|
(attrNames (readDir ./modules/profiles))
|
|
);
|
|
in
|
|
{
|
|
lib = { inherit mkNixeovim mkNixeovimPackage; };
|
|
inherit profiles;
|
|
}
|
|
// flake-utils.lib.eachDefaultSystem (
|
|
system:
|
|
let nixeovimPackage = config: mkNixeovimPackage { inherit system config; }; in
|
|
{
|
|
packages = {
|
|
default = nixeovimPackage { };
|
|
base = nixeovimPackage profiles.base;
|
|
recommended-plugins = nixeovimPackage profiles.recommended-plugins;
|
|
};
|
|
}
|
|
);
|
|
}
|