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
1{ den, ... }:
2let
3
4 description = ''
5 Sets a user default shell, enables the shell at OS and Home level.
6
7 Usage:
8
9 den.aspects.vic.includes = [
10 # will always love red snappers.
11 (den._.user-shell "fish")
12 ];
13 '';
14
15 userShell =
16 shell: user:
17 let
18 nixos =
19 { pkgs, ... }:
20 {
21 programs.${shell}.enable = true;
22 users.users.${user.userName}.shell = pkgs.${shell};
23 };
24 darwin = nixos;
25 homeManager.programs.${shell}.enable = true;
26 in
27 {
28 inherit nixos darwin homeManager;
29 };
30
31in
32{
33 den.provides.user-shell =
34 shell:
35 den.lib.parametric {
36 inherit description;
37 includes = [
38 ({ user, ... }: userShell shell user)
39 ({ home, ... }: userShell shell home)
40 ];
41 };
42}