redvault-ai/garnix/TODOS.md
Tristan Druyen 78f89dcd8b
Add garnix
Modified-by: Tristan Druyen <tristan@vault81.de>
2025-01-31 12:28:07 +01:00

2.2 KiB

TODOs

Add a simple DIY module framework

Features in order of importance

  • import files by directory structure like modname/default.nix or modname.nix (both ideally)
  • enable/disable wrap with modname.enable merged with provided config attrs, maybe more default config attrs ? order? tag a.la os/hm/both ?
  • variant with common code for home-manager OR nixOsConfig
  • variant with merged modules than can export config._home or sth??
    • declare like:
      attrs: {
        commonConfig= {}; // nil (default enable)
        nixosModule=(attrs: {}) attrs;
        hmModule=(attrs: {}) attrs;
      }
      
    • or ?
      {isHomeManagerModule, homeOnly, nixosOnly, homeOrNix, pkgs, ... }: {
        // write module and use if isHomeManagerModule inside it to seperate?
        asd = if isHomeMangerModule
        # ...
        // or via utilFunction which only evals in correct system?
        def = homeOrNix {args:  home.asd.def=true;} {args: boot.kernel.bla='bla'};
        // the lsat one seems kinda similar to #1, big difference is that it's reusable at multiple places in the config
        // is that usseful ? for programx.xyz at least likely?
      };
      
  • import time interface
    • module-based?
    • nixosModules.myMods.default // with sensible defs
      nixosModules.myMods.custom { path=./dir; autoconf.addEnable=false; } // but customization(maybe also regex?
      
    • or lib-like? lib.mylib.modularizer.custom {path ./; #...};
    • both?! (liblike needs more detailed setup, module can integrate with homeManager seamlessly with one call? or can it?, where to place calls in existing config???)
      • 2 calls could be needed, to get both hm and nixos integration?
      • or would they?
      • prevent double eval? uneeded cause lazyness? benchmark?
      • idea provide higher-level entrypoint which also replaces ./system foo and has several dirs as config e.g.
      • nixSystems=v81magicfunction {
          attrs = {
            inherit @pkgs, lib, inputs?
          };
          systemsDir = ./systems;
          homeModules = ./hmModules;
          osModules = ./hmModules;
          magicModules = './v81Modules;
          override = {
            hook running last
          };
        };