Files
nix-config/modules/laptop/home-manager.nix
Amaury JOLY 6105c58cda reformat
2026-04-02 14:10:16 +02:00

32 lines
752 B
Nix

{
lib,
customConfig,
...
}: let
username = customConfig.username;
dotconfigPath = ../../dotconfig;
dotconfigEntries = lib.filterAttrs (name: _: !(lib.hasPrefix "." name)) (builtins.readDir dotconfigPath);
mkConfigEntry = name: type:
lib.nameValuePair name (
{
source = dotconfigPath + "/${name}";
force = true;
}
// lib.optionalAttrs (type == "directory") {
recursive = true;
}
);
in {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "hm-backup";
home-manager.users.${username} = {
home.stateVersion = "24.05";
xdg.enable = true;
xdg.configFile = lib.mapAttrs' mkConfigEntry dotconfigEntries;
};
}