nix-ff-up 476 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh --
  2. set -ue
  3. chmod3up() {
  4. dir="${1:?}"
  5. for _ in 1 2 3; do
  6. chmod +w -- "${dir}" || {
  7. dir="$(dirname "${dir}")"
  8. continue
  9. }
  10. return 0
  11. done
  12. return 1
  13. }
  14. inst() {
  15. f="${1:?}"
  16. d="${INSTALL_TO}/${2:?}"
  17. to="${d}/${f}"
  18. chmod3up "${d}"
  19. install -vDm 644 -- "${DIR}/${f}" "${to}"
  20. }
  21. : "${DIR:=${HOME}/.mozilla/kiss}"
  22. : "${INSTALL_TO:=${HOME}/.nix-profile/lib/firefox}"
  23. cd "${DIR}"
  24. inst policies.json distribution
  25. inst vendor.js browser/defaults/preferences