grimm-nixos-laptop/hm/grimmauld/default.nix

48 lines
1.1 KiB
Nix
Raw Normal View History

2024-12-23 12:18:12 +01:00
{
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;
}