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

bug: mkPackageOption has unexpected argument extraDescription #4119

Closed
2 tasks done
grabango-thampton opened this issue Jun 19, 2023 · 3 comments
Closed
2 tasks done
Assignees
Labels
bug triage Issues or feature request that have not been triaged yet

Comments

@grabango-thampton
Copy link

grabango-thampton commented Jun 19, 2023

Are you following the right branch?

  • My Nixpkgs and Home Manager versions are in sync

Is there an existing issue for this?

  • I have searched the existing issues

Issue description

MacOS home-manager seems to be broken for SSH:

tyler@N326CYL79K ~ [SIGINT]> nix-channel --update
this derivation will be built:
  /nix/store/bdfy4kk5hmigvxg7g3hyyjw907nfzrj3-darwin.drv
building '/nix/store/bdfy4kk5hmigvxg7g3hyyjw907nfzrj3-darwin.drv'...
this derivation will be built:
  /nix/store/lkq6fbi3mswcc5zdh19d4qpgabxqjap1-home-manager.drv
building '/nix/store/lkq6fbi3mswcc5zdh19d4qpgabxqjap1-home-manager.drv'...
unpacking channels...


tyler@N326CYL79K ~> home-manager switch
error: 'mkPackageOption' at /nix/store/nd1za9j09vrdfp1r5576v8wfnxsgzal0-nixpkgs/nixpkgs/lib/options.nix:136:7 called with unexpected argument 'extraDescription'

       at /Users/tyler/.nix-defexpr/channels/home-manager/modules/programs/ssh.nix:364:15:

          363|
          364|     package = mkPackageOption pkgs "openssh" {
             |               ^
          365|       nullable = true;
(use '--show-trace' to show detailed location information)


tyler@N326CYL79K ~ [1]> nix-channel --list
darwin https://github.com/LnL7/nix-darwin/archive/master.tar.gz
home-manager https://github.com/nix-community/home-manager/archive/master.tar.gz
nixos-unstable https://nixos.org/channels/nixos-unstable
nixpkgs-unstable https://nixos.org/channels/nixpkgs-unstable

This has been going on for, I dunno, a month.

Maintainer CC

No response

System information

tyler@N326CYL79K ~> nix-shell -p nix-info --run "nix-info -m"
 - system: `"aarch64-darwin"`
 - host os: `Darwin 22.4.0, macOS 13.3.1`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.11.0`
 - channels(tyler): `"darwin, home-manager, nixos-unstable, nixpkgs-unstable"`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
@grabango-thampton grabango-thampton added bug triage Issues or feature request that have not been triaged yet labels Jun 19, 2023
@ncfavier
Copy link
Member

That argument to mkPackageOption was added in NixOS/nixpkgs@9769e90 and is present in nixpkgs 23.05 and master.

At a glance I'd say your actual nixpkgs channel is the one owned by root, which you're not updating.

@grabango-thampton
Copy link
Author

I just went insane.

At a glance I'd say your actual nixpkgs channel is the one owned by root, which you're not updating.

I wasn't actually sure how to fix this because I don't know where channel data is stored or how Nix determines which user's channel to use when it's called... but I ended up nuking Nix and reinstalling from scratch. If a channel is owned by root how do you get it to be owned by your user on MacOS?

Before nuking, I tried deleting all the channels with nix-channel --remove nixpkgs-unstable and then readding all of them. This didn't work.

I tried chowning random directories to my user but that didn't work either. I wasn't sure what I was supposed to chown because there are a billion directories related to Nix. Is it somewhere in the nix store? Is it /var/root/.nix-*? Who knows.

So I ended up doing a sudo rm -rf /var/root/.nix-channels /var/root/nix-defexpr /var/root/.nix-profile - keeping my user's nix directories intact in order to prep for a reinstall. I don't know if this caused me more problems.

So, anyway, then I did sh <(curl -L https://nixos.org/nix/install) to get Nix back. The install broke twice, leading me to these bugs:

After I had installed Nix, adding the home-manager failed because of this bug: NixOS/nix#876

I... think another reboot fixed this. Can't remember. I had to reboot several times during the installation process to resolve issues.

After getting channels to work I ran into this bug: #3734

Supposedly this is fixed in home-manager but I ran into it anyway. I fixed it by running sudo mkdir -p /nix/var/nix/profiles/per-user/tyler/ and then chowning that directory to my user.

After all that I got home-manager and Nix to work again. However, I'm migrating everything back to shell scripts and homebrew now.

I'm not even sure how this broke, to be honest. None of my configuration changed. I'm thinking maybe I accidentally ran a Nix command with sudo - this is entirely possible because I use NixOS on my homelab and my personal laptop and so it's reflex to use sudo with Nix to do state changes.

@ncfavier
Copy link
Member

Sounds like a nightmare!

Nix uses and manipulates channels for the user invoking it. So if you use sudo it uses root channels, otherwise your user's. I don't think you can transfer channels from one user to another.

I don't think there's anything in particular to be done on this issue, so I'm going to close it. Sorry you had such a bad experience!

@ncfavier ncfavier closed this as not planned Won't fix, can't repro, duplicate, stale Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triage Issues or feature request that have not been triaged yet
Projects
None yet
Development

No branches or pull requests

5 participants