os/lib/flake.nix

85 lines
2.3 KiB
Nix
Raw Normal View History

2021-04-02 02:10:24 +00:00
{
description = "DevOS environment configuriguration library.";
inputs =
{
deploy.url = "github:serokell/deploy-rs";
devshell.url = "github:numtide/devshell";
utils.url = "github:gytis-ivaskevicius/flake-utils-plus/staging";
2021-04-02 02:10:24 +00:00
};
outputs = inputs@{ self, nixpkgs, deploy, devshell, utils, ... }:
let
lib = nixpkgs.lib.makeExtensible (self:
let combinedLib = nixpkgs.lib // self; in
with self;
utils.lib // {
attrs = import ./attrs.nix { lib = combinedLib; };
lists = import ./lists.nix { lib = combinedLib; };
strings = import ./strings.nix { lib = combinedLib; };
modules = import ./modules.nix { lib = combinedLib; };
importers = import ./importers.nix { lib = combinedLib; };
generators = import ./generators.nix {
lib = combinedLib;
inherit deploy;
};
2021-04-02 02:10:24 +00:00
mkFlake = {
__functor = import ./mkFlake { lib = combinedLib; };
evalArgs = import ./mkFlake/evalArgs.nix { lib = combinedLib; };
};
2021-04-02 02:10:24 +00:00
pkgs-lib = import ./pkgs-lib {
lib = combinedLib;
inherit deploy devshell;
};
inherit (attrs) mapFilterAttrs genAttrs' safeReadDir concatAttrs;
inherit (lists) profileMap collectProfiles unifyOverlays;
inherit (strings) rgxToString;
inherit (importers) mkProfileAttrs pathsIn importHosts;
inherit (generators) mkSuites mkDeployNodes mkHomeConfigurations;
}
);
2021-04-02 02:10:24 +00:00
in
2021-04-18 22:23:27 +00:00
{
lib = with lib; utils.lib // {
inherit attrs lists modules importers generators;
inherit (lib)
mkFlake
pathsIn
importHosts
mkDeployNodes
mkHomeConfigurations;
};
}
2021-04-18 22:23:27 +00:00
//
2021-04-18 22:23:27 +00:00
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in
2021-04-02 02:10:24 +00:00
{
2021-04-18 22:23:27 +00:00
checks = {
tests = import ./tests {
inherit pkgs;
2021-04-19 02:45:08 +00:00
lib = nixpkgs.lib // lib;
2021-04-18 22:23:27 +00:00
};
2021-04-02 02:10:24 +00:00
};
packages = {
mkFlakeDoc = pkgs.writeText "mkFlakeOptions.md"
(
pkgs.nixosOptionsDoc {
inherit (lib.mkFlake.evalArgs { args = { }; }) options;
}
).optionsMDDoc;
};
2021-04-02 02:10:24 +00:00
}
);
2021-04-02 02:10:24 +00:00
}