1
1
mirror of https://github.com/divnix/digga.git synced 2024-12-23 08:02:21 +03:00
digga/flake.nix

90 lines
2.5 KiB
Nix
Raw Normal View History

{
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-05-14 03:12:30 +03:00
nixlib.url = "github:divnix/nixpkgs.lib";
# Only used for development
nixpkgs.url = "github:nixos/nixpkgs";
};
2021-05-14 03:12:30 +03:00
outputs = inputs@{ self, nixlib, nixpkgs, deploy, devshell, utils, ... }:
let
2021-05-14 03:12:30 +03:00
lib = nixlib.lib.makeExtensible (self:
let combinedLib = nixlib.lib // self; in
with self;
utils.lib // {
attrs = import ./src/attrs.nix { lib = combinedLib; };
lists = import ./src/lists.nix { lib = combinedLib; };
strings = import ./src/strings.nix { lib = combinedLib; };
modules = import ./src/modules.nix { lib = combinedLib; };
importers = import ./src/importers.nix { lib = combinedLib; };
generators = import ./src/generators.nix {
lib = combinedLib;
inherit deploy;
};
mkFlake = {
__functor = import ./src/mkFlake { lib = combinedLib; };
evalArgs = import ./src/mkFlake/evalArgs.nix { lib = combinedLib; };
};
pkgs-lib = import ./src/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;
}
);
in
{
lib = with lib; utils.lib // {
inherit attrs lists modules importers generators;
inherit (lib)
mkFlake
mkDeployNodes
mkHomeConfigurations;
};
}
//
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in
{
checks = import ./tests {
pkgs = pkgs // {
input = nixpkgs;
};
lib = nixlib.lib // lib;
};
devShell = lib.pkgs-lib.shell { inherit pkgs; };
packages = {
mkFlakeDoc = pkgs.writeText "mkFlakeOptions.md"
(
pkgs.nixosOptionsDoc {
inherit (lib.mkFlake.evalArgs { args = { }; }) options;
}
).optionsMDDoc;
};
}
);
}