2024-03-21 15:00:36 +01:00
|
|
|
{ options, config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
with lib.metacfg;
|
|
|
|
let cfg = config.metacfg.system.interface;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.metacfg.system.interface = with types; {
|
|
|
|
enable = mkEnableOption "macOS interface";
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2024-11-18 15:04:52 +01:00
|
|
|
system.activationScripts.applications.text = let
|
|
|
|
env = pkgs.buildEnv {
|
|
|
|
name = "system-applications";
|
|
|
|
paths = config.environment.systemPackages;
|
|
|
|
pathsToLink = "/Applications";
|
|
|
|
};
|
|
|
|
in
|
2024-11-18 15:20:40 +01:00
|
|
|
lib.mkForce ''
|
2024-11-18 15:04:52 +01:00
|
|
|
# Set up applications.
|
|
|
|
echo "setting up /Applications..." >&2
|
|
|
|
rm -rf /Applications/Nix\ Apps
|
|
|
|
mkdir -p /Applications/Nix\ Apps
|
|
|
|
find ${env}/Applications -maxdepth 1 -type l -exec readlink '{}' + |
|
2024-11-18 15:20:40 +01:00
|
|
|
while read -r src; do
|
2024-11-18 15:04:52 +01:00
|
|
|
app_name=$(basename "$src")
|
|
|
|
echo "copying $src" >&2
|
|
|
|
${pkgs.mkalias}/bin/mkalias "$src" "/Applications/Nix Apps/$app_name"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2024-11-18 15:20:40 +01:00
|
|
|
system.defaults = {
|
|
|
|
dock.autohide = true;
|
|
|
|
|
2024-03-21 15:00:36 +01:00
|
|
|
finder = {
|
|
|
|
AppleShowAllExtensions = true;
|
|
|
|
FXEnableExtensionChangeWarning = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
NSGlobalDomain = {
|
|
|
|
_HIHideMenuBar = true;
|
|
|
|
AppleShowScrollBars = "Always";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
metacfg.home.file.".hushlogin".text = "";
|
|
|
|
};
|
|
|
|
}
|