2024-05-05 17:56:14 +03:00
|
|
|
{
|
|
|
|
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
|
2024-05-06 12:30:41 +03:00
|
|
|
inherit (builtins) listToAttrs readDir attrNames;
|
|
|
|
inherit (nixpkgs) lib;
|
|
|
|
|
2024-05-06 16:47:45 +03:00
|
|
|
mkNixeovim = { system, config, specialArgs ? { } }:
|
2024-05-05 17:56:14 +03:00
|
|
|
let pkgs = import nixpkgs { inherit system; }; in
|
2024-05-06 16:47:45 +03:00
|
|
|
import ./. { inherit config pkgs nix2lua specialArgs; };
|
2024-05-05 18:11:16 +03:00
|
|
|
mkNixeovimPackage = args: (mkNixeovim args).build.neovim.toplevel;
|
2024-05-06 12:30:41 +03:00
|
|
|
|
|
|
|
profiles = listToAttrs
|
|
|
|
(map
|
|
|
|
(fileName:
|
|
|
|
lib.nameValuePair (lib.removeSuffix ".nix" fileName) (./modules/profiles + "/${fileName}")
|
|
|
|
)
|
|
|
|
(attrNames (readDir ./modules/profiles))
|
|
|
|
);
|
2024-05-05 17:56:14 +03:00
|
|
|
in
|
|
|
|
{
|
|
|
|
lib = { inherit mkNixeovim mkNixeovimPackage; };
|
2024-05-06 12:30:41 +03:00
|
|
|
inherit profiles;
|
2024-05-05 17:56:14 +03:00
|
|
|
}
|
|
|
|
// flake-utils.lib.eachDefaultSystem (
|
|
|
|
system:
|
|
|
|
let nixeovimPackage = config: mkNixeovimPackage { inherit system config; }; in
|
|
|
|
{
|
|
|
|
packages = {
|
|
|
|
default = nixeovimPackage { };
|
2024-05-08 01:11:48 +03:00
|
|
|
} // builtins.mapAttrs (k: nixeovimPackage) profiles;
|
2024-05-05 17:56:14 +03:00
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|