| 8 Jun 2026 |
inomena | * was not expecting this to also load modules from external flakes (like flakelightModules), I tend to import them within a module that does something with them (like I have a sops module for sops-nix that'd deal with sops stuff, disko module that imports disko's module and does stuff, etc) | 17:28:00 |
inomena | Redacted or Malformed Event | 17:28:48 |
inomena | * like this snippet from a module I have for disko:
{ lib, config, inputs, ... }:
let
cfg = config.flake.disks;
in {
options.flake.disks = {
device = lib.mkOption {
type = lib.types.str;
default = "";
};
};
config = lib.mkIf cfg.device != "" {
imports = [
inputs.disko.nixosModules.disko
];
disko.devices.disk.root = {
device = cfg.device;
type = "disk";
content = {
| 17:28:59 |
inomena | oh neat, matrix code blocks support ligatures | 17:29:27 |
accelbread | yeah i meant flakelightModules in same flake. for exporting extensions to flakelight | 17:29:59 |
| 13 Jun 2026 |
inomena | one problem I found with this is that it's not recursive, i.e. only top-level modules are imported | 15:43:06 |
accelbread | what do you mean by that? like modules stored in subdirs? | 19:00:32 |
inomena | yeah exactly, I've got a pattern where I group/nest modules based on their context, i.e. I have a desktop module, within that module I have a gnome module, etc | 20:39:57 |
inomena | to be explicit; nix/nixosModules/desktop/default.nix, nix/nixosModules/desktop/gnome/default.nix, etc | 20:41:16 |
| 14 Jun 2026 |
accelbread | Ah yeah, since the schema of nixosModules is an attrset, the loading logic is to load nix/nixosModules as attrs; it'll load desktop/default.nix as "desktop" | 21:12:00 |
accelbread | flakelight expects the filesystem layout to match the flake attr layout | 21:12:31 |
accelbread | if you want those to be part of your desktop module, your desktop module can import them by path | 21:13:33 |
accelbread | if you want them to be exported from the flake separately from the desktop module, you'd have to put it at top-level | 21:14:09 |
inomena | yeah I figured | 23:33:56 |
inomena | maybe using import-tree or something would solve my case, need to try that out | 23:34:21 |
accelbread | yeah, long-term I plan to clean the autoloading code up in order to make it more extensible, so people can write a module that customizes autoloading to however they want it | 23:52:00 |
| 4 Jul 2026 |
| Niclas Overby Ⓝ changed their profile picture. | 23:24:42 |