comma icon indicating copy to clipboard operation
comma copied to clipboard

Comma tries to create a directory in /nix/store

Open PaulGrandperrin opened this issue 1 year ago • 8 comments

Hi, I'm running comma from nixos-23.05 and I get this error:

NIX_PATH= , distrobox                                                                                        
error: creating directory '/nix/store/849qs729ij1x7vg454851frzyb0riz5c-comma-with-db-1.6.0/share/cache/nix': Read-only file system

PaulGrandperrin avatar Sep 22 '23 16:09 PaulGrandperrin

comma doesn't create any directories.

The more appropriate repo to report this in should be nix-index but only if you've tested the newest version of nix-index, which you can do by using the flake in https://github.com/nix-community/nix-index-database which is where comma-with-db comes from.

Artturin avatar Sep 22 '23 23:09 Artturin

Cc @Mic92

Artturin avatar Sep 22 '23 23:09 Artturin

Does the error goes away if you set XDG_CACHE_HOME to some writable directory?

Mic92 avatar Sep 23 '23 16:09 Mic92

Hang on. This issue should get resolved when upgrading to nix-index 0.1.6: https://github.com/nix-community/nix-index-database/blob/9d2bcc47110b3b6217dfebd6761ba20bc78aedf2/nix-index-wrapper.nix#L24

Mic92 avatar Sep 23 '23 16:09 Mic92

Stable is on 0.1.5, so you would need to get it from unstable, backport it yourself or upgrade to nixos unstable.

Mic92 avatar Sep 23 '23 16:09 Mic92

Then https://github.com/nix-community/nix-index-database/blob/9d2bcc47110b3b6217dfebd6761ba20bc78aedf2/comma-wrapper.nix#L28 is wrong? And should be checking nix-index version

Artturin avatar Sep 23 '23 17:09 Artturin

This is the nix-index version: https://github.com/nix-community/nix-index-database/blob/9d2bcc47110b3b6217dfebd6761ba20bc78aedf2/comma-wrapper.nix#L25

Mic92 avatar Sep 23 '23 18:09 Mic92

This is what the wrapper looks like:

#! /nix/store/vqvj60h076bhqj6977caz0pfxs6543nb-bash-5.2-p15/bin/bash -e
export NIX_INDEX_DATABASE='/nix/store/mdpqxk0k4mgisd4p4r3haha4szk347kh-nix-index-with-db-0.1.7/share/cache/nix-index'
exec "/nix/store/g5w2prb7nml7kwvnn6572z3h8hq39cs8-nix-index-0.1.7/bin/nix-locate"  "$@" 

Mic92 avatar Sep 23 '23 18:09 Mic92