Modular, context-aware and aspect-oriented dendritic Nix configurations. Discussions: https://oeiuwq.zulipchat.com/join/nqp26cd4kngon6mo3ncgnuap/ den.oeiuwq.com
configurations den dendritic nix aspect oriented
8
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(core): Add defaultText to some types having default values (#361)

Fixes #252

authored by

Victor Borja and committed by
GitHub
6f2da364 892a94fa

+51 -3
+8
modules/aspects.nix
··· 1 1 { den, lib, ... }: 2 2 { 3 3 options.den.ful = lib.mkOption { 4 + defaultText = lib.literalExpression "{ }"; 4 5 default = { }; 6 + description = "Den namespaces. Internal aspect trees."; 7 + internal = true; 8 + visible = false; 5 9 type = lib.types.attrsOf den.lib.nsTypes.namespaceType; 6 10 }; 7 11 options.flake.denful = lib.mkOption { 12 + defaultText = lib.literalExpression "{ }"; 8 13 default = { }; 9 14 type = lib.types.attrsOf lib.types.raw; 15 + description = "Flake exposed denful namespaces. Import using den.namespace."; 16 + internal = true; 17 + visible = false; 10 18 }; 11 19 }
+1
modules/aspects/provides.nix
··· 6 6 (lib.mkAliasOptionModule [ "_" ] [ "provides" ]) 7 7 ]; 8 8 options.provides = lib.mkOption { 9 + defaultText = lib.literalExpression "{ }"; 9 10 default = { }; 10 11 description = "Batteries Included - re-usable high-level aspects"; 11 12 type = lib.types.submodule {
+1
modules/aspects/provides/unfree/unfree-predicate-builder.nix
··· 24 24 { 25 25 options.unfree.packages = lib.mkOption { 26 26 type = lib.types.listOf lib.types.str; 27 + defaultText = lib.literalExpression "[ ]"; 27 28 default = [ ]; 28 29 }; 29 30 config.nixpkgs = lib.mkIf (hasUnfree && !globalPkgs) {
+1
modules/aspects/provides/wsl.nix
··· 52 52 module = lib.mkOption { 53 53 description = "The NixOS-WSL module"; 54 54 type = lib.types.deferredModule; 55 + defaultText = lib.literalExpression "inputs.nixos-wsl.nixosModules.default"; 55 56 default = inputs.nixos-wsl.nixosModules.default; 56 57 }; 57 58 };
+1
modules/options.nix
··· 16 16 }; 17 17 schemaOption = lib.mkOption { 18 18 description = "freeform deferred modules per entity kind"; 19 + defaultText = lib.literalExpression "{ }"; 19 20 default = { }; 20 21 type = lib.types.submodule { 21 22 freeformType = lib.types.lazyAttrsOf lib.types.deferredModule;
+3
nix/flakeOutputs.nix
··· 69 69 lib: 70 70 lib.mkOption { 71 71 default = { }; 72 + defaultText = lib.literalExpression "{ }"; 72 73 type = lib.types.lazyAttrsOf (manySubmodule lib); 73 74 }; 74 75 ··· 76 77 lib: 77 78 lib.mkOption { 78 79 default = { }; 80 + defaultText = lib.literalExpression "{ }"; 79 81 type = (manySubmodule lib); 80 82 }; 81 83 ··· 83 85 lib: 84 86 lib.mkOption { 85 87 default = { }; 88 + defaultText = lib.literalExpression "{ }"; 86 89 type = (manySubmodule lib); 87 90 }; 88 91
+5
nix/lib/aspects/types.nix
··· 58 58 options = { 59 59 name = lib.mkOption { 60 60 description = "Aspect name"; 61 + defaultText = lib.literalExpression "name"; 61 62 default = name; 62 63 type = lib.types.str; 63 64 }; 64 65 65 66 description = lib.mkOption { 66 67 description = "Aspect description"; 68 + defaultText = lib.literalExpression "name"; 67 69 default = "Aspect ${name}"; 68 70 type = lib.types.str; 69 71 }; ··· 71 73 includes = lib.mkOption { 72 74 description = "Providers to ask aspects from"; 73 75 type = lib.types.listOf (providerType cnf); 76 + defaultText = lib.literalExpression "[ ]"; 74 77 default = [ ]; 75 78 }; 76 79 77 80 provides = lib.mkOption { 78 81 description = "Providers of aspect for other aspects"; 82 + defaultText = lib.literalExpression "{ }"; 79 83 default = { }; 80 84 type = lib.types.submodule ( 81 85 { config, ... }: ··· 91 95 visible = false; 92 96 description = "Functor to default provider"; 93 97 type = lastFunctionTo (providerType cnf); 98 + defaultText = lib.literalExpression "lib.const"; 94 99 default = cnf.defaultFunctor or lib.const; 95 100 }; 96 101 };
+1
nix/lib/ctx-types.nix
··· 27 27 options.into = lib.mkOption { 28 28 description = "Context transformations to other context types"; 29 29 type = intoType; 30 + defaultText = lib.literalExpression "_: { }"; 30 31 default = _: { }; 31 32 apply = normalizeInto; 32 33 };
+1
nix/lib/forward.nix
··· 90 90 __functionArgs = guardArgs // intoPathArgs // adaptArgv; 91 91 __functor = _: args: { 92 92 options.den.fwd.${adapterKey} = lib.mkOption { 93 + defaultText = lib.literalExpression "{ }"; 93 94 default = { }; 94 95 type = lib.types.submoduleWith { 95 96 specialArgs = adaptArgsFn args;
+2
nix/lib/home-env.nix
··· 38 38 options.${optionPath} = { 39 39 enable = lib.mkOption { 40 40 type = lib.types.bool; 41 + defaultText = lib.literalExpression "host-has-user-with-class host className"; 41 42 default = host-has-user-with-class host className; 42 43 }; 43 44 module = lib.mkOption { 44 45 type = lib.types.deferredModule; 46 + defaultText = lib.literalExpression "getModule { inherit host inputs; }"; 45 47 default = getModule { inherit host inputs; }; 46 48 }; 47 49 };
+2
nix/lib/namespace-types.nix
··· 12 12 { 13 13 options.ctx = lib.mkOption { 14 14 description = "namespace context pipeline"; 15 + defaultText = lib.literalExpression "{ }"; 15 16 default = { }; 16 17 type = lib.types.lazyAttrsOf ctxTreeType; 17 18 }; 18 19 options.schema = lib.mkOption { 19 20 description = "namespace schema — freeform deferred modules per entity kind"; 21 + defaultText = lib.literalExpression "{ }"; 20 22 default = { }; 21 23 type = lib.types.submodule { 22 24 freeformType = lib.types.lazyAttrsOf lib.types.deferredModule;
+22 -3
nix/lib/types.nix
··· 9 9 hostsOption = lib.mkOption { 10 10 description = "den hosts definition"; 11 11 default = { }; 12 + defaultText = lib.literalExpression "{ }"; 12 13 type = lib.types.attrsOf systemType; 13 14 }; 14 15 ··· 39 40 users = lib.mkOption { 40 41 description = "user accounts"; 41 42 default = { }; 43 + defaultText = lib.literalExpression "{ }"; 42 44 type = lib.types.attrsOf (userType config); 43 45 }; 44 46 instantiate = lib.mkOption { ··· 57 59 ''; 58 60 example = lib.literalExpression "inputs.nixpkgs.lib.nixosSystem"; 59 61 type = lib.types.raw; 62 + defaultText = lib.literalExpression "inputs.nixpkgs.lib.nixosSystem"; 60 63 default = 61 64 { 62 65 nixos = inputs.nixpkgs.lib.nixosSystem; ··· 77 80 ''; 78 81 example = lib.literalExpression ''[ "nixosConfigurations" hostName ]''; 79 82 type = lib.types.listOf lib.types.str; 83 + defaultText = lib.literalExpression ''[ "nixosConfigurations" hostName ]''; 80 84 default = 81 85 { 82 86 nixos = [ ··· 99 103 visible = false; 100 104 readOnly = true; 101 105 type = lib.types.deferredModule; 106 + defaultText = ''den.lib.aspects.resolve "nixos" (den.ctx.host { inherit host; })''; 102 107 default = mainModule config den.ctx.host "host"; 103 108 }; 104 109 }; ··· 120 125 classes = lib.mkOption { 121 126 type = lib.types.listOf lib.types.str; 122 127 description = "home management nix classes"; 128 + defaultText = lib.literalExpression ''[ "user" ]''; 123 129 default = [ "user" ]; 124 130 }; 125 131 aspect = strOpt "main aspect name" config.name; 126 - host = lib.mkOption { default = host; }; 132 + host = lib.mkOption { 133 + default = host; 134 + defaultText = lib.literalExpression "host"; 135 + }; 127 136 }; 128 137 } 129 138 ); ··· 182 191 name = strOpt "home configuration name" name; 183 192 userName = strOpt "user account name" userName; 184 193 hostName = strOpt "host name" hostName; 185 - user = lib.mkOption { default = userByName; }; 186 - host = lib.mkOption { default = hostByName; }; 194 + user = lib.mkOption { 195 + default = userByName; 196 + defaultText = lib.literalExpression "user"; 197 + }; 198 + host = lib.mkOption { 199 + default = hostByName; 200 + defaultText = lib.literalExpression "host"; 201 + }; 187 202 system = strOpt "platform system" system; 188 203 class = strOpt "home management nix class" "homeManager"; 189 204 aspect = strOpt "main aspect name" userName; ··· 194 209 ''; 195 210 example = lib.literalExpression ''inputs.nixpkgs.legacyPackages.''${home.system}''; 196 211 type = lib.types.raw; 212 + defaultText = lib.literalExpression ''inputs.nixpkgs.legacyPackages.''${home.system}''; 197 213 default = inputs.nixpkgs.legacyPackages.${config.system}; 198 214 }; 199 215 instantiate = lib.mkOption { ··· 210 226 ''; 211 227 example = lib.literalExpression "inputs.home-manager.lib.homeManagerConfiguration"; 212 228 type = lib.types.raw; 229 + defaultText = lib.literalExpression "inputs.home-manager.lib.homeManagerConfiguration"; 213 230 default = 214 231 { 215 232 homeManager = homeManagerConfiguration; ··· 226 243 ''; 227 244 example = lib.literalExpression ''[ "homeConfigurations" userName ]''; 228 245 type = lib.types.listOf lib.types.str; 246 + defaultText = lib.literalExpression ''[ "homeConfigurations" userName ]''; 229 247 default = 230 248 { 231 249 homeManager = [ ··· 240 258 visible = false; 241 259 readOnly = true; 242 260 type = lib.types.deferredModule; 261 + defaultText = lib.literalExpression "mainModule"; 243 262 default = mainModule config den.ctx.home "home"; 244 263 }; 245 264 };
+1
nix/nixModule/aspects.nix
··· 6 6 options.den.aspects = lib.mkOption { 7 7 description = "Den Aspects"; 8 8 default = { }; 9 + defaultText = lib.literalExpression "{ }"; 9 10 type = aspectsType; 10 11 }; 11 12 }
+1
nix/nixModule/ctx.nix
··· 7 7 { 8 8 options.den.ctx = lib.mkOption { 9 9 default = { }; 10 + defaultText = lib.literalExpression "{ }"; 10 11 type = lib.types.lazyAttrsOf ctxTreeType; 11 12 }; 12 13 }
+1
templates/microvm/modules/microvm-integration.nix
··· 26 26 options.microvm.guests = lib.mkOption { 27 27 type = lib.types.listOf lib.types.raw; 28 28 default = [ ]; 29 + defaultText = lib.literalExpression "[ ]"; 29 30 description = '' 30 31 Guest MicroVMs. 31 32 Value is a list of Den hosts: [ den.hosts.x86_64-linux.foo-microvm ]