···11-# This example implements an aspect "routing" pattern.
22-#
33-# Unlike `den.default` which is `parametric.atLeast`
44-# we use `parametric.fixedTo` here, which help us
55-# propagate an already computed context to all includes.
66-#
77-# This aspect, when installed in a `parametric.atLeast`
88-# will just forward the same context.
99-# The `mutual` helper returns an static configuration which
1010-# is ignored by parametric aspects, thus allowing
1111-# non-existing aspects to be just ignored.
1212-#
1313-# Be sure to read: https://vic.github.io/den/dependencies.html
1414-# See usage at: defaults.nix, alice.nix, igloo.nix
1515-#
1616-{ den, ... }:
1717-{
1818- # Usage: `den.default.includes [ eg.routes ]`
1919- eg.routes =
2020- let
2121- inherit (den.lib) parametric;
2222-2323- # eg, `<user>._.<host>` and `<host>._.<user>`
2424- mutual = from: to: den.aspects.${from.aspect}._.${to.aspect} or { };
2525-2626- routes =
2727- { host, user, ... }@ctx:
2828- parametric.fixedTo ctx {
2929- includes = [
3030- (mutual user host)
3131- (mutual host user)
3232- ];
3333- };
3434- in
3535- routes;
3636-}