Dendritic Nix - Community-driven Nix distribution based on the Dendritic pattern.
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

Nix 34.0%
Elm 25.7%
CSS 14.9%
Handlebars 14.5%
HTML 9.2%
JavaScript 1.7%
Shell 0.1%
8 1 0

Clone this repository

https://tangled.org/oeiuwq.com/dendrix https://tangled.org/did:plc:hwcqoy35x55nzde2sm6dbvq7/dendrix
git@tangled.org:oeiuwq.com/dendrix git@tangled.org:did:plc:hwcqoy35x55nzde2sm6dbvq7/dendrix

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

Dendrix - community-driven distribution of Dendritic Nix configurations.#

Editor-distributions like those for nvim/emacs provide community-driven, opinionated configurations that can be easily reused and enabled by newcomers.

The dendrix project aims to provide the same experience: having community-managed, high-quality and no-barrier-of-entry setups for everything that can be configured using flake-parts modules.

Read more on Motivation and How it works.

Available dendritic repos.#

The following is a list of known dendritic repositories from the nix community. If you want to add/remove one of them, send a pull-request that edits dev/npins/sources.json. Also if you want to provide custom trees, send a pull-request editing dev/modules/community/your_repo.nix.

Dendrix knows of 8 dendritic repositories. 9 import-trees. 9 flags. 161 aspects accross 9 different nix configuration classes. 613 nix configuration files.

Maka-77x-nixconf7#

Maka-77x-nixconf7 at rev e3fd4ca. 1 dendritic trees. 22 aspects across 2 nix classes. 97 nix configuration files.

README

Maka-77x-nixconf7 defines 22 aspects across 2 nix classes.#
  • ai: nixos

  • base: homeManager/nixos

  • bluetooth: nixos

  • desktop: homeManager/nixos

  • dev: homeManager/nixos

  • displaylink: nixos

  • email: homeManager

  • facter: homeManager/nixos

  • fwupd: nixos

  • games: homeManager

  • guacamole: nixos

  • hosts/gouda: nixos

  • hosts/nixos: nixos

  • messaging: homeManager

  • mimi: nixos

  • openssh: nixos

  • root: nixos

  • shell: homeManager/nixos

  • sound: nixos

  • virtualisation: nixos

  • vpn: homeManager/nixos

  • work: homeManager

No community notes on Maka-77x-nixconf7. Use the source, Luke.

Maka-77x-nixconf7's ./modules tree

# usage on your layers.nix
{inputs, ...}: {
  imports = [
    inputs.dendrix.community.Maka-77x-nixconf7.default
  ];
}

dliberalesso-nix-config#

dliberalesso-nix-config at rev 499b5a0. 1 dendritic trees. 8 aspects across 2 nix classes. 85 nix configuration files.

README

dliberalesso-nix-config defines 8 aspects across 2 nix classes.#
  • default: home/nixos

  • facter: home/nixos

  • gui: home/nixos

  • hyprde: home/nixos

  • irpf: home/nixos

  • laptop: home/nixos

  • work: home/nixos

  • wsl: home/nixos

No community notes on dliberalesso-nix-config. Use the source, Luke.

dliberalesso-nix-config's ./modules tree

# usage on your layers.nix
{inputs, ...}: {
  imports = [
    inputs.dendrix.community.dliberalesso-nix-config.default
  ];
}

drupol-infra#

drupol-infra at rev a10da3a. 1 dendritic trees. 24 aspects across 2 nix classes. 107 nix configuration files.

README

drupol-infra defines 24 aspects across 2 nix classes.#
  • ai: nixos

  • base: homeManager/nixos

  • bluetooth: nixos

  • desktop: homeManager/nixos

  • dev: homeManager/nixos

  • displaylink: nixos

  • email: homeManager

  • facter: homeManager/nixos

  • fwupd: nixos

  • games: homeManager

  • guacamole: nixos

  • hosts/nixos: nixos

  • hosts/x13: nixos

  • hosts/x260: nixos

  • hosts/x280: nixos

  • hosts/xeonixos: nixos

  • messaging: homeManager

  • openssh: nixos

  • pol: nixos

  • root: nixos

  • shell: homeManager/nixos

  • sound: nixos

  • vpn: homeManager/nixos

  • work: homeManager

No community notes on drupol-infra. Use the source, Luke.

drupol-infra's ./modules tree

# usage on your layers.nix
{inputs, ...}: {
  imports = [
    inputs.dendrix.community.drupol-infra.default
  ];
}

gaetanlepage-nix-config#

gaetanlepage-nix-config at rev a17aca5. 1 dendritic trees. 55 aspects across 2 nix classes. 131 nix configuration files.

README

gaetanlepage-nix-config defines 55 aspects across 2 nix classes.#
  • agenix: nixos

  • android: nixos

  • bg-stream: homeManager

  • bluetooth: nixos

  • bootloader: nixos

  • caddy-reverse-proxies: nixos

  • cloud-backup: nixos

  • core: homeManager/nixos

  • csConfig: homeManager

  • desktop: homeManager/nixos

  • desktop-programs: homeManager

  • dev: nixos

  • display-manager: nixos

  • dunst: homeManager

  • email: homeManager

  • firefox: homeManager

  • flameshot: homeManager

  • foot: homeManager

  • gammastep: homeManager

  • gtk: homeManager

  • home-manager: homeManager/nixos

  • host_cuda: homeManager/nixos

  • host_feroe: nixos

  • host_framework: homeManager/nixos

  • host_inria: homeManager

  • host_jrs: homeManager

  • host_tank: nixos

  • host_vps: nixos

  • kanshi: homeManager

  • keyring: homeManager

  • nh: homeManager

  • nix: homeManager/nixos

  • nix-index-database: homeManager

  • nvidia: nixos

  • obs: nixos

  • printing: nixos

  • remote-builders: nixos

  • rofi: homeManager

  • security: nixos

  • server: nixos

  • sound: nixos

  • ssh-client: nixos

  • ssh-server: nixos

  • streaming: homeManager

  • substituters: homeManager/nixos

  • sway: homeManager

  • swaylock: homeManager

  • thunar: nixos

  • udiskie: homeManager

  • users: nixos

  • waybar: homeManager

  • wayland: homeManager

  • wireguard-client: nixos

  • xdg: homeManager

  • zathura: homeManager

No community notes on gaetanlepage-nix-config. Use the source, Luke.

gaetanlepage-nix-config's ./modules tree

# usage on your layers.nix
{inputs, ...}: {
  imports = [
    inputs.dendrix.community.gaetanlepage-nix-config.default
  ];
}

henrysipp-nix-setup#

henrysipp-nix-setup at rev 0a9d314. 1 dendritic trees. 19 aspects across 6 nix classes. 49 nix configuration files.

README

henrysipp-nix-setup defines 19 aspects across 6 nix classes.#
  • albion: hosts

  • allowedUnfreePackages: nixpkgs

  • base: homeManager/nixos

  • containers: nixos

  • darwin-desktop: homeManager

  • desktop: darwin/homeManager/nixos

  • dev: homeManager/nixos

  • games: homeManager/nixos

  • gawain: hosts

  • gnome: nixos

  • guren: hosts

  • henry: nixosUsers

  • hyprland: homeManager/nixos

  • nixvim: homeManager

  • plasma: homeManager/nixos

  • root: nixosUsers

  • shell: darwin/homeManager/nixos

  • system: darwin

  • work: darwin

No community notes on henrysipp-nix-setup. Use the source, Luke.

henrysipp-nix-setup's ./modules tree

# usage on your layers.nix
{inputs, ...}: {
  imports = [
    inputs.dendrix.community.henrysipp-nix-setup.default
  ];
}

icyd-nixvim#

icyd-nixvim at rev 6bf416a. 1 dendritic trees. 30 aspects across 2 nix classes. 41 nix configuration files.

README

icyd-nixvim defines 30 aspects across 2 nix classes.#
  • additional-plugins: nixvim

  • auto-session: nixvim

  • colorizer: nixvim

  • compiler: nixvim

  • completion: nixvim

  • core: config/nixvim

  • debug: nixvim

  • dial: nixvim

  • firenvim: nixvim

  • full: config

  • git: nixvim

  • harpoon: nixvim

  • lsp: nixvim

  • markdown: nixvim

  • maximize: nixvim

  • navigator: nixvim

  • neorg: nixvim

  • oil: nixvim

  • optimizations: nixvim

  • overseer: nixvim

  • project-nvim: nixvim

  • telescope: nixvim

  • tests: nixvim

  • todo-comments: nixvim

  • treesitter: nixvim

  • trouble: nixvim

  • ufo: nixvim

  • ui: nixvim

  • utils: nixvim

  • yanky: nixvim

No community notes on icyd-nixvim. Use the source, Luke.

icyd-nixvim's ./modules tree

# usage on your layers.nix
{inputs, ...}: {
  imports = [
    inputs.dendrix.community.icyd-nixvim.default
  ];
}

quasigod-nixconfig#

quasigod-nixconfig at rev 4326b79. 1 dendritic trees. 19 aspects across 2 nix classes. 59 nix configuration files.

README

quasigod-nixconfig defines 19 aspects across 2 nix classes.#
  • cachix: home/nixos

  • default: home/nixos

  • gaming: home/nixos

  • hacking: home/nixos

  • laptop: home/nixos

  • localai: home/nixos

  • plymouth: home/nixos

  • remote: home/nixos

  • replays: home/nixos

  • secure-boot: home/nixos

  • server: home/nixos

  • ssh: home/nixos

  • syncthing-client: home/nixos

  • syncthing-server: home/nixos

  • virtualisation: home/nixos

  • waydroid: home/nixos

  • workstation: home/nixos

  • zfs: home/nixos

  • zsa-kb: home/nixos

No community notes on quasigod-nixconfig. Use the source, Luke.

quasigod-nixconfig's ./modules tree

# usage on your layers.nix
{inputs, ...}: {
  imports = [
    inputs.dendrix.community.quasigod-nixconfig.default
  ];
}

vic-vix#

vic-vix at rev f31e8a1. 2 dendritic trees. 24 aspects across 3 nix classes. 44 nix configuration files.

README

vic-vix defines 24 aspects across 3 nix classes.#
  • aarch64-darwin: darwin

  • aarch64-linux: nixos

  • all-firmware: nixos

  • bootable: nixos

  • darwin: darwin

  • gnome-desktop: nixos

  • kde-desktop: nixos

  • kvm-amd: nixos

  • kvm-intel: nixos

  • macos-keys: nixos

  • nix-index: homeManager

  • nix-registry: homeManager

  • nix-settings: nixos

  • nixos: nixos

  • nvidia: nixos

  • rdesk: homeManager/nixos

  • unfree: nixos

  • vscode-server: homeManager

  • wl-broadcom: nixos

  • wsl: nixos

  • x86_64-darwin: darwin

  • x86_64-linux: nixos

  • xfce-desktop: nixos

  • vic: darwin/homeManager/nixos

No community notes on vic-vix. Use the source, Luke.

vic-vix's ./modules/community tree

# usage on your layers.nix
{inputs, ...}: {
  imports = [
    inputs.dendrix.community.vic-vix.default
  ];
}

vic-vix's ./modules/vic tree

# usage on your layers.nix
{inputs, ...}: {
  imports = [
    inputs.dendrix.community.vic-vix.vic
  ];
}

Cross-repository Dendritic Aspects.#

A primary advantage of the nix dendritic pattern are aspects (aka. cross-cutting concerns). If you browse the list of available repos above, you can see the aspects that each repo defines as discovered by Dendrix.

Aspects are just the flake outputs: flake.modules.<class>.<name>.

For example, some people have flake.modules.nixos.virtualization and flake.modules.darwin.virtualization and flake.modules.homeManager.virtualization.

Here, virtualization is the aspect name, and nixos/darwin/homeManager are the nix configuration classes across which the virtualization aspect is configured.

# virtualization.nix
{
  flake.modules.nixos.virtualization = { ... };
  flake.modules.darwin.virtualization = { ... };
  flake.modules.homeManager.virtualization = { ... };
}

This is the reason we say that Dendritic setups are aspect-oriented: they configure cross-cutting concerns across different module types.

The following is a list of aspects that are common in more than a single repository. Our hope is that people can collaborate to find naming conventions for common aspects. Having that we could mix configurations from different sources to enhance the same aspect.

TODO

TODO

Flags#

Flags are a dendrix convention used as part of a file or directory name as named signals. Flags only exist in positive form: +flag. A negative -flag means: ignore positive +flag files.

For example, if you have ai+local.nix and ai+cloud.nix files. The aspect configured by these files is most likely ai but the local and cloud flags signal the vendor.

Flags are inspired by editor configurations, like doomemacs: (scala +lsp). And are used in Dendrix only as a way to filter files on community import-trees. For example, one could exclude all +emacs paths like tree.flagged "-emacs +vim".

Quick Start#

We provide some templates you can use to start a new flake.

nix flake init github:vic/dendrix#template

Then edit your layers.nix file.

Try it Online!#

If you are not currently a NixOS user, you can try running an ephemereal NixOS on the web.

Start a machine and run the following:

nix run .#os-switch template

Customization#

Once you have a ./modules/ directory on your flake, just add flake-parts modules following the dendritic pattern. All files will be loaded automatically. Edit your layers.nix to include dendrix provided aspects you choose.

Motivation#

:: long but worth read on config organization and sharing ::

tl;dr. Because even if we already have our nix infra configs accessible to the public, sometimes it's not that easy for newcomers to know what to pick from them. Small steps of courtesy can have a big and positive impact in our community. Having an import-tree reference to your repository imposes no cost to you, and yet if you help document your subtrees or refine them, that helps the community even more. Your files are always in your control and you are free to accept pull-requests for your shared aspects, staying true to the sharing-spirit of opensource.

One cool advantage of the dendritic pattern is that every single file has the same .nix syntax, but also the same meaning. Unlike other configuration setups where nix files can be anything: nixos, darwin, packages or home configurations. In a dendritic setup each .nix file has only one interpretation: a flake-module. As such, it will internally configure many different nix config classes.

This property enables aspect-closures to be possible. Everything that is needed for a aspect to work is closely related in the same unit (file/directory), instead of being dispersed.

Imagine a single A_aspect.nix file. Being itself a flake-module, it can internally configure modules for nixos, darwin, homeManager or any other configuration class that needs to be affected for aspect-a to work seamlesly.

Another unlocked property is incremental-aspects. Many different files can incrementally contribute to the same aspect, removing nix files or adding more do not break existing aspects, but only extend or limit its capabilites.

Now imagine two files: A_aspect/minimal.nix, A_aspect/maximal.nix. In a dendritic setup, nor filename nor location is significant, and thus, both files can contribute to the same modules that constitute aspect-a, but each file is focused on different capabilities.

Using the import-tree API one could select only minimal capabilities.

shared-tree = import-tree.filter (lib.hasInfix "minimal");

We could also have A_aspect/private.nix making it contribute capabilities to our personal infra but not visible for community members.

shared-tree = import-tree.filterNot (lib.hasInfix "private");

We can also have a convention of anything inside community be shareable.

shared-tree = import-tree.filter (lib.hasInfix "community");

And even provide a richer import-tree API for people willing to consume our shared configuration tree:

# provider's flake
flake.lib.shared-tree = lib.pipe inputs.import-tree [
  (self: self.addPath ./modules)
  (self: self.filterNot lib.hasInfix("private"))
  (self: self.filter lib.hasInfix("community"))
  (self: self.addAPI {
    aspect-a = self: self.filter lib.hasInfix("A_aspect");
    aspect-b = self: self.filter lib.hasInfix("B_aspect");
    minimal = self: self.filter lib.hasInfix("minimal");
    maximal = self: self.filter lib.hasInfix("maximal");
  })
];

This way people consuming our shared import-tree will not have access to anything including private and only things under community and a couple of minimal, and maximal capability selectors.

# consumer's flake
imports = [
  inputs.providers-flake.lib.shared-tree.minimal.aspect-a
  inputs.providers-flake.lib.shared-tree.maximal.aspect-b
];

Of course this is only an example API. People and the community can comeup with better conventions on how to name things that better suit their design.

How it works#

tl;dr. By sharing subsets of community's flake-modules on this repo.

dendrix provides collections of import-trees from many dendritic nix repositories made available by the nix community. You can think of each import-tree like a pointer into a repository's subdir and filters to select files within.

This section outlines some conventions for people willing to opt-in on sharing substrees of their dendritic configs.

In a sense, this repository is akin to nix-community/NUR but for flake-parts modules that can provide packages and aspects to many different nix configuration classes.

Many dendritic repositories have a ./modules directory from where they import-tree all of their nix modules. However the dendritic pattern does not impose any naming convention, it just happens most of us have used ./modules. If you have an uncommon modules path, you can set the trees.default.subdir option for your-repo (example).

You can also use the import-tree API to provide refined subtrees or file filters for specific collections.

A dendrix default convention is that any path of yours having the private (file or directory) is not for share.

We (as a community) still have to come up with other conventions like, how we name aspect modules. But they will araise (feel free to open an issue or discussion on this repo) as we start having incremental aspects across repositories.

Based on these community import-trees we also provide some blessed, configuration layers maintained by the Dendrix community that people can easily enable on their own dendritic setup.

FAQ#

  • Are these configurations restriced to dendritic setups?

    Yes. The reason is that using dendritic patterns allows us to easily combine configs from many different community sources knowing that each and every .nix file will be a flake-parts module.

    Layers (blessed presets) are always loaded by import-tree, but only enabled when you include them as part of a top-level module of yours.

  • Is dendrix a NixOS based distribution ?

    In a way, but we still don't provide customized bootable installers.

    It is more a flake-parts configurations collection that can be included on any dendritic setup.

  • Can I contribute my awesome Desktop rice?

    Sure! the best way to do that is to keep your desktop rice on your own repository. And use this repo to add an import-tree object pointing to it. See the notes above about contributing on dev/npins/sources.json and dev/modules/community/*.nix.

  • How are layers made?

    A layer is a blessed dendritic setup, aimed to reuse aspects from the community provided dendritic repositories. However these blessed configs might have conventions that community repositories not necessarily follow (since our repos are mainly used for our own infra). So it is part of this community to create discussions about how to name things so that best practices and conventions arise around sharing and extending known aspects.

    For example, if we had a gaming aspect. We would need conventions on how to name aspect modules for gaming. And people would likely provide such dendritic configurations on their setups.

    So, long story short, layers are community owned setups. And repos are owned by a respective community member.

  • How about Games/AI/Devops/Security layers?

    You are right on point!, that's precisely why this project started. We also want to provide specialized versions of NixOS focused on pre-configured security, gaming, development setups.

Contributing#

Since we all now have agreed to follow the Dendritic pattern to organize our files, lets take a few more guidelines to make eveybody's life easier:

  • Always be nice, and have respect for others.
  • Be professional and considerate we are giving our time and energy on this project as an invaluable good for others.
  • Contributions are welcome as long as you also make a compromise to become maintainer for your aspect don't abandon your contribution easily. (Unmaintained files will be removed.)
  • This is a community project, so as soon as your PR is merged you'll also get commit bit, however we restrict changes to be only via PRs and require code-owners review before merge.
  • Prefer linear git history, squash PRs and no merge-commit. Vic recommends working with jujutsu.

Development#

We recommend to use direnv or anything that can load our nix develop path:dev environment. If you are using direnv, we provide an .envrc for it.

Upon entering the shell, you will see a menu of useful commands during development.

nix develop ./dev -c files # generate nix-controlled files (like this README) and format them.
nix flake check ./dev      # checks all is up-to-date, community checks, and formatting

# when adding a new repo, run npins inside of ./dev