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

Use nmt and nmd from Nixpkgs #4884

Merged
merged 2 commits into from
Jan 14, 2024
Merged

Use nmt and nmd from Nixpkgs #4884

merged 2 commits into from
Jan 14, 2024

Conversation

rycee
Copy link
Member

@rycee rycee commented Jan 12, 2024

Description

Fixes #4879

Depends on NixOS/nixpkgs#280467 being in NixOS unstable.

Checklist

  • Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all or nix develop --ignore-environment .#all using Flakes.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

@rycee rycee merged commit 846200e into master Jan 14, 2024
3 checks passed
@rycee rycee deleted the use-nixpkgs-nmt-nmd branch January 14, 2024 22:58
@oxalica
Copy link
Contributor

oxalica commented Jan 15, 2024

This makes it IFD again, isn't it? Should I open a new issue?

error:
       … while calling the 'head' builtin

         at /nix/store/b0l3v8509hrl3qbv6fj2zl0mjb2rwhdy-source/lib/attrsets.nix:960:11:

          959|         || pred here (elemAt values 1) (head values) then
          960|           head values
             |           ^
          961|         else

       … while evaluating the attribute 'value'

         at /nix/store/b0l3v8509hrl3qbv6fj2zl0mjb2rwhdy-source/lib/modules.nix:809:9:

          808|     in warnDeprecation opt //
          809|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          810|         inherit (res.defsFinal') highestPrio;

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

       error: cannot build '/nix/store/yachqrw4zahp0b2qg9d8gz5kl59xr809-nix-lib-nmd-0.5.0.drv^out' during evaluation because the option 'allow-import-from-derivation' is disabled

@rycee
Copy link
Member Author

rycee commented Jan 15, 2024

@oxalica Hmm, not sure. It works fine without --impure so I would have assumed there is no problem. In any case PRs are welcome to improve the situation.

@rycee
Copy link
Member Author

rycee commented Jan 15, 2024

Would it work if the packages were fixed-output derivations? It should be possible to fix their output since they don't really have any dependencies.

@rycee
Copy link
Member Author

rycee commented Jan 15, 2024

See NixOS/nixpkgs#281111. Hopefully that would fix this issue.

@iphydf
Copy link

iphydf commented Jan 18, 2024

https://discourse.nixos.org/t/is-nix-lib-nmd-missing-from-23-11/38268

In my dev container, to reduce disk space, I use the 23.11 tag, not the updated channel. This means that now home-manager has to be pinned at the commit before this one. I'd say it's a little surprising that "release-23.11" is not compatible with nixos tag 23.11. I tend to think we should be backwards compatible at least for half a year (one release cadence).

@rycee
Copy link
Member Author

rycee commented Jan 18, 2024

@iphydf I definitely would suggest not pinning to the 23.11 tag, it will never be updated, even for security reasons. I would instead suggest pinning to a suitable commit hash along the history of the 23.11 channel and occasionally consider updating the pin.

That said, if there is a big demand for it, then we could revert the HM 23.11 branch back to using the Sourcehut source since it is available again.

@lovesegfault
Copy link
Contributor

I'm still seeing IFD errors, even with the latest nixos-unstable which includes NixOS/nixpkgs#281111:

github:lovesegfault/nix-config/eec1fe759743d9ef3508f509c82deddf418bd316
├───checks
│   ├───aarch64-darwin
│   │   └───pre-commit-check omitted (use '--all-systems' to show)
│   ├───aarch64-linux
│   │   └───pre-commit-check omitted (use '--all-systems' to show)
│   ├───x86_64-darwin
│   │   └───pre-commit-check omitted (use '--all-systems' to show)
│   └───x86_64-linux
│       └───pre-commit-check: derivation 'pre-commit-run'
├───darwinConfigurations: unknown
├───deploy: unknown
├───devShells
│   ├───aarch64-darwin
│   │   └───default omitted (use '--all-systems' to show)
│   ├───aarch64-linux
│   │   └───default omitted (use '--all-systems' to show)
│   ├───x86_64-darwin
│   │   └───default omitted (use '--all-systems' to show)
│   └───x86_64-linux
│       └───default: development environment 'nix-config'
├───homeConfigurations: unknown
├───hosts: unknown
├───nixosConfigurations
│   ├───aurelius: NixOS configuration
│   ├───bohr: NixOS configuration
│   ├───fourier: NixOS configuration
│   ├───hegel: NixOS configuration
│   ├───jung: NixOS configuration
│   ├───nozick: NixOS configuration
│   ├───riemann: NixOS configuration
│   └───spinoza: NixOS configuration
├───overlays
│   ├───default: Nixpkgs overlay
│   ├───scripts: Nixpkgs overlay
│   ├───sway-scene-graph: Nixpkgs overlay
│   ├───truecolor-check: Nixpkgs overlay
│   ├───uboot-cm4: Nixpkgs overlay
│   └───vim-plugins: Nixpkgs overlay
├───packages
│   ├───aarch64-darwin
│   │   ├───cachix omitted (use '--all-systems' to show)
│   │   ├───default omitted (use '--all-systems' to show)
│   │   ├───nix-eval-jobs omitted (use '--all-systems' to show)
│   │   ├───nix-fast-build omitted (use '--all-systems' to show)
│   │   └───poincare omitted (use '--all-systems' to show)
│   ├───aarch64-linux
│   │   ├───aurelius omitted (use '--all-systems' to show)
│   │   ├───cachix omitted (use '--all-systems' to show)
│   │   ├───default omitted (use '--all-systems' to show)
│   │   ├───luther omitted (use '--all-systems' to show)
│   │   ├───nix-eval-jobs omitted (use '--all-systems' to show)
│   │   ├───nix-fast-build omitted (use '--all-systems' to show)
│   │   └───riemann omitted (use '--all-systems' to show)
│   ├───x86_64-darwin
│   │   ├───cachix omitted (use '--all-systems' to show)
│   │   ├───nix-eval-jobs omitted (use '--all-systems' to show)
│   │   └───nix-fast-build omitted (use '--all-systems' to show)
│   └───x86_64-linux
error:
       … while calling the 'head' builtin

         at /nix/store/wcidiyklj0nrljlz5m3qlkvhv8f2ddv8-source/lib/attrsets.nix:960:11:

          959|         || pred here (elemAt values 1) (head values) then
          960|           head values
             |           ^
          961|         else

       … while evaluating the attribute 'value'

         at /nix/store/wcidiyklj0nrljlz5m3qlkvhv8f2ddv8-source/lib/modules.nix:809:9:

          808|     in warnDeprecation opt //
          809|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          810|         inherit (res.defsFinal') highestPrio;

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

       error: cannot build '/nix/store/flv4m459a0wml9377yr5ckyrhc1d37sx-nix-lib-nmd-0.5.0.drv^out' during evaluation because the option 'allow-import-from-derivation' is disabled

Curiously, this only happens when I eval on my x86_64-linux and aarch64-linux machines, on aarch64-darwin it works AOK.

@iphydf
Copy link

iphydf commented Jan 18, 2024

I'll pin the commit hash. It's not super important to be up to date because it's only used for integration tests and our local dev environment, not for releases, but I think using commit hashes will work for us.

rycee added a commit that referenced this pull request Jan 18, 2024
Turns out pulling nmt and nmd from Nixpkgs causes an IFD, even when
the packages are fixed-output derivations.

Thus, since Sourcehut is up and well, we can revert to simply fetching
nmd and nmt directly.

See discussion in <#4884>.
@rycee
Copy link
Member Author

rycee commented Jan 18, 2024

Ok, I've opened the above PR to restore the use of fetchTarball for nmd and nmt. Since Sourcehut is available again, I figure it should be safe to switch back.

rycee added a commit that referenced this pull request Jan 19, 2024
Turns out pulling nmt and nmd from Nixpkgs causes an IFD, even when
the packages are fixed-output derivations.

Thus, since Sourcehut is up and well, we can revert to simply fetching
nmd and nmt directly.

See discussion in <#4884>.

(cherry picked from commit d6185e8)
@oxalica
Copy link
Contributor

oxalica commented Jan 19, 2024

Ok, I've opened the above PR to restore the use of fetchTarball for nmd and nmt. Since Sourcehut is available again, I figure it should be safe to switch back.

I've seen the regression several times. Would it be better to add a CI task to build with --option allow-import-from-derivation false so we can catch it early?

fufexan pushed a commit to fufexan/home-manager that referenced this pull request Feb 24, 2024
Turns out pulling nmt and nmd from Nixpkgs causes an IFD, even when
the packages are fixed-output derivations.

Thus, since Sourcehut is up and well, we can revert to simply fetching
nmd and nmt directly.

See discussion in <nix-community#4884>.
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.

bug: download of nmd fails, because https://git.sr.ht/ is down
4 participants