mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
feat(lib): add __functor and systemDependent lib
This commit is contained in:
parent
22734d06da
commit
8d82feb56f
1 changed files with 21 additions and 1 deletions
|
|
@ -1,6 +1,25 @@
|
|||
{ self, ... }@inputs:
|
||||
myLib: lib:
|
||||
let
|
||||
systemDependent = {
|
||||
appendSystem = system: x: "${x}-${system}";
|
||||
};
|
||||
in
|
||||
{
|
||||
|
||||
inherit systemDependent;
|
||||
|
||||
__functor =
|
||||
self: system:
|
||||
let
|
||||
systemDependent = builtins.mapAttrs (_: v: v system) self.sysDependantFuncs;
|
||||
in
|
||||
self
|
||||
// {
|
||||
inherit systemDependent;
|
||||
}
|
||||
// systemDependent;
|
||||
|
||||
myLib: lib: {
|
||||
overlay = import ./overlay.nix inputs;
|
||||
|
||||
wrench = lib.flip lib.pipe;
|
||||
|
|
@ -135,3 +154,4 @@ myLib: lib: {
|
|||
};
|
||||
|
||||
}
|
||||
// systemDependent
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue