!yUrHuDcxUngfTlDbiy:matrix.org

flakelight

45 Members
https://github.com/nix-community/flakelight13 Servers

Load older messages


SenderMessageTime
8 Jun 2026
@inomena:matrix.orginomenaor opt-in atleast17:04:12
@accelbread:matrix.orgaccelbreadpotentially could have something that gets added to each nixosConfig17:04:20
@accelbread:matrix.orgaccelbreadand could add it there17:04:23
@inomena:matrix.orginomenaI'm migrating from snowfall-lib, which has this kind of auto wiring out of the box17:04:59
@accelbread:matrix.orgaccelbreadI think adding an opt-in setting to autoimport all modules makes sense17:06:20
@accelbread:matrix.orgaccelbreadim thinking if its possible to detect whether a module is "well-behaved"17:08:29
@accelbread:matrix.orgaccelbreadso it could be automatic17:08:52
@inomena:matrix.orginomenai.e. if it outputs a config object it would just be imported, but if it doesn't then it won't?17:18:14
@inomena:matrix.orginomenaI would like to auto load "misbehaving" modules too :P17:18:30
@accelbread:matrix.orgaccelbreadmakes sense17:22:26
@inomena:matrix.orginomena* I would like to auto import "misbehaving" modules too :P17:23:33
@accelbread:matrix.orgaccelbread maybe like flakelight.autoImportModules = ["*"] for everything, and flakelight.autoImportModules = ["nixos/*"] for just nixos ones 17:23:56
@inomena:matrix.orginomenayeah that could work17:24:13
@accelbread:matrix.orgaccelbreadnixos/home-manager will be easy. would need to export some machinery for flakelight-darwin to use17:25:06
@accelbread:matrix.orgaccelbreadflakelightModules may be tricky but imo makes sense too17:25:29
@inomena:matrix.orginomenawas 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)17:27:33
@inomena:matrix.orginomena* 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:matrix.orginomenaRedacted or Malformed Event17:28:48
@inomena:matrix.orginomena *

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:matrix.orginomenaoh neat, matrix code blocks support ligatures17:29:27
@accelbread:matrix.orgaccelbreadyeah i meant flakelightModules in same flake. for exporting extensions to flakelight17:29:59
13 Jun 2026
@inomena:matrix.orginomenaone problem I found with this is that it's not recursive, i.e. only top-level modules are imported15:43:06
@accelbread:matrix.orgaccelbreadwhat do you mean by that? like modules stored in subdirs?19:00:32
@inomena:matrix.orginomenayeah 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, etc20:39:57
@inomena:matrix.orginomenato be explicit; nix/nixosModules/desktop/default.nix, nix/nixosModules/desktop/gnome/default.nix, etc20:41:16
14 Jun 2026
@accelbread:matrix.orgaccelbreadAh 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:matrix.orgaccelbread flakelight expects the filesystem layout to match the flake attr layout 21:12:31
@accelbread:matrix.orgaccelbread if you want those to be part of your desktop module, your desktop module can import them by path 21:13:33
@accelbread:matrix.orgaccelbread 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:matrix.orginomenayeah I figured23:33:56

Show newer messages


Back to Room ListRoom Version: 10