nixos-config/subprojects/wrapper-manager-fds/lib/env.nix

35 lines
865 B
Nix
Raw Normal View History

rec {
2024-07-31 13:51:40 +00:00
/*
Given the attrset for evaluating a wrapper-manager module, return a
derivation containing the wrapper.
*/
2024-07-31 13:51:40 +00:00
build = args: (eval args).config.build.toplevel;
2024-07-31 13:51:40 +00:00
# Evaluate a wrapper-manager configuration.
eval =
{
pkgs,
lib ? pkgs.lib,
modules ? [ ],
specialArgs ? { },
}:
lib.evalModules {
specialArgs = specialArgs // {
modulesPath = builtins.toString ../modules/wrapper-manager;
};
modules = [
../modules/wrapper-manager
# Setting pkgs modularly. This would make setting up wrapper-manager
# with different nixpkgs instances possible but it isn't something that
# is explicitly supported.
2024-07-31 13:51:40 +00:00
(
{ lib, ... }:
{
config._module.args.pkgs = lib.mkDefault pkgs;
}
)
] ++ modules;
};
}