tangled
alpha
login
or
join now
oeiuwq.com
/
denful
1
fork
atom
cherry-pickable Dendritic modules to extend your config easily. like a lazyvim-distribution but for dendritic nix. Discussions: https://oeiuwq.zulipchat.com/join/nqp26cd4kngon6mo3ncgnuap/
dendrix.oeiuwq.com/Dendritic.html
reusable
dedritic
nix
modules
configuration
distribution
1
fork
atom
overview
issues
pulls
pipelines
tangled
oeiuwq.com
4 months ago
9e0a0eba
d0305d3d
1/1
mirror.yml
success
2s
+123
-11
10 changed files
expand all
collapse all
unified
split
.github
workflows
tangled.yaml
.tangled
workflows
mirror.yml
flake.nix
flakeModule.nix
modules
_tmp
nixos
_facet.nix
base.nix
hosts-class.nix
den
unfree.nix
lib.nix
options.nix
-11
.github/workflows/tangled.yaml
···
1
1
-
on:
2
2
-
workflow_dispatch:
3
3
-
push:
4
4
-
concurrency:
5
5
-
group: tangled
6
6
-
cancel-in-progress: true
7
7
-
jobs:
8
8
-
tangled:
9
9
-
uses: vic/vic/.github/workflows/tangled.yml@main
10
10
-
secrets:
11
11
-
TANGLED_SSH_KEY: ${{secrets.TANGLED_SSH_KEY}}
+12
.tangled/workflows/mirror.yml
···
1
1
+
when:
2
2
+
- event: ["push"]
3
3
+
branch: ["*"]
4
4
+
engine: "nixery"
5
5
+
clone:
6
6
+
skip: true
7
7
+
dependencies:
8
8
+
nixpkgs:
9
9
+
- gh
10
10
+
steps:
11
11
+
- name: mirror
12
12
+
command: gh -R vic/vic issue comment 3 -b denful
+1
flake.nix
···
1
1
{
2
2
outputs = _: {
3
3
+
flakeModule = ./flakeModule.nix;
3
4
};
4
5
}
+7
flakeModule.nix
···
1
1
+
{ inputs, lib, config, ... }:
2
2
+
let
3
3
+
mainModule = { imports = [ (inputs.import-tree ./modules) ]; };
4
4
+
denful = lib.evalModules { modules = [ mainModule ]; };
5
5
+
in {
6
6
+
imports = [ mainModule ];
7
7
+
}
+21
modules/_tmp/nixos/_facet.nix
···
1
1
+
{ inputs, lib, ... }:
2
2
+
name:
3
3
+
let
4
4
+
inherit (inputs.flake-aspects.lib lib) new-scope;
5
5
+
mkFacet =
6
6
+
name:
7
7
+
{ config, ... }:
8
8
+
{
9
9
+
_module.args.denful.${name} = config.${name}.aspects;
10
10
+
imports = [ (new-scope name) ];
11
11
+
flake.modules.flake.${name} = {
12
12
+
_module.args.denful.${name} = config.${name}.aspects;
13
13
+
imports = [ (config.${name}.modules.flake.denful or { }) ];
14
14
+
};
15
15
+
};
16
16
+
in
17
17
+
{
18
18
+
19
19
+
_module.args.denful.foo = { };
20
20
+
21
21
+
}
+3
modules/_tmp/nixos/base.nix
···
1
1
+
{
2
2
+
3
3
+
}
+47
modules/_tmp/nixos/hosts-class.nix
···
1
1
+
{ inputs, ... }:
2
2
+
{
3
3
+
vix.aspects.denful = {
4
4
+
flake = { };
5
5
+
};
6
6
+
7
7
+
vix.aspects.import-tree.provides.hosts = {
8
8
+
description = ''
9
9
+
### Automatic import of host's nixos/darwin modules.
10
10
+
11
11
+
#### Usage Examples
12
12
+
13
13
+
# modules/hosts/default.nix
14
14
+
{ denful, ... }:
15
15
+
{
16
16
+
imports = [ denful.vix.facet ];
17
17
+
}
18
18
+
19
19
+
#### Arguments
20
20
+
21
21
+
hostPath: A path.
22
22
+
23
23
+
#### Aspect behaviour
24
24
+
25
25
+
this aspect hooks into `den.aspects.default.host` and
26
26
+
for each host, it will import-tree all nix files:
27
27
+
28
28
+
''${hostsPath}/''${host.name}/_''${host.class}/**/*.nix
29
29
+
30
30
+
each nix file is part of the corresponding class: nixos/darwin.
31
31
+
'';
32
32
+
33
33
+
__functor =
34
34
+
_:
35
35
+
{ hostsPath }:
36
36
+
{ host }:
37
37
+
let
38
38
+
path = "${hostsPath}/${host.name}/_${host.class}";
39
39
+
imported = {
40
40
+
name = path;
41
41
+
description = "import-tree ${path}";
42
42
+
${host.class}.imports = [ (inputs.import-tree path) ];
43
43
+
};
44
44
+
in
45
45
+
if builtins.pathExists path then imported else { };
46
46
+
};
47
47
+
}
+6
modules/den/unfree.nix
···
1
1
+
{
2
2
+
3
3
+
4
4
+
5
5
+
6
6
+
}
+13
modules/lib.nix
···
1
1
+
{ lib, ... }:
2
2
+
let
3
3
+
denful-lib = {
4
4
+
dup = x : x * 2;
5
5
+
};
6
6
+
in
7
7
+
{
8
8
+
config.denful.lib = denful-lib;
9
9
+
options.denful.lib = lib.mkOption {
10
10
+
type = lib.types.attrsOf lib.types.unspecified;
11
11
+
default = {};
12
12
+
};
13
13
+
}
+13
modules/options.nix
···
1
1
+
{ lib, config, ... }:
2
2
+
let
3
3
+
denfulType = lib.types.submodule({ name, ... }: {
4
4
+
freeformType = lib.types.attrsOf denfulType;
5
5
+
});
6
6
+
in
7
7
+
{
8
8
+
options.denful = lib.mkOption {
9
9
+
type = denfulType;
10
10
+
default = {};
11
11
+
};
12
12
+
config._module.args.denful = config.denful;
13
13
+
}