# Is it possible to change the name of a project environment after having created it?

**URL:** <https://discourse.flox.dev/t/is-it-possible-to-change-the-name-of-a-project-environment-after-having-created-it/708>\
**Category:** Help\
**Created:** [March 28, 2023, 7:18pm UTC](https://discourse.flox.dev/t/is-it-possible-to-change-the-name-of-a-project-environment-after-having-created-it/708 "2023-03-28T19:18:42Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![aameen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/aameen/32/564_2.png) [@aameen](https://discourse.flox.dev/u/aameen)\
**Post date:** [April 12, 2023, 7:05pm UTC](https://discourse.flox.dev/t/is-it-possible-to-change-the-name-of-a-project-environment-after-having-created-it/708/8 "2023-04-12T19:05:20Z")

</div>

If you could provide a snippet to reproduce I could help debug.

This seems to work for me, maybe it will help unblock you:

```console
$ mkdir /tmp/foo;
$ cd /foo;
$ flox init -t project -i;
$ flox init -t package-simple -n foo;

# Manually create an env for this package
$ cat <<'EOF' > ./pkgs/foo/flox.nix
{
    environmentVariables.envName = baseNameOf ./.;
  shell.hook = ''
    echo "Welcome to the '$envName' environment" >&2;
  '';
}
EOF

# Re-render the changed environment
$ EDITOR=cat flox edit '.#foo';
$ bash -c ". <( flox activate -e '.#foo'; );" 2>/dev/null;
Welcome to the 'foo' environment

# Add a package
$ flox install -e '.#foo' hello;
Installed 'hello' package(s) into '.#foo' environment.

# Rename the env
$ mv ./pkgs/foo ./pkgs/bar;
$ git add ./pkgs/bar;

# Render the new env
$ EDITOR=cat flox edit '.#bar';
$ bash -c ". <( flox activate -e '.#bar'; );" 2>/dev/null;
Welcome to the 'bar' environment

```

The critical piece here is the “reload”/“re-render”.

You may also find this `direnv` snippet useful, which makes it so you don’t need to manually re-render:

```shell
# Reload any changes to `flox.nix' file.
# Capture output and check for errors.
_msg="$( EDITOR=cat flox edit -e '.#default' 2>&1; )";
case "$_msg" in
  *ERROR*|*error*)
    echo "Failed to update flox environment:" >&2;
    echo "$_msg" >&2;
    exit 1;
  ;;
  *)
    # Activate `flox' env.
    . <( flox activate -e '.#default'; );
  ;;
esac

```

---

_[View the full topic](https://discourse.flox.dev/t/is-it-possible-to-change-the-name-of-a-project-environment-after-having-created-it/708)._
