feat(nix): add system module, pass config to lib

This commit introduces a system module for NixOS and Home Manager,
and passes the configuration to the lib file.
This commit is contained in:
Mohammad Rafiq 2025-07-07 07:58:15 +08:00
parent b7358cd825
commit 46cf93f69b
No known key found for this signature in database
4 changed files with 25 additions and 6 deletions

View file

@ -1,9 +1,11 @@
{ lib, ... }:
{ lib, config, ... }:
let
inherit (lib.attrsets) concatMapAttrs;
cfg = config.flake;
inherit (lib.attrsets) mapAttrs concatMapAttrs;
in
{
flake.lib = {
flattenAttrs = attrset: concatMapAttrs (_: v: v) attrset;
forAllUsers = f: mapAttrs f cfg.manifest.users;
};
}