45 lines
852 B
Nix
45 lines
852 B
Nix
{
|
|
lib,
|
|
fn,
|
|
pkgs,
|
|
config,
|
|
home-manager,
|
|
...
|
|
}:
|
|
with lib;
|
|
{
|
|
imports = [
|
|
home-manager.nixosModules.home-manager
|
|
];
|
|
}
|
|
// mkIf (elem "home" config.machine.services) {
|
|
home-manager = {
|
|
users =
|
|
let
|
|
homeFiles = fn.lsfRec (toString ./home) true;
|
|
in
|
|
listToAttrs (
|
|
map (user: {
|
|
name = user.name;
|
|
value =
|
|
{ pkgs, ... }:
|
|
{
|
|
home.stateVersion = "25.05";
|
|
imports = homeFiles;
|
|
};
|
|
}) config.machine.users
|
|
);
|
|
extraSpecialArgs = {
|
|
inherit (config.machine) pkgsets;
|
|
# config.machine.users as set (user name as key)
|
|
users = (
|
|
listToAttrs (
|
|
map (user: {
|
|
name = user.name;
|
|
value = user;
|
|
}) config.machine.users
|
|
)
|
|
);
|
|
};
|
|
};
|
|
}
|