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

119 lines
2.5 KiB
Nix
Raw Normal View History

2024-12-23 12:18:12 +01:00
{
pkgs,
lib,
2024-12-23 17:45:20 +01:00
config ? { },
2024-12-23 12:18:12 +01:00
...
}:
let
2024-12-23 17:45:20 +01:00
getIfHas =
path: attrs:
if path == [ ] then
2024-12-23 12:18:12 +01:00
attrs
else if builtins.hasAttr (builtins.head path) attrs then
getIfHas (builtins.tail path) (builtins.getAttr (builtins.head path) attrs)
else
null;
2024-12-23 17:45:20 +01:00
configGetIfHasOrFalse = path: lib.defaultTo false (getIfHas (lib.splitString "." path) config);
2024-12-23 12:18:12 +01:00
user = hm_config.home.username;
homedir = hm_config.home.homeDirectory;
2024-12-23 17:45:20 +01:00
graphical = configGetIfHasOrFalse "grimmShared.graphical";
2024-12-23 12:18:12 +01:00
hm_config = {
home = {
username = "grimmauld";
stateVersion = "24.11";
homeDirectory = "/home/${user}";
2024-12-23 17:45:20 +01:00
preferXdgDirectories = true;
packages = with pkgs; [
deskwhich
# imhex
# libreoffice-qt
filezilla
obsidian
nomacs
pdfarranger
krita
# weasis
# kicad
prusa-slicer
freecad
openscad
vlc
# blender
];
file.".ssh/id_ed25519_sk".source = ../../ssh/id_ed25519_sk;
file.".ssh/id_ed25519_sk.pub".source = ../../ssh/id_ed25519_sk.pub;
};
programs.thunderbird = {
enable = graphical;
profiles.default = {
isDefault = true;
};
};
programs.zathura.enable = graphical;
programs.alacritty = {
enable = graphical;
settings = {
font.size = 16;
font.normal = {
family = "Noto Sans Mono";
};
window.opacity = 0.85;
};
2024-12-23 12:18:12 +01:00
};
systemd.user.enable = true;
2024-12-23 17:45:20 +01:00
systemd.user.tmpfiles.rules = lib.optional (configGetIfHasOrFalse "services.printing.cups-pdf.enable") "L ${homedir}/PDF - - - - /var/spool/cups-pdf-pdf/users/${user}";
2024-12-23 12:18:12 +01:00
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;
};
};
2024-12-23 17:45:20 +01:00
programs.gpg = {
enable = true;
mutableKeys = true;
publicKeys = [
{
source = ./grimmauld.gpg;
trust = 5;
}
];
};
services.gpg-agent = {
enable = true;
enableBashIntegration = true;
pinentryPackage = if graphical then pkgs.pinentry-qt else pkgs.pinentry-tty;
};
xdg.mimeApps.enable = true;
services.ssh-agent.enable = true;
2024-12-23 12:18:12 +01:00
};
in
{
home-manager.users."${user}" = hm_config;
}