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(namespaces): Parametric aspect from imported namespace (#266)

Fixes #261

authored by

Victor Borja and committed by
GitHub
f7eac0e9 7c781f55

+102
+1
nix/namespace.nix
··· 14 14 "modules" 15 15 "resolve" 16 16 "__functor" 17 + "__functionArgs" 17 18 ]; 18 19 19 20 stripAspect =
+101
templates/ci/modules/features/deadbugs/issue-261-parametric-aspect-from-remote-namespace.nix
··· 1 + { denTest, ... }: 2 + { 3 + flake.tests.deadbugs-issue-261.parametric-aspect-from-remote-namespace = { 4 + 5 + test-explicitly-called = denTest ( 6 + { 7 + lib, 8 + den, 9 + inputs, 10 + remote, 11 + funnyNames, 12 + ... 13 + }: 14 + let 15 + 16 + input = 17 + # evaling here is like consuming a remote flake 18 + (lib.evalModules { 19 + specialArgs.inputs = inputs; 20 + modules = [ 21 + (inputs.den.flakeModule) 22 + (inputs.den.namespace "remote" true) 23 + ( 24 + { remote, den, ... }: 25 + { 26 + remote.parametrized = 27 + { hey, ... }: 28 + { 29 + funny.names = [ "remote parametrized ${hey}" ]; 30 + }; 31 + } 32 + ) 33 + ]; 34 + }).config.flake; 35 + in 36 + { 37 + imports = [ (inputs.den.namespace "remote" input) ]; 38 + 39 + den.aspects.local.includes = [ 40 + (remote.parametrized { hey = "you"; }) 41 + ]; 42 + 43 + expr = funnyNames den.aspects.local; 44 + expected = [ "remote parametrized you" ]; 45 + } 46 + ); 47 + 48 + test-parametric-context-passed = denTest ( 49 + { 50 + lib, 51 + den, 52 + inputs, 53 + remote, 54 + funnyNames, 55 + ... 56 + }: 57 + let 58 + 59 + input = 60 + # evaling here is like consuming a remote flake 61 + (lib.evalModules { 62 + specialArgs.inputs = inputs; 63 + modules = [ 64 + (inputs.den.flakeModule) 65 + (inputs.den.namespace "remote" true) 66 + ( 67 + { remote, den, ... }: 68 + { 69 + remote.parametrized = 70 + { hey, ... }: 71 + { 72 + funny.names = [ "remote parametrized ${hey}" ]; 73 + }; 74 + } 75 + ) 76 + ]; 77 + }).config.flake; 78 + in 79 + { 80 + imports = [ (inputs.den.namespace "remote" input) ]; 81 + 82 + den.aspects.local.includes = [ 83 + ( 84 + { hey }: 85 + { 86 + funny.names = [ "local ${hey}" ]; 87 + } 88 + ) 89 + remote.parametrized # This is the bug! commenting works 90 + ]; 91 + 92 + expr = funnyNames (den.aspects.local { hey = "arnold"; }); 93 + expected = [ 94 + "local arnold" 95 + "remote parametrized arnold" 96 + ]; 97 + } 98 + ); 99 + 100 + }; 101 + }