System/home-manager/darwin/default.nix

66 lines
1.8 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, inputs, ... }:
let
inherit (import ../../modules/lib.nix {
inherit lib;
inherit pkgs;
})
nLib;
in with lib;
with nLib; {
imports = [
../options.nix
../common/programs/core.nix
../common/programs/devel.nix
../common/programs/terminal.nix
2023-05-11 11:26:23 -04:00
../common/programs/git.nix
2023-05-11 11:31:17 -04:00
../common/programs/ssh.nix
2023-05-11 11:32:43 -04:00
../common/programs/fish.nix
./programs/core.nix
2022-10-15 05:20:05 -04:00
./programs/emacs.nix
2022-10-15 05:26:28 -04:00
./programs/devel.nix
];
options = {
nathan = {
programs = {
# Alacrity, on by default on mac
alacritty = mkDefaultOption "alacritty" config.nathan.config.isDesktop;
};
};
};
config = {
# Link applications in spotlight/launchpad
home.activation = mkIf pkgs.stdenv.isDarwin {
copyApplications = let
apps = pkgs.buildEnv {
name = "home-manager-applications";
paths = config.home.packages;
pathsToLink = "/Applications";
};
in lib.hm.dag.entryAfter [ "writeBoundary" ] ''
baseDir="$HOME/Applications/Home Manager Apps"
if [ -d "$baseDir" ]; then
rm -rf "$baseDir"
fi
mkdir -p "$baseDir"
for appFile in ${apps}/Applications/*; do
target="$baseDir/$(basename "$appFile")"
$DRY_RUN_CMD cp ''${VERBOSE_ARG:+-v} -fHRL "$appFile" "$baseDir"
$DRY_RUN_CMD chmod ''${VERBOSE_ARG:+-v} -R +w "$target"
done
'';
};
home.stateVersion = "22.05";
programs.home-manager.enable = true;
2023-03-27 19:42:30 -04:00
nathan.programs.emacs.package = pkgs.emacs;
# lib.mkDefault inputs.emacs.packages."${pkgs.system}".emacsPgtk;
2022-10-15 05:20:05 -04:00
# Allow management of launchd agents
launchd.enable = true;
2023-07-12 17:20:05 -04:00
# Add homebrew to fish path
prgorams.fish.shellInit = ''
fish_add_path /opt/homebrew/bin/
'';
};
}