mirror of
https://github.com/sstent/vmimages.git
synced 2026-01-26 07:02:03 +00:00
sync
This commit is contained in:
@@ -1,11 +1,33 @@
|
||||
{
|
||||
self,
|
||||
platforms,
|
||||
lib,
|
||||
} @ args:
|
||||
with {inherit (lib) makeExtensible attrValues foldr;};
|
||||
(makeExtensible (final:
|
||||
with final;
|
||||
(import ./map.nix args).modules ./. (file: import file args)))
|
||||
.extend
|
||||
(final: prev: foldr (x: y: x // y) {} (attrValues prev))
|
||||
# {lib}:
|
||||
# lib.makeExtensible (self:
|
||||
# let
|
||||
# callLibs = file: import file { lib = self; };
|
||||
# in
|
||||
# rec {
|
||||
# ## Define your own library functions here!
|
||||
# #id = x: x;
|
||||
# ## Or in files, containing functions that take {lib}
|
||||
# map = callLibs ./map.nix;
|
||||
# ## In configs, they can be used under "lib.our"
|
||||
# })
|
||||
|
||||
|
||||
|
||||
{ inputs, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) makeExtensible attrValues foldr;
|
||||
inherit (modules) mapModules;
|
||||
|
||||
# modules = import ./modules.nix {
|
||||
# inherit lib;
|
||||
# self.attrs = import ./attrs.nix { inherit lib; self = {}; };
|
||||
# };
|
||||
|
||||
mylib = makeExtensible (self:
|
||||
with self; mapModules ./.
|
||||
(file: import file { inherit self lib pkgs inputs; }));
|
||||
in
|
||||
mylib.extend
|
||||
(self: super:
|
||||
foldr (a: b: a // b) {} (attrValues super))
|
||||
Reference in New Issue
Block a user