<teehemkay>
Hello. I'm repeatedly seeing the following error `cannot link '/nix/store/.tmp-link-46606-794821922' to '/nix/store/.links/0h0djvzb904ygckpvnblwanfz8fj4m7bv32js79b7z8p28s1nslz': File exists` whenever I try to rebuild and environment (`nix-darwin rebuild`). I need to issue the command several times (typically half a dozen times) until it finally succeeds.
<teehemkay>
I've looked into the `/nix/store/.links/` folder and it contains several hundred thousands files.
<teehemkay>
Is it safe to delete these files? Shouldn't there be some housekeeping to do that automatically?
<teehemkay>
Thanks!
<teehemkay>
To be clear, the error messages I'm seeing are a variation of the one above, not the same one repeatedly
<LnL>
those get generated by nix-store --optimize
<LnL>
not sure what could cause the issue you're describing however
__monty__ has joined #nix-darwin
__Sander__ has joined #nix-darwin
<teehemkay>
Thanks. Btw running `nix-store --optimise` I get a lot of `skipping suspicious writable file '/nix/store/<blablabla>' messages.
<__monty__>
I think I mentioned my issue about a usb pen drive with nothing but a `.gnupg` directory on it being impossible to eject here before?
<__monty__>
At the time I couldn't reproduce it. Figured a reboot fixed it?
<__monty__>
Well, it just happened again so nothing's fixed.
<cransom>
is there a gpg-agent process using it?
<__monty__>
Ooh, that might be the issue yeah. I did access it with `gpg --homedir`. I've never started a gpg-agent on purpose but maybe that's done transparently?
<clever>
__monty__: `ps aux | grep gpg`
<__monty__>
Yep, that must be it. After I use --edit-key a gpg-agent is started.
<__monty__>
What's the proper way to stop the agent? Kill it?
<clever>
not sure
<cransom>
you can just kill it
<cransom>
it's a gpg2 thing where it automatically starts one in order to do some privilege separation.
<__monty__>
Is there a way to make the gpg-agent give up the device automatically? finding the pid to kill is kind of an annoying extra step.
<cransom>
pkill gpg-agent is close enough for my uses usually. it should only ever run as your user anyway
<__monty__>
But the one for the .gnupg on my machine may be killed instead. Still requiring two extra steps.
<cransom>
gpg-agent with a --no-detach so you remember to kill it when done?
<__monty__>
But I don't start it explicitly so that's another extra step.
<__monty__>
I guess there's no better way : /
<evelyn>
gpgconf --kill all is the proper way to kill it
<evelyn>
there are other things it might start depending on how you've configured it
<evelyn>
e.g. scdaemon
<evelyn>
and that will only kill it for you. it won't touch other users'
<__monty__>
Maybe there's a better way to update offline keys than using `--homedir`? One that won't start all these things I then have to kill?
<cransom>
if anyone has any suggestions for something less fiddly than gpg, i'm all ears too.
<johnw>
error: path '/nix/store/000ghyr3m1n42mlsk6xagpjkiw722f4n-binutils-wrapper-2.31.1.drv' is not in the Nix store
<johnw>
that path most definitely *is* in the given path
<johnw>
s/path$/store
<LnL>
kind of sounds like a bug
<LnL>
can you copy a drv that way?
<johnw>
no
<johnw>
if I try to copy just that file, same error
<LnL>
the new protocol might work
<johnw>
what is that?
<johnw>
ssh-ng?
<LnL>
yeah
<johnw>
error: cannot open connection to remote store 'ssh-ng://hermes': changing owner of directory '/nix/var/nix/profiles/per-user/root': Operation not permitted
<johnw>
interesting
<LnL>
that one probably doesn't support the store query param
<johnw>
the place I'm trying to 'nix copy' to was created by running:
<johnw>
nix copy --all --to file:///path/nix on that machine
<johnw>
which worked, resulting in a directory full of narinfo files
<johnw>
so, there's no /store on /var subdirectories
<LnL>
ah it's a file:// store
<johnw>
yes
<johnw>
I want to use ssh to pipe stuff over to another store
<LnL>
not sure that's possible
<johnw>
sshfs maybe
<LnL>
store/state are the generic store options
<LnL>
only the legacy ssh implementation has the remote-store parameter
<johnw>
what I really want here is a way to cache all my store contents onto an external SSD, so that when I have poor Internet access and need to grab something I'd already grabbed in the recent past, it's easy to do
<LnL>
nix copy --to file:// to a mount will definitively work
<johnw>
right, but the machine which is building the majority of the things I want to cache, isn't that machine
<johnw>
so, before I take machine R and its SSD off for a trip, I want to update the SSD with the store from my main machine M
<johnw>
at the moment, Nix offers no good way to do this
<johnw>
I'll try sshfs
<LnL>
adding remote-store looks pretty easy at first glance
<LnL>
alternatively you could build something streaming on top of nix-store --dump <path> but that's kind of awkward
<clever>
LnL: have you seen local?root and store-uri=?