Some feedback on first usages

This is not a bug report, but more regular feedback as I try flox for the first time.
Background, I’m new to flox and nix.

flox version: Version: 0.0.7-r76
nix version: nix-shell (Nix) 2.11.1

(Update: there are some things in here that are actually bugs - 3 and 4)

  1. About basic usage metrics:
flox collects basic usage metrics in order to improve the user experience,
including a record of the subcommand invoked along with a unique token.
It does not collect any personal information.

Do you consent to the collection of basic usage metrics? (Y/n) 

I’ve answered no to this question, because it’s not clear what a record of the subcommand invoked means and how this data is being used. Some examples of what’s not being tracked and what is would help me to chose yes.

  1. No fish support

I’m using fish as my default shell, but was greeted with this:

unsupported shell: "/usr/bin/fish"
Launching bash instead
flox [default] [thomas@honor ~]$ 
  1. 404 on searching:

following the guide -

flox search ripgrep
error: unable to download '': HTTP error 404

       response body:

         "message": "Not Found",
         "documentation_url": ""
(use '--show-trace' to show detailed location information)
  1. Cannot install
flox install ripgrep
fatal: cannot change to '/home/thomas/.cache/flox/meta/local': No such file or directory

At this point I’m stuck…

I confirm these bugs for 0.0.7-r76. I installed flox using the .deb package in ubuntu 22.04 (making sure that nix was not already installed!).

@tcoopman / @paulovieira - thank you for the bug report! I’m looking into the issue and will get back to you shortly …

Is it possible that the nixpkgs-flox repository is still private and should be made public?

Thanks so much for your patience … version 0.0.7-r82 is now available for download and should address issues #3 and #4 above. Rest assured we will be circling back to respond to the first two issues as well but I wanted to let you know right away that we’ve rolled out this new version.

UPDATE: found another bug, version 0.0.7-r83 is now the latest version, osx, deb and rpm downloaders are available for download.

(@etorreborre - if you’d prefer to activate the new version without a reinstall you can access it from the flox/default environment per usual.)

1 Like

We have two mechanisms for providing secure access to these private repositories during the closed beta - one for curl and one for git - but yes after the closed beta we’ll be marking this repository as public.

Thanks Michael, I just tested 0.0.7-r83 and it works fine for me.
(the other issue I had here still remains though).

Just to confirm, fish support is on our list of enhancements to get done. Once implemented, it will be in the release notes in an upcoming release. I don’t currently have a timeframe for this unfortunately but I can say it is definitely something we want to get done and I’ve added you to the list of people requesting it :slight_smile:

1 Like

Thank you for this very valuable input. I have logged ticket to get this wording improved and to include examples as you suggest.

To answer the question itself, the flox CLI will batch up the count of the various subcommand invocations and only send batches at most once in an hour in a single curl invocation. The metric counts are accumulated in ~/.cache/flox/metrics-events.json by default if you want to have a look.

The actual event looks like this:

                        "event": "cli-invocation",
                        "timestamp": $now,
                        "uuid": "\($uuid)",
                        "properties": {
                                "distinct_id": "flox-cli:\($floxClientUUID)",
                                "$device_id": "flox-cli:\($floxClientUUID)",
                                "$lib": "flox-cli",
                                "subcommand": "\($subcommand)",
                                "$set": {
                                        "flox-cli-uuid": "\($floxClientUUID)"

… and:

  • $uuid is a per-event uuid
  • $floxClientUUID is a random uuid assigned on a per-user / per-home-directory basis at first use and never changes
  • $subcommand is the subcommand for a given invocation, e.g. flox list would have subcommand="list"

(The mentions of “$lib” and “$set” are literally the names of keys in our metrics tracking system, so don’t get confused by that.)

I confirm that the bugs in the initial message are also solved when using the .deb installation. Amazing that you are releasing such fixes this quickly!

Meanwhile I’ve tried some of the tutorials at and everything seems to working fine. I can finally try to understand what is this “flox thing”…

However one tutorial might not work in some cases:

If I clone GitHub - flox-examples/hello-python: flox nix expressions framework example Python project from master directly, then I get 404 errors:

pvieira@flox-demo:~/hello-python$ flox develop
error: unable to download '': HTTP error 404

       response body:

         "message": "Not Found",
         "documentation_url": ""
(use '--show-trace' to show detailed location information)

ERROR: cannot find attribute path - have you run 'flox init'?

warning: not writing modified lock file of flake 'git+file:///home/pvieira/hello-python':
• Updated input 'floxpkgs/nixpkgs/nixpkgs':
    follows 'floxpkgs/nixpkgs/nixpkgs-stable'
  → 'github:flox/nixpkgs/2788904d26dda6cfa1921c5abb7a2466ffe3cb8c' (2022-11-22)
error: unable to download '': HTTP error 404

       response body:

         "message": "Not Found",
         "documentation_url": ""
(use '--show-trace' to show detailed location information)

The problem seems to be related to flake.lock, which is now outdated.

This problem might also affect the other “hello-*” tutorials at flox-examples · GitHub , I haven’t checked.

1 Like

Thanks for fixing these so quickly. I’m not expecting bugs to get fixed in the weekend :slight_smile:

One small thing I notice:

flox install ripgrep
warning: You appear to have cloned an empty repository.
flox remove ripgrep
warning: remote HEAD refers to nonexistent ref, unable to checkout
removing 'flake:nixpkgs-flox#evalCatalog.x86_64-linux.stable.ripgrep'

It seems to work, but I’m not sure where the warnings about the repo come from?

Yes … that was more or less a consequence of fixing bugs on a weekend. :wink:

Version 0.0.7-r84 is out and fixes the bug, but will require that you reinitialize your local state. With that, please do the following:

  1. If you have locally-modified environments then invoke the following for each environment you would like to keep: flox push [ -e <environment> ]
  2. invoke: rm -rf ~/.cache/flox ~/.local/share/flox ~/.config/flox/ ~/.cache/nix
  3. invoke: sudo apt-get update && sudo apt-get upgrade
  4. if there are any environments you’d like to restore then invoke the following for each of them in turn: flox pull [ -e <environment> ]

Please let us know how that works out for you. Many thanks!

Hi @paulovieira - I just wanted to let you know we’re still discussing potential fixes for the issue you cited with the hello-python example and we’re planning to get a fix out later today. Thanks for being patient with us!

just a quick update regarding point 1) at the top of this thread about collecting basic usage metrics. We have now added an example as suggested to help clarify what data could be collected.
Thanks for the suggestion! :slight_smile: