feat: add script to manage system applications
Introduce a script to organize applications under /Applications/Nix Apps. This setup improves the management and accessibility of system applications by creating aliases for them.
This commit is contained in:
parent
7bb3d87ced
commit
4cbfc5bd94
|
@ -13,6 +13,26 @@ in
|
|||
system.defaults = {
|
||||
dock.autohide = true;
|
||||
|
||||
system.activationScripts.applications.text = let
|
||||
env = pkgs.buildEnv {
|
||||
name = "system-applications";
|
||||
paths = config.environment.systemPackages;
|
||||
pathsToLink = "/Applications";
|
||||
};
|
||||
in
|
||||
pkgs.lib.mkForce ''
|
||||
# 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 '{}' + |
|
||||
while read src; do
|
||||
app_name=$(basename "$src")
|
||||
echo "copying $src" >&2
|
||||
${pkgs.mkalias}/bin/mkalias "$src" "/Applications/Nix Apps/$app_name"
|
||||
done
|
||||
'';
|
||||
|
||||
finder = {
|
||||
AppleShowAllExtensions = true;
|
||||
FXEnableExtensionChangeWarning = false;
|
||||
|
|
Loading…
Reference in a new issue