Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable taking control of ~/Applications folder #226

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions modules/system/applications.nix
Expand Up @@ -24,12 +24,12 @@ in
# Set up applications.
echo "setting up ~/Applications..." >&2

if [ ! -e ~/Applications -o -L ~/Applications ]; then
ln -sfn ${cfg.build.applications}/Applications ~/Applications
elif [ ! -e ~/Applications/Nix\ Apps -o -L ~/Applications/Nix\ Apps ]; then
mkdir -p ~/Applications
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't mkdir fail if the directory already exists? Probably better to leave the existance check in and simply mkdir instead of ln'ing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The magic of the -p flag of mkdir is that it doesn't report any error if the folder to be created already exists (as well as the hierarchy of directories)

Copy link

@Atemu Atemu Dec 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh neat, didn't know that!


if [ ! -e ~/Applications/Nix\ Apps -o -L ~/Applications/Nix\ Apps ]; then
ln -sfn ${cfg.build.applications}/Applications ~/Applications/Nix\ Apps
else
echo "warning: ~/Applications and ~/Applications/Nix Apps are directories, skipping App linking..." >&2
echo "warning: ~/Applications/Nix Apps is not owned by nix-darwin, skipping App linking..." >&2
fi
'';

Expand Down