mirror of
https://github.com/foo-dogsquared/nix-module-wrapper-manager-fds.git
synced 2025-01-30 22:57:58 +00:00
Gabriel Arazas
fbb5955587
This makes it possible to have replacement modules in case the user wanted to replace some things.
35 lines
865 B
Nix
35 lines
865 B
Nix
rec {
|
|
/*
|
|
Given the attrset for evaluating a wrapper-manager module, return a
|
|
derivation containing the wrapper.
|
|
*/
|
|
build = args: (eval args).config.build.toplevel;
|
|
|
|
# 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.
|
|
(
|
|
{ lib, ... }:
|
|
{
|
|
config._module.args.pkgs = lib.mkDefault pkgs;
|
|
}
|
|
)
|
|
] ++ modules;
|
|
};
|
|
}
|