Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with page src/pages/start/3.nix-develop.mdx #370

Open
adamjsawicki opened this issue Sep 27, 2024 · 3 comments
Open

Issue with page src/pages/start/3.nix-develop.mdx #370

adamjsawicki opened this issue Sep 27, 2024 · 3 comments

Comments

@adamjsawicki
Copy link
Contributor

Hey everyone - ran into a small error on the above page.

As I was working my way through, I was unable to run the command in Beyond language-specific environments:

nix develop "https://flakehub.com/f/DeterminateSystems/zero-to-nix/*#multi"

I got the following error (forgive the blind copy paste - don't have enough context yet to know what I could leave out!):

error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:34:12:
           33|
           34|   strict = derivationStrict drvAttrs;
             |            ^
           35|

       … while evaluating derivation 'nix-shell'
         whose name attribute is located at /nix/store/qkzr5clkyq7j6n43qs5ff73in6c3wacv-source/pkgs/stdenv/generic/make-derivation.nix:333:7

       … while evaluating attribute 'nativeBuildInputs' of derivation 'nix-shell'
         at /nix/store/qkzr5clkyq7j6n43qs5ff73in6c3wacv-source/pkgs/stdenv/generic/make-derivation.nix:377:7:
          376|       depsBuildBuild              = elemAt (elemAt dependencies 0) 0;
          377|       nativeBuildInputs           = elemAt (elemAt dependencies 0) 1;
             |       ^
          378|       depsBuildTarget             = elemAt (elemAt dependencies 0) 2;

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: Package ‘terraform-1.8.3’ in /nix/store/qkzr5clkyq7j6n43qs5ff73in6c3wacv-source/pkgs/applications/networking/cluster/terraform/default.nix:52 has an unfree license (‘bsl11’), refusing to evaluate.

       a) To temporarily allow unfree packages, you can use an environment variable
          for a single invocation of the nix tools.

            $ export NIXPKGS_ALLOW_UNFREE=1

          Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,
                then pass `--impure` in order to allow use of environment variables.

       b) For `nixos-rebuild` you can set
         { nixpkgs.config.allowUnfree = true; }
       in configuration.nix to override this.

       Alternatively you can configure a predicate to allow specific packages:
         { nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
             "terraform"
           ];
         }

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
         { allowUnfree = true; }
       to ~/.config/nixpkgs/config.nix.

Happy to send over any relevant details / system information, but the tutorial was my introduction to Nix, so followed download + setup instructions as it was presented here. Some high level sys details:

> nix --version
nix (Nix) 2.24.6

> cat /etc/os-release
PRETTY_NAME="Ubuntu 24.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.1 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
...

> uname -m
x64_64

Also, I run fish shell - not sure if that makes a difference.

@dontdieych
Copy link

Same here.

NIXPKGS_ALLOW_UNFREE=1 and ~/.config/nixpkgs/config.nix does not effect too.

Asahilinux, fish shell, rebooted after install nix.

❯ nix --version
nix (Nix) 2.24.9

❯ env|rg nix
SESSION_MANAGER=local/unix:@/tmp/.ICE-unix/2201,unix/unix:/tmp/.ICE-unix/2201
NIX_PROFILES=/nix/var/nix/profiles/default /home/a/.nix-profile
NIX_SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
XDG_DATA_DIRS=/home/a/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/home/a/.nix-profile/share:/nix/var/nix/profiles/default/share:/nix/var/nix/profiles/default/share:/nix/var/nix/profiles/default/share
DOCKER_HOST=unix:///run/user/1000/podman/podman.sock
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
PATH=/nix/var/nix/profiles/default/bin:/home/a/.ghcup/bin:/home/a/bin:/home/a/.bun/bin:/home/a/.deno/bin:/usr/local/go/bin:/home/a/.config/emacs/bin:/home/a/.config/fish/conf.d/jq_repl_bin:/home/a/git-clone/wiwinwlh:/home/a/.cabal/bin:/home/a/.radicle/bin:/home/a/.local/bin:/home/a/.cargo/bin:/home/a/perl5/bin:/home/a/perl5/bin:/home/a/.nvm/versions/node/v22.9.0/bin:/home/a/.config/guix/current/bin:/home/a/.nix-profile/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
NIXPKGS_ALLOW_UNFREE=1

@zalom
Copy link

zalom commented Oct 26, 2024

Same here

❯ nix --version
nix (Nix) 2.24.9

❯ echo $0
/bin/zsh

❯ sw_vers
ProductName:            macOS
ProductVersion:         15.0.1
BuildVersion:           24A348

❯ uname -m
arm64
Trace
NIXPKGS_ALLOW_UNFREE=1 nix develop "https://flakehub.com/f/DeterminateSystems/zero-to-nix/*#multi" --show-trace
error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:34:12:
           33|
           34|   strict = derivationStrict drvAttrs;
             |            ^
           35|

       … while evaluating derivation 'nix-shell'
         whose name attribute is located at /nix/store/qkzr5clkyq7j6n43qs5ff73in6c3wacv-source/pkgs/stdenv/generic/make-derivation.nix:333:7while evaluating attribute 'nativeBuildInputs' of derivation 'nix-shell'
         at /nix/store/qkzr5clkyq7j6n43qs5ff73in6c3wacv-source/pkgs/stdenv/generic/make-derivation.nix:377:7:
          376|       depsBuildBuild              = elemAt (elemAt dependencies 0) 0;
          377|       nativeBuildInputs           = elemAt (elemAt dependencies 0) 1;
             |       ^
          378|       depsBuildTarget             = elemAt (elemAt dependencies 0) 2;in the condition of the assert statement
         at /nix/store/qkzr5clkyq7j6n43qs5ff73in6c3wacv-source/lib/customisation.nix:352:23:
          351|             drvPath = assert condition; drv.${outputName}.drvPath;
          352|             outPath = assert condition; drv.${outputName}.outPath;
             |                       ^
          353|           } //while evaluating the attribute 'handled'
         at /nix/store/qkzr5clkyq7j6n43qs5ff73in6c3wacv-source/pkgs/stdenv/generic/check-meta.nix:507:7:
          506|       # or, alternatively, just output a warning message.
          507|       handled =
             |       ^
          508|         (from call site
         at /nix/store/qkzr5clkyq7j6n43qs5ff73in6c3wacv-source/pkgs/stdenv/generic/check-meta.nix:511:13:
          510|           else if valid == "no" then (
          511|             handleEvalIssue { inherit meta attrs; } { inherit (validity) reason errormsg; }
             |             ^
          512|           )while calling 'handleEvalIssue'
         at /nix/store/qkzr5clkyq7j6n43qs5ff73in6c3wacv-source/pkgs/stdenv/generic/check-meta.nix:269:38:
          268|
          269|   handleEvalIssue = { meta, attrs }: { reason , errormsg ? "" }:
             |                                      ^
          270|     letwhile calling the 'throw' builtin
         at /nix/store/qkzr5clkyq7j6n43qs5ff73in6c3wacv-source/pkgs/stdenv/generic/check-meta.nix:281:8:
          280|         else throw;
          281|     in handler msg;
             |        ^
          282|

       error: Packageterraform-1.8.3in /nix/store/qkzr5clkyq7j6n43qs5ff73in6c3wacv-source/pkgs/applications/networking/cluster/terraform/defaul

       a) To temporarily allow unfree packages, you can use an environment variable
          for a single invocation of the nix tools.

            $ export NIXPKGS_ALLOW_UNFREE=1

          Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,
                then pass `--impure` in order to allow use of environment variables.

       b) For `nixos-rebuild` you can set
         { nixpkgs.config.allowUnfree = true; }
       in configuration.nix to override this.

       Alternatively you can configure a predicate to allow specific packages:
         { nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
             "terraform"
           ];
         }

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
         { allowUnfree = true; }
       to ~/.config/nixpkgs/config.nix.

@zalom
Copy link

zalom commented Oct 26, 2024

Hi @lucperkins, can you please check this when convenient?

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

No branches or pull requests

3 participants