tangled
alpha
login
or
join now
oeiuwq.com
/
den
8
fork
atom
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
atom
overview
issues
4
pulls
2
pipelines
nix class example by @musjj
oeiuwq.com
1 week ago
d4ccc672
f40817ea
1/1
mirror.yml
success
4s
+26
-11
1 changed file
expand all
collapse all
unified
split
docs
src
content
docs
guides
custom-classes.mdx
+26
-11
docs/src/content/docs/guides/custom-classes.mdx
···
18
18
`den._.forward` creates an aspect that takes configs from a source class
19
19
and inserts them into a target class at a specified path.
20
20
21
21
-
## Example: How Den forwards `hjem` user class to NixOS
21
21
+
### Example: How Den forwards `hjem` user class to NixOS
22
22
23
23
Den already integrates nix-maid and hjem just like home-manager.
24
24
···
45
45
}
46
46
```
47
47
48
48
-
Example: A git class that forwards to home-manager.
48
48
+
### Example: A git class that forwards to home-manager.
49
49
50
50
```nix
51
51
gitClass =
···
54
54
each = lib.singleton true;
55
55
fromClass = _: "git";
56
56
intoClass = _: "homeManager";
57
57
-
intoPath = _: [
58
58
-
"programs"
59
59
-
"git"
60
60
-
];
57
57
+
intoPath = _: [ "programs" "git" ];
61
58
fromAspect = _: lib.head aspect-chain;
62
62
-
adaptArgs =
63
63
-
{ config, ... }:
64
64
-
{
65
65
-
osConfig = config;
66
66
-
};
59
59
+
adaptArgs = lib.id;
67
60
};
68
61
69
62
den.aspects.tux = {
···
74
67
75
68
This will set at host: `igloo.home-manager.users.tux.programs.git.userEmail`
76
69
70
70
+
### Example: A `nix` class that propagates settings to NixOS and HomeManager
71
71
+
72
72
+
> Contributed by @musjj
73
73
+
74
74
+
```nix
75
75
+
nixClass =
76
76
+
{ class, aspect-chain }:
77
77
+
den._.forward {
78
78
+
each = [ "nixos" "homeManager" ];
79
79
+
fromClass = _: "nix";
80
80
+
intoClass = lib.id;
81
81
+
intoPath = _: [ "nix" "settings" ];
82
82
+
fromAspect = _: lib.head aspect-chain;
83
83
+
adaptArgs = lib.id;
84
84
+
};
85
85
+
86
86
+
nix-allowed = { user, ... }: {
87
87
+
nix.allowed-users = [ user.userName ];
88
88
+
};
89
89
+
90
90
+
den.aspects.tux.includes = [ nixClass nix-allowed ];
91
91
+
```
77
92
78
93
## Use Cases
79
94