Regenerated
This commit is contained in:
+13
-6
@@ -327,25 +327,32 @@ in
|
||||
* First the nix-files that flake really needs and that do not fit wel in the hierarchical structure
|
||||
** =generated/hosts/traveldroid/traveldroid.nix=
|
||||
#+BEGIN_SRC nix :tangle generated/hosts/traveldroid/traveldroid.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ config, lib, inputs, ... }:
|
||||
|
||||
let
|
||||
modulesPath = ./generated/modules;
|
||||
|
||||
# import-tree as before
|
||||
importedModules = inputs.import-tree modulesPath;
|
||||
allModules = builtins.attrValues importedModules.imports;
|
||||
|
||||
# --- Import module switches ---
|
||||
# Load module switches
|
||||
moduleSwitches = import ./assets/system/modules.conf;
|
||||
|
||||
# Only keep enabled modules
|
||||
enabledModules = lib.filterAttrs (_: mod: moduleSwitches[_] or false) allModules;
|
||||
# Filter enabled modules (keep attrset!)
|
||||
enabledModules =
|
||||
lib.filterAttrs (name: _: moduleSwitches.${name} or false)
|
||||
importedModules.imports;
|
||||
|
||||
# Convert to list AFTER filtering
|
||||
moduleList = builtins.attrValues enabledModules;
|
||||
|
||||
# Extract fragments
|
||||
getFragment = module:
|
||||
if builtins.hasAttr "homeManagerExtraUserFragment" module
|
||||
then module.homeManagerExtraUserFragment
|
||||
else {};
|
||||
|
||||
homeManagerExtraUserFragments = lib.foldl' lib.mkMerge {} (map getFragment enabledModules);
|
||||
homeManagerExtraUserFragments =
|
||||
lib.foldl' lib.mkMerge {} (map getFragment moduleList);
|
||||
|
||||
in
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user