cachix / devenv

Fast, Declarative, Reproducible, and Composable Developer Environments
https://devenv.sh
Apache License 2.0
3.56k stars 259 forks source link

`devenv gc` broken on MacOS ? #118

Closed gotcha closed 1 year ago

gotcha commented 1 year ago

When running devenv gc, I get the following error and output:


Counting old devenvs ...

error: flake 'path:/Users/gotcha/tmp/bad-devenv-gc' does not provide attribute 'packages.x86_64-darwin.default' or 'defaultPackage.x86_64-darwin'
/Users/gotcha/.nix-profile/bin/devenv: line 160: / 1024 / 1024 : syntax error: operand expected (error token is "/ 1024 / 1024 ")```
domenkozar commented 1 year ago

What are the steps to reproduce this?

gotcha commented 1 year ago

I installed devenv via

nix profile install nixpkgs#cachix
cachix use devenv
nix profile install github:cachix/devenv/v0.3

Steps to reproduce:

domenkozar commented 1 year ago

@sandydoo could you test this?

domenkozar commented 1 year ago

Do you have M1 macos?

domenkozar commented 1 year ago

Can you paste /etc/nix/nix.conf?

gotcha commented 1 year ago

Do you have M1 macos?

Nope

gotcha commented 1 year ago

Can you paste /etc/nix/nix.conf?

build-users-group = nixbld
trusted-users = root gotcha
gotcha commented 1 year ago

I updated to 0.4 and get the very similar error:

✦2 ❯ devenv gc
Counting old devenvs ...

error: flake 'path:/Users/gotcha/tmp/test-devenv-0.4' does not provide attribute 'packages.x86_64-darwin.default' or 'defaultPackage.x86_64-darwin'
/Users/gotcha/.nix-profile/bin/devenv: line 156: / 1024 / 1024 : syntax error: operand expected (error token is "/ 1024 / 1024 ")
shyim commented 1 year ago

Works on my m1. It's an x86 issue or something with your used devenv.nix

domenkozar commented 1 year ago

Could you try using the latest main branch?

https://github.com/cachix/devenv/commit/93b562bd8706d1d5bb330c25be7ca780ddadbb8c might have fixed it.

gotcha commented 1 year ago

@domenkozar Happy to test it. But I have no idea how to use the main branch ?

domenkozar commented 1 year ago

nix profile install github:cachix/devenv/main

gotcha commented 1 year ago

Not solved. This is what I did:

$ nix profile install github:cachix/devenv/main
$ mkdir bla
$ cd bla
$ devenv init
$ devenv gc
domenkozar commented 1 year ago

Had a call with @gotcha and it seems to be resolved, if it comes back let me know.