fake.modules transposition for aspect-oriented Dendritic Nix. with cross-aspect dependencies. Discussions: https://oeiuwq.zulipchat.com/join/nqp26cd4kngon6mo3ncgnuap/ dendrix.oeiuwq.com/Dendritic.html
dendritic nix aspect oriented

remove unused export

+48 -58
+48 -58
nix/types.nix
··· 28 28 29 29 providerType = lib.types.either functionToAspect (lib.types.functionTo providerType); 30 30 31 - aspectSubmodule = aspectSubmoduleWithModules [ ]; 32 - 33 - aspectSubmoduleWithModules = 34 - otherModules: 35 - lib.types.submoduleWith { 36 - shorthandOnlyDefinesConfig = true; 37 - modules = otherModules ++ [ 38 - ( 39 - { 40 - name, 41 - aspect, 42 - config, 43 - ... 44 - }: 31 + aspectSubmodule = lib.types.submodule ( 32 + { 33 + name, 34 + aspect, 35 + config, 36 + ... 37 + }: 38 + { 39 + freeformType = lib.types.attrsOf lib.types.deferredModule; 40 + config._module.args.aspect = config; 41 + options.name = lib.mkOption { 42 + description = "Aspect name"; 43 + default = name; 44 + type = lib.types.str; 45 + }; 46 + options.description = lib.mkOption { 47 + description = "Aspect description"; 48 + default = "Aspect ${name}"; 49 + type = lib.types.str; 50 + }; 51 + options.includes = lib.mkOption { 52 + description = "Providers to ask aspects from"; 53 + type = lib.types.listOf providerType; 54 + default = [ ]; 55 + }; 56 + options.provides = lib.mkOption { 57 + description = "Providers of aspect for other aspects"; 58 + default = { }; 59 + type = lib.types.submodule ( 60 + { config, ... }: 45 61 { 46 - freeformType = lib.types.attrsOf lib.types.deferredModule; 47 - config._module.args.aspect = config; 48 - options.name = lib.mkOption { 49 - description = "Aspect name"; 50 - default = name; 51 - type = lib.types.str; 52 - }; 53 - options.description = lib.mkOption { 54 - description = "Aspect description"; 55 - default = "Aspect ${name}"; 56 - type = lib.types.str; 57 - }; 58 - options.includes = lib.mkOption { 59 - description = "Providers to ask aspects from"; 60 - type = lib.types.listOf providerType; 61 - default = [ ]; 62 - }; 63 - options.provides = lib.mkOption { 64 - description = "Providers of aspect for other aspects"; 65 - default = { }; 66 - type = lib.types.submodule ( 67 - { config, ... }: 68 - { 69 - freeformType = lib.types.attrsOf providerType; 70 - config._module.args.provides = config; 71 - options.itself = lib.mkOption { 72 - readOnly = true; 73 - description = "Provides itself"; 74 - type = providerType; 75 - default = _: aspect; 76 - }; 77 - } 78 - ); 79 - }; 80 - options.__functor = lib.mkOption { 81 - internal = true; 82 - visible = false; 83 - description = "Functor to default provider"; 84 - type = lib.types.functionTo providerType; 85 - default = _: aspect.provides.itself; 62 + freeformType = lib.types.attrsOf providerType; 63 + config._module.args.provides = config; 64 + options.itself = lib.mkOption { 65 + readOnly = true; 66 + description = "Provides itself"; 67 + type = providerType; 68 + default = _: aspect; 86 69 }; 87 70 } 88 - ) 89 - ]; 90 - }; 71 + ); 72 + }; 73 + options.__functor = lib.mkOption { 74 + internal = true; 75 + visible = false; 76 + description = "Functor to default provider"; 77 + type = lib.types.functionTo providerType; 78 + default = _: aspect.provides.itself; 79 + }; 80 + } 81 + ); 91 82 92 83 in 93 84 { 94 85 inherit 95 86 aspectsType 96 87 aspectSubmodule 97 - aspectSubmoduleWithModules 98 88 providerType 99 89 ; 100 90 }