-
Notifications
You must be signed in to change notification settings - Fork 0
fix: tmux Wayland clipboard and serena mutable config #786
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,7 +1,15 @@ | ||||||||||||||||||||||
| { config, ... }: | ||||||||||||||||||||||
| let | ||||||||||||||||||||||
| serenaConfigSrc = ./serena_config.yml; | ||||||||||||||||||||||
| serenaConfigDest = "${config.home.homeDirectory}/.serena/serena_config.yml"; | ||||||||||||||||||||||
| in | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| home.file.".serena/serena_config.yml" = { | ||||||||||||||||||||||
| text = builtins.readFile ./serena_config.yml; | ||||||||||||||||||||||
| force = true; | ||||||||||||||||||||||
| }; | ||||||||||||||||||||||
| home.activation.serenaConfig = config.lib.dag.entryAfter [ "writeBoundary" ] '' | ||||||||||||||||||||||
| mkdir -p "$(dirname "${serenaConfigDest}")" | ||||||||||||||||||||||
| if [ ! -f "${serenaConfigDest}" ] || [ -L "${serenaConfigDest}" ]; then | ||||||||||||||||||||||
| rm -f "${serenaConfigDest}" | ||||||||||||||||||||||
| cp "${serenaConfigSrc}" "${serenaConfigDest}" | ||||||||||||||||||||||
| chmod u+w "${serenaConfigDest}" | ||||||||||||||||||||||
|
Comment on lines
+8
to
+12
|
||||||||||||||||||||||
| mkdir -p "$(dirname "${serenaConfigDest}")" | |
| if [ ! -f "${serenaConfigDest}" ] || [ -L "${serenaConfigDest}" ]; then | |
| rm -f "${serenaConfigDest}" | |
| cp "${serenaConfigSrc}" "${serenaConfigDest}" | |
| chmod u+w "${serenaConfigDest}" | |
| $DRY_RUN_CMD mkdir -p "$(dirname "${serenaConfigDest}")" | |
| if [ ! -f "${serenaConfigDest}" ] || [ -L "${serenaConfigDest}" ]; then | |
| $DRY_RUN_CMD rm -f "${serenaConfigDest}" | |
| $DRY_RUN_CMD cp "${serenaConfigSrc}" "${serenaConfigDest}" | |
| $DRY_RUN_CMD chmod u+w "${serenaConfigDest}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current condition
[ ! -f "${serenaConfigDest}" ] || [ -L "${serenaConfigDest}" ]can lead to unexpected behavior. If${serenaConfigDest}points to a directory,[ ! -f ... ]evaluates to true, causing the script to attemptrm -fon a directory. This will fail and is likely not the intended behavior.Using
[ ! -e "${serenaConfigDest}" ] || [ -L "${serenaConfigDest}" ]is more robust. It correctly triggers the copy only if the destination doesn't exist or is a symlink, and it correctly does nothing if it's an existing file or directory.