nix-configuration/home-manager/lcech-mac-veracode.nix
2025-01-30 09:34:16 +01:00

150 lines
2.9 KiB
Nix

{
lib,
pkgs,
...
}:
let
username = "lcech";
homedir = "/Users/${username}";
zshSourceDirs = [ ];
in
{
imports = [
(import ./veracode/aws-cli.nix {
inherit homedir lib pkgs;
})
];
home.username = username;
home.homeDirectory = homedir;
home.stateVersion = "24.11";
home.packages = with pkgs; [
hammerspoon
pstree
watch
colima
docker
];
# ghostty marked as broken as of 2025-01-05 in nix, using homebrew and custom config
home.file = {
"${homedir}/Library/Application Support/com.mitchellh.ghostty/config" = {
text = ''
${builtins.readFile ./shared/ghostty.config}
font-size = 14
'';
};
"${homedir}/.hammerspoon/init.lua" = {
text = ''
${builtins.readFile ./hammerspoon/window-tiling.lua}
${builtins.readFile ./hammerspoon/window-move.lua}
'';
};
};
programs.git = {
enable = true;
userName = "Lukas Cech";
userEmail = "lcech@veracode.com";
ignores = [
".vscode"
".direnv"
".devenv"
".envrc"
];
extraConfig = {
core = {
autocrlf = "input";
editor = "vim";
};
pull.rebase = false;
init.defaultBranch = "main";
};
};
programs.lsd = {
enable = true;
enableAliases = true;
settings = {
blocks = [
"permission"
"user"
"group"
"size"
"date"
"git"
"name"
];
sorting = {
dir-grouping = "first";
};
};
};
programs.pay-respects = {
enable = true;
enableZshIntegration = true;
};
programs.zsh = {
enable = true;
dirHashes = {
mac = "${homedir}/storage/.macshare";
nix = "${homedir}/.config/nix";
vc = "${homedir}/projects/veracode";
};
shellAliases = {
hammerspoon-config = "open -a ${pkgs.hammerspoon}/Applications/Hammerspoon.app/Contents/MacOS/Hammerspoon";
};
initExtra = ''
${builtins.concatStringsSep "\n" (
builtins.map (dir: ''
for file in ${dir}/*.zsh; do
source "$file"
done
'') zshSourceDirs
)}
autoload -U +X bashcompinit && bashcompinit
source <(${pkgs.kubectl}/bin/kubectl completion zsh)
complete -C '${pkgs.awscli2}/bin/aws_completer' aws
bindkey '^[[3~' delete-char
'';
};
home.sessionVariables = {
EDITOR = "vim";
GO111MODULE = "on";
TERMINAL = "ghostty";
};
launchd.agents.keepass-sync = {
enable = true;
config = {
Program = "${pkgs.writeShellScript "keepass-sync" ''
${pkgs.coreutils}/bin/cp "${homedir}/storage/.macshare/.secret/arnie.kdbx" "${homedir}/.secret/arnie.kdbx"
''}";
ProgramArguments = [];
StartInterval = 60 * 10;
StandardErrorPath = "/var/log/keepass-sync.error.log";
StandardOutPath = "/var/log/keepass-sync.out.log";
};
};
}