Skip to content

.envrc: don't enable flakes extra-experimental-feature#3777

Closed
flokli wants to merge 1 commit intodevelopfrom
no-flakes
Closed

.envrc: don't enable flakes extra-experimental-feature#3777
flokli wants to merge 1 commit intodevelopfrom
no-flakes

Conversation

@flokli
Copy link
Contributor

@flokli flokli commented Dec 13, 2023

There's nothing in this repository using flakes, and setting this causes my system to just block entirely:

❯ cd dev/wire/wire-server
direnv: error /home/flokli/dev/wire/wire-server/.envrc is blocked. Run `direnv allow` to approve its content
❯ direnv allow
direnv: loading ~/dev/wire/wire-server/.envrc
🔧 Building environment
warning: unknown experimental feature 'flakes'
warning: unknown experimental feature 'flakes'
⏱ 4sdirenv: ([/nix/store/0lf6mkfaqx4zmsni9yys650qx573zfcw-direnv-2.33.0/bin/direnv export zsh]) is taking a while to execute. Use CTRL-C to give up.
⏱ 8s^C
^C^X^C^C^C

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@flokli flokli requested a review from MangoIV December 13, 2023 14:31
@flokli flokli mentioned this pull request Dec 13, 2023
1 task
@smatting
Copy link
Contributor

Yes, we are using flakes here github:wireapp/ghc-flakr. But since we don't use ghc-flakr and we haven't decided if we want to use it, let's maybe remove it?

@MangoIV
Copy link
Contributor

MangoIV commented Dec 13, 2023

This was requested by @elland to make using hs-run easier (it uses flakes).

@MangoIV
Copy link
Contributor

MangoIV commented Dec 13, 2023

I guess if you get stuck, it would be better to remove it from the envrc altogether and load it only on demand?

@flokli
Copy link
Contributor Author

flokli commented Dec 13, 2023

There's a single occurence in the hack/bin/bombon.hs shell script, which uses nix run:

1:#!/usr/bin/env -S nix -Lv run github:wireapp/ghc-flakr/ecb1f45f1549e06c92d71164e305ce501eb0e36e

@elland could you (and everyone invoking hack/bin/bombon.hs enable this on your system-wide config?

@MangoIV
Copy link
Contributor

MangoIV commented Dec 13, 2023

I think it's easier to not have it automatically load in wire-server and instead just use it explicitly in a devShell or in the shebang and then pass the argument along, if you don't have the feature enabled?

@flokli
Copy link
Contributor Author

flokli commented Dec 13, 2023

Good point, lemme just update this PR to change the shebang.

@MangoIV
Copy link
Contributor

MangoIV commented Dec 13, 2023

@flokli do you have some special setup that flakes feature makes you get stuck? I don't think it should have any effect as long as it's not used...

There's nothing in this repository using flakes, and setting this causes
my system to just block entirely:

```
❯ cd dev/wire/wire-server
direnv: error /home/flokli/dev/wire/wire-server/.envrc is blocked. Run `direnv allow` to approve its content
❯ direnv allow
direnv: loading ~/dev/wire/wire-server/.envrc
🔧 Building environment
warning: unknown experimental feature 'flakes'
warning: unknown experimental feature 'flakes'
⏱ 4sdirenv: ([/nix/store/0lf6mkfaqx4zmsni9yys650qx573zfcw-direnv-2.33.0/bin/direnv export zsh]) is taking a while to execute. Use CTRL-C to give up.
⏱ 8s^C
^C^X^C^C^C
```
@flokli
Copy link
Contributor Author

flokli commented Dec 13, 2023

I assume Nix behaves a bit stupidly if it encounters an experimental feature it doesn't know about, or nom does, but yes, I do have some patches, and my Nix doesn't know about the flakes experimental feature.

However, I also think we should only be adding stuff we actually need. I moved the invocation to the shebang in hack/bin/bombon.hs (which I can't test by myself).

I'd argue this script could also be rewritten in bash, saving us a bunch of startup to evaluate nixpkgs, compile the binary and haskell interpreter. The only thing it does is invoking nix build -f nix wireServer.allLocalPackagesBom (which could also be rewritten to nix-build nix -A wireServer.allLocalPackagesBom), and trhen invoke the gh binary - but I lack context on this script and it's a bit too far out of scope for this PR, which does the minimal thing - unblocking my shell while hopefully not breaking someone others' workflow ;-)

@MangoIV
Copy link
Contributor

MangoIV commented Dec 13, 2023

yeah, the script is a proof of concept.

@flokli
Copy link
Contributor Author

flokli commented Dec 13, 2023

closing in favor of #3778.

@flokli flokli closed this Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants