11 Jul 2025 |
dramforever | if it's something you want to change in system nix then of course you have to replace system nix | 15:52:59 |
@m4dc4pxx:matrix.org | On MacOS is that my only option when I want to run a build with my modified binary? | 15:57:10 |
@m4dc4pxx:matrix.org | (I'm trying to improve AWS error handling w/ S3 caches FWIW, particularly around expired tokens) | 15:58:09 |
dramforever | if you just want to test it, you can look into how existing tests work | 16:01:41 |
dramforever | i'm not sure if there's anything network in it | 16:01:55 |
dramforever | but there's some scripts that create a local store just for testing purposes | 16:02:09 |
@m4dc4pxx:matrix.org | Well I need to interact with AWS w/ an expired token to see the behavior. I don't imagine the existing tests are gonna help much, even if they are mocking AWS. | 16:04:44 |
dramforever | the existing tests handle building in a local store part | 16:05:05 |
dramforever | oh | 16:05:07 |
dramforever | by local i mean separate | 16:05:11 |
dramforever | it doesn't touch the system nix | 16:05:15 |
@m4dc4pxx:matrix.org | Easiest (for me) would be running the nix binary I built w/ extra logging against real AWS | 16:05:21 |
dramforever | so it would sidestep the problem of having to change your system nix | 16:06:01 |
dramforever | it can even test a separate store with daemon and client | 16:06:16 |
@m4dc4pxx:matrix.org | Any particular script you could suggest? There are a lot in that directory. | 16:07:00 |
dramforever | start at common.sh and look at the few it sources | 16:09:45 |
dramforever | * start at common.sh and look at the few scripts it sources | 16:09:49 |
dramforever | or just add your own test script | 16:09:53 |
dramforever | most important is probably common/vars.sh , which sets a bunch of NIX_*_DIR environment variables | 16:13:43 |
dramforever | so it redirects everything away from the system store and configs and stuff | 16:13:57 |
@m4dc4pxx:matrix.org | In common/functions I found startDaemon ; from that it seems setting NIX_DAEMON_SOCKET_PATH to something in my local dir, then running nix daemon (in same shell), gets me further. Thanks for pointer! | 16:23:12 |
dramforever | ah yes, that would help if you need a daemon | 16:25:00 |
dramforever | you got it | 16:25:06 |
@m4dc4pxx:matrix.org | Unfortunately, running nix-instantiate seems to lead some sort of fork bomb where thousands of nix processes spawn. 🤔 | 16:27:26 |
dramforever | maybe you don't need a daemon? | 16:29:17 |
@m4dc4pxx:matrix.org | See previous posting :)
Hello! I'm trying to do some nix hacking on macos. I've built nix successfully, but my changes aren't showing up when I run the binary. (I've added logging I'm pretty sure I should see, and its not there.) I suspect its because my system nix uses the multi-user setup and the daemon is not running the binary I built. Is there any solution besides replacing the system nix? Or am I looking in the wrong direction? Appreciate any help!
| 16:30:35 |
dramforever | i'm not sure if you need a daemon... | 16:31:18 |
@m4dc4pxx:matrix.org | I don't want a daemon but I don't know if I have a choice. Previously, running nix-instantiate seemed to defer to the system daemon and did not produce the output I expected. | 16:31:23 |
dramforever | i just tried NIX_STORE_DIR=$(pwd)/meow/store NIX_STATE_DIR=$(pwd)/meow/var nix-instantiate --option store local . -A hello | 16:32:30 |
dramforever | this works, but i'm also on linux | 16:32:37 |