diff --git a/darwin/common.nix b/darwin/common.nix index db6675c..6e1a75a 100644 --- a/darwin/common.nix +++ b/darwin/common.nix @@ -6,7 +6,6 @@ }: { environment.systemPackages = with pkgs; [ - discord home-manager jetbrains.clion jetbrains.idea-ultimate @@ -30,7 +29,6 @@ pkg: builtins.elem (lib.getName pkg) [ "clion" - "discord" "idea-ultimate" "pycharm-professional" "webstorm" @@ -39,11 +37,27 @@ homebrew = { enable = true; + onActivation = { + autoUpdate = true; + cleanup = "zap"; + }; + + brews = [ + "libfido2" + "mas" + "openssh" + "theseal/ssh-askpass/ssh-askpass" + ]; + casks = [ "affinity-designer" "affinity-photo" "affinity-publisher" + "audacity" + "discord" + "element" "fantastical" + "firefox" "ghostty" "notion" "obsidian" @@ -54,10 +68,59 @@ masApps = { "Things" = 904280696; }; + + taps = [ + "theseal/ssh-askpass" + ]; + }; + + programs = { + # TODO: rewrite in fish maybe + zsh.shellInit = '' + export SSH_ASKPASS=/opt/homebrew/bin/ssh-askpass + export SSH_ASKPASS_REQUIRE=force + + checkSSHAgent() { + if [ "$1" = "-k" ] ; then + pkill -9 ssh-agent + fi + + ssh_agent_conf="$HOME/.ssh/agent" + if [ -e "$ssh_agent_conf" ] ; then + . "$ssh_agent_conf" + fi + if ! ps aux | awk '{print $2}' | grep -q "$SSH_AGENT_PID" \ + || ! [ -e "$ssh_agent_conf" ] \ + || [ -z "$SSH_AGENT_PID" ] ; \ + then + ssh-agent -s | grep -v echo > "$ssh_agent_conf" + . "$ssh_agent_conf" + fi + } + + checkSSHAgent + ''; }; system = { + defaults.NSGlobalDomain = { + "com.apple.swipescrolldirection" = false; + }; primaryUser = "irl"; stateVersion = 6; }; + + users.users = { + irl = { + description = "irl"; + home = "/Users/irl"; + name = "irl"; + + # This is the macOS zsh, not from nix! + # My home-manager configuration contains some zshrc to automatically + # start fish for interactive shells where the parent process is not + # already fish. + shell = "/bin/zsh"; + }; + }; } diff --git a/darwin/irl-mac-mini.nix b/darwin/irl-mac-mini.nix new file mode 100644 index 0000000..1601199 --- /dev/null +++ b/darwin/irl-mac-mini.nix @@ -0,0 +1,7 @@ +{ + lib, + ... +}: +{ + networking.hostName = "irl-mac-mini"; +}