nixos-config/modules
Gabriel Arazas d306be8758 tasks/multimedia-archive: create script for importing OPML
Not much respect for `category` attribute, apparently. I'll update it at
some point to consider the usual folder structure instead.

For now, it's not a problem for me since the exported feeds to be used
are so low anyways.
2022-11-18 17:12:54 +08:00
..
home-manager services/bleachbit: cleanup and format 2022-11-13 14:03:49 +08:00
nixos tasks/multimedia-archive: create script for importing OPML 2022-11-18 17:12:54 +08:00
README.adoc Update documentation 2021-12-21 14:29:27 +08:00

Table of Contents

These are various modules ranging from NixOS modules and home-manager modules.

The modules are imported usually through lib.filesToAttr, allowing for easier structuring without modifying the index file of each module (i.e., default.nix). (See the implementation for more details.)

For example, take the following module folder structure of the custom NixOS modules…​

nixos/
├── themes/
│   ├── a-happy-gnome/
│   │   ├── default.nix
│   │   └── README.adoc
│   ├── a-sad-gnome/
│   │   ├── default.nix
│   │   └── README.adoc
│   └── default.nix
├── specific/
│   ├── borg.nix
│   └── prometheus.nix
├── agenix.nix
├── archiving.nix
├── desktop.nix
├── dev.nix
├── editors.nix
└── users.nix

where it should have the equivalent attribute set.

{
  agenix = path/to/agenix.nix;
  archiving = path/to/archiving.nix;
  desktop = path/to/desktop.nix;
  dev = path/to/dev.nix;
  editors = path/to/editors.nix;
  specific = {
    borg = path/to/specific/borg.nix;
    prometheus = path/to/specific/prometheus.nix;
  };
  themes = path/to/themes; # Since it has a 'default.nix' detected, we're using it instead.
  users = path/to/users.nix;
}

The resulting attribute set can be easily be used for importing. Heres an example of a NixOS system created with the modules which can used for shared configuration between hosts.

lib.nixosSystem {
  system = "x86_64-linux";
  modules = lib.mapAttrsToList (name: path: import path) (lib.filesToAttr ./modules);
}

Flake outputs

Various modules are then exported to the project flake as the following output: