Skip to content

~/.termux/termux.properties doesn't work when it's a symlink. #512

Description

@oneorseveralcats

Trying to use nix to declaratively configure all aspects of termux and found out that ~/.termux/termux.properties can't be a symlink. There's an issue for it upstream, but they claim it'd be security issue to allow that file to be a symlink (termux/termux-app#4157).

I guess assuming that file can't be a symlink the next based thing would be using an activation script to deploy it?

Edit: I wrote an activation script. (termux.properties can be at either .termux/termux.properties on .config/termux/termux.properties)

build.activation.generateTermuxProperties = let
  path = "$HOME/.config/termux/termux.properties";
  settings = {
    fullscreen = true;
    use-fullscreen-workaround = true;
  };
in /* bash */ ''
  echo "generating termux.properties"
  $DRY_RUN_CMD mkdir -p $(dirname ${path})
  $DRY_RUN_CMD printf "# Generated by nix-on-droid. Warning: changes will be overwritten #\n" > "${path}"
  $DRY_RUN_CMD printf "${lib.generators.toKeyValue {} settings}" >> "${path}"
'';

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions