Running devenv shell in Ubuntu server displays the error: attribute 'configPath' missing

(#378) Bug Fixed self-hosting

Summary

I have an Ubuntu server running and I am so close to getting Fluxer working but I am getting this error.
devenv up
✓ Configuring shell                                                                                                          8.8s
  └ ✓ Evaluating Nix 1144 files                                                                                             542ms
  └ ✗ Evaluating shell 3773 files                                                                                            5.2s
Error:   × Evaluation error: Failed to get drvPath from shell derivation:
  │        … while calling the 'derivationStrict' builtin
  │          at «nix-internal»/derivation-internal.nix:37:12:
  │            36|
  │            37|   strict = derivationStrict drvAttrs;
  │              |            ^
  │            38|
  │
  │
  │        … while evaluating derivation 'devenv-shell'
  │          whose name attribute is located at /nix/store/kkx2hzq20ggrwhy385jglnxjncg4lqck-source/pkgs/stdenv/generic/make-
  │ derivation.nix:536:13
  │
  │        … while evaluating attribute 'shellHook' of derivation 'devenv-shell'
  │          at /nix/store/kkx2hzq20ggrwhy385jglnxjncg4lqck-source/pkgs/build-support/mkshell/default.nix:44:7:
  │            43|
  │            44|       shellHook = lib.concatStringsSep "\n" (
  │              |       ^
  │            45|         lib.catAttrs "shellHook" (lib.reverseList inputsFrom ++ [ attrs ])
  │
  │
  │        … while evaluating the option `enterShell':
  │
  │        … while evaluating definitions from `/nix/store/w5nb8i03xljf9xl5myr5xlgy199x86kl-source/src/modules/integrations/git-
  │ hooks.nix':
  │
  │        (stack trace truncated; use '--show-trace' to show the full, detailed trace)
  │
  │
  │        at /nix/store/w5nb8i03xljf9xl5myr5xlgy199x86kl-source/src/modules/integrations/git-hooks.nix:126:47:
  │           125|         if [ -z "$configFile" ]; then
  │           126|           configFile='${config.devenv.root}/${cfg.configPath}'
  │              |                                               ^
  │           127|         fi
  │
  │        error: attribute 'configPath' missing

Steps to reproduce

  1. git clone https://github.com/fluxerapp/fluxer.git
  2. cd fluxer/
  3. devenv shell

5 comments

Sign in with Fluxer to comment and vote.
Comment by @Raviexthegod
RexSystem 1 vote originally by @Raviexthegod on GitHub
The issue is that there isn't a state-file, so it tries to fall back on the current config but cfg.configPath isn't defined, and so it errors out at the undefined variable. For anyone who already had a working devenv would have a state-file, and thus wouldn't run into this issue as they would exit the if statement at the state-file existing.
Comment by @fr0lnx
RexSystem 1 vote originally by @fr0lnx on GitHub
I fixed it temporary by adding git-hooks.configPath = ".git/hooks"; to ``devenv.nix.
Comment by @maxhille
RexSystem 1 vote originally by @maxhille on GitHub
I took a look into this issue and decided to upgrade devenv to the new major version (the lines which cause the exception are not there anymore in devenv 2.x). So it seems to be running all the processes as intended but the frontend will say "cannot connect / try again" which might very well be an unrelated CORS or TLS issue. I would love to start a PR, but this repo does not allow outsider PRs. In case someone wants to try it out, here is the commit: https://github.com/fluxerapp/fluxer/commit/2af1d34c711c2dd312046ea20755c0f8b0daabc2
Comment by @migdall
RexSystem 1 vote originally by @migdall on GitHub OP
Thank you everyone replying with your answers. I added the temporary fix to the devenv.nix file
diff --git a/devenv.nix b/devenv.nix
index 885bc98c..4ab51010 100644
--- a/devenv.nix
+++ b/devenv.nix
@@ -251,4 +251,5 @@
                        exec nats-server -p 4223 -js -sd ${config.git.root}/dev/data/nats_jetstream -a 127.0.0.1
                '';
        };
+       git-hooks.configPath = ".git/hooks";
 }
I ran devenv shell and got past the error.