{ pkgs, lib, config ? {}, ... }: let getIfHas = path: attrs: if path == [] then attrs else if builtins.hasAttr (builtins.head path) attrs then getIfHas (builtins.tail path) (builtins.getAttr (builtins.head path) attrs) else null; user = hm_config.home.username; homedir = hm_config.home.homeDirectory; hm_config = { home = { username = "grimmauld"; stateVersion = "24.11"; homeDirectory = "/home/${user}"; }; systemd.user.enable = true; systemd.user.tmpfiles.rules = lib.optional (lib.defaultTo false (getIfHas ["services" "printing" "cups-pdf" "enable"] config)) "L ${homedir}/PDF - - - - /var/spool/cups-pdf-pdf/users/${user}"; xdg.userDirs = { enable = true; createDirectories = true; extraConfig = { "3d" = "${homedir}/3d"; }; }; programs.gradle = { enable = true; settings = { "org.gradle.java.home" = "${pkgs.openjdk}/lib/openjdk"; "org.gradle.java.installations.auto-detect" = false; }; }; }; in { home-manager.users."${user}" = hm_config; }