mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
21 lines
599 B
Nix
21 lines
599 B
Nix
{ lib }: { nixosImports, homeImports, users, hostName, profiles }: with lib;
|
|
|
|
let
|
|
importLists = {
|
|
nixos = nixosImports;
|
|
home = homeImports;
|
|
};
|
|
replacedLists = mapAttrs
|
|
(_: fileList:
|
|
map (builtins.replaceStrings [ "HN" ] [ "${hostName}" ]) fileList
|
|
)
|
|
importLists;
|
|
homeScaffold = user: {
|
|
home-manager.users.${user} = {
|
|
imports = filter builtins.pathExists replacedLists.home;
|
|
};
|
|
};
|
|
scaffoldedUsers = map homeScaffold users;
|
|
baseProfile = singleton profiles.base;
|
|
in
|
|
filter builtins.pathExists replacedLists.nixos ++ baseProfile ++ scaffoldedUsers
|