Error upgrading to or building nix-channel 21.11

Hi Everyone
This is my first post on NixOS discourse.
While upgrading channel to nixos-21.11, getting error as below

~ took 35s
❯ sudo nix-channel --add https://nixos.org/channels/nixos-21.11 nixos                                             ~

~
❯ sudo nixos-rebuild build --upgrade                                                                              ~
unpacking channels...
building Nix...
building the system configuration...
error: pynacl-1.4.0 not supported for interpreter python2.7
(use '--show-trace' to show detailed location information)

~ took 7s
❯ sudo nix-channel --list                                                                                         ~
nixos https://nixos.org/channels/nixos-21.11

I am happy to share more information
Thanks !!

Posting my nixos config

# Edit this configuration file to define what should be installed on
# your system.  Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).

{ config, pkgs, ... }:

{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
    ];
  
  # Use the systemd-boot EFI boot loader.
    boot.loader.systemd-boot.enable = true;
    boot.loader.efi.canTouchEfiVariables = true;
  # boot loader timeout, null will never timeout 
    boot.loader.timeout = 120;

  # Kernel modules for hardware devices are generally loaded automatically by udev
  # You can force a module to be loaded via boot.kernelModules
    boot.kernelModules = [ "fuse" ];
    boot.supportedFilesystems = [ "ntfs" ];

  # Filesystems

   fileSystems."/xmnt/Bravo" =
    { device = "/dev/disk/by-label/Bravo";
      fsType = "ntfs"; 
      options = [ "ro" "nosuid" "nodev" "noexec" "nofail" "uid=1000" "gid=100" "dmask=0022" "fmask=0033"];
    };

   fileSystems."/xmnt/Alpha" =
    { device = "/dev/disk/by-label/Alpha";
      fsType = "ext4"; 
      options = [ "rw" "nosuid" "nodev" "noexec" "nofail" ];
    };

   fileSystems."/xmnt/Charlie" =
    { device = "/dev/disk/by-label/Charlie";
      fsType = "ext4"; 
      options = [ "rw" "nosuid" "nodev" "noexec" "nofail" ];
    };

  # Allow unfree packages
    nixpkgs.config.allowUnfree = true;

  # Set your time zone.
    time.timeZone = "Asia/Kolkata";
  # System clock might be incorrect after booting Windows and going back to the NixOS. 
  # It can be fixed by either setting RTC time standard to UTC on Windows, or setting it to localtime on NixOS
    time.hardwareClockInLocalTime = true;

  # Select internationalisation properties.
    i18n.defaultLocale = "en_US.UTF-8";
  # console = {
  #   font = "Lat2-Terminus16";
  #   keyMap = "us";
  # };

  # Update the microCode for AMD processors 
    hardware.cpu.amd.updateMicrocode = true;
    
  # Enable bluetooth
    hardware.bluetooth = {
      enable = true;
      settings = {
        # A2DP profile for Modern headsets
        General = {
          Enable = "Source,Sink,Media,Socket";
        };
      };
    };

  # Enable sound
    sound.enable = true; 
    # pulseaudio
    hardware.pulseaudio = {
      enable = true;
     # NixOS allows either a lightweight build (default) or full build
     # Only the full build has Bluetooth support, so it must be selected here.
     package = pkgs.pulseaudioFull;
     extraModules = [ pkgs.pulseaudio-modules-bt ];
     extraConfig = "load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1";
    };

  # Networking
    networking.hostName = "nixos"; # Define your hostname.
    networking.networkmanager.enable = true;

  # The global useDHCP flag is deprecated, therefore explicitly set to false here.
  # Per-interface useDHCP will be mandatory in the future, so this generated config
  # replicates the default behaviour.
    networking.useDHCP = false;
    networking.interfaces.enp7s0.useDHCP = false;
    networking.interfaces.wlp6s0.useDHCP = true;

  # enable/disable the firewall
    networking.firewall.enable = true;
  # Open ports in the firewall.
  # networking.firewall.allowedTCPPorts = [ ... ];
  # networking.firewall.allowedUDPPorts = [ ... ];

  # Configure network proxy if necessary
  # networking.proxy.default = "http://user:password@proxy:port/";
  # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";

  # Configure keymap in X11
    services.xserver.layout = "us";

  # Xserver
  services.xserver = {
    enable = true;
    autorun = true;
    windowManager = {
      xmonad = {
        enable = true;
        enableContribAndExtras = true;
        extraPackages = haskellPackages: [ 
            haskellPackages.xmonad-contrib      # Xmonad contrib
            haskellPackages.xmobar              # A minimalistic text based status bar
            haskellPackages.xmonad-wallpaper    # Xmonad wallpaper
        ];
      };
    };
    desktopManager = {
      xterm.enable = false;
    };
    displayManager = {
     sddm.enable = true;
    };
  };

 #  Xserver video drivers
    services.xserver.videoDrivers = [ "nvidia" ];
 
  # Enable touchpad support (enabled default in most desktopManager).
    services.xserver.libinput.enable = false;

  # Enable CUPS to print documents.
  # services.printing.enable = true;
  
  # Location to enable day-light saving, night light functionality
  # The location provider to use for determining your location. 
  # location = "manual" or "geoclue2"
  # If set to manual you must also provide latitude/longitude.
  location = {
    provider = "manual";
    latitude = 24.4852;
    longitude = 86.69;
  };

  # environment.etc sysmlinking
  environment.etc = {
    "jdk11".source = pkgs.adoptopenjdk-bin;
  };

  # List packages installed in system profile. To search, run:
  # $ nix search wget
   environment.systemPackages = with pkgs; [
     wget           # Tool for retrieving files using HTTP,HTTPS, and FTP 
     vim            # The most popular clone of the VI editor
     zsh            # The Z shell
   ];

  # Fonts
  fonts.fonts = with pkgs; [
    nerdfonts        # Nerd Iconic font aggregator
    font-awesome     # Font awesome iconic font
    noto-fonts       # Beautiful and free fonts for many languages
  ];

  # Some programs need SUID wrappers, can be configured further or are
  # started in user sessions.
  # programs.mtr.enable = true;
  # programs.gnupg.agent = {
  #   enable = true;
  #   enableSSHSupport = true;
  # };

  # Programs 
     # zsh shell
     programs.zsh.enable = true;
    
     # java development kit  11
     programs.java = {
       enable = true;
       package = pkgs.adoptopenjdk-bin;
     };


  # udev rules
  services.udev.packages = with pkgs; [ 
    android-udev-rules
  ];

  # Services
  # ------------------------------------------------------------------------------

    # Network time synchronization
    services.chrony.enable = true;

    # Jellyfin media server
    services.jellyfin.enable = true;

  # Enable the OpenSSH daemon.
   services.openssh.enable = true;


  # ------------------------------------------------------------------------------
  #
  virtualisation. podman = {
       enable = true;
       dockerCompat = false;
  };
 
 virtualisation.docker = {
      enable = false;
 };


  # Define a user account. Don't forget to set a password with ‘passwd’.
    users.users.akhilesh = {
     name = "akhilesh";
     description = "Akhilesh";
     isNormalUser = true;
     home = "/home/akhilesh";
     shell = pkgs.zsh;
     group = "users";
     extraGroups = [ "wheel" "networkmanager" "audio" "video" ];
     packages = with pkgs; [
       zsh              # The Z shell
       starship         # A minimal, blazing fast, and extremely customizable prompt for any shell
       ripgrep          # A utility that combines The Silver Searcher with grep
       silver-searcher  # A code-searching tool similar to ack, but faster
       fzf              # fuzzy finder
       fasd             # Quick command-line access to files and dirs for POSIX shells
       tmux             # Terminal multiplexer
       tree             # Command to produce a depth indented directory listing
       vivid            # A generator for LS_COLORS with support for multi color themes
       pywal            # Generate and change colorschemes on the fly
       xclip            # Tool to access the X clipboard from a console applicaiton
       killall          # Tool to kill multiple processes
       alacritty        # Terminal emulator
       git              # git version control
       gparted          # Graphical disk partitioning tool
       dmenu            # A generic menu for the X window System
       rofi             # Window switcher, run dialog and dmenu replacement
       feh              # Light weight image viewer, wallpaper change
       ts               # Task spooler - batch queue
       firefox          # Firefox web browser
       chromium         # Chromium web browser
       google-chrome    # Google chrome web browser
       brave            # Brave web browser  
       meld             # Visual diff and merge tool
       jetbrains.idea-community   # Intellij Idea IDE
       sublime3         # sublime text editor
       vscode           # Visual Studio Code text editor
       drawio           # A desktop application for creating diagrams (draw.io)
       postman          # Postman api development tool
       mysql-workbench  # Visual MySql database modelling, administration and querying tool
       mysql-client     # MySql client ( mariadb-client )
       dbeaver          # Universal SQL client, Supports MySQL, PostgreSQL, Oracle and more
       joplin-desktop   # An open source note taking and To-Do application
       mupdf            # A lightweight vim inspired pdf reader
       zathura          # A lightweight pdf reader
       qbittorrent      # Torrent GUI client
       scrot            # A command line screen capture utility
       dunst            # Light-Weight notification daemon
       sxhkd            # Simple X hotkey daemon
       wpsoffice        # WPS office
       mpv              # mpv video player
       youtube-dl       # Command line youtube downloader
       shortwave        # Find and play radio stations from internet
       picard           # Official musicbrainz picard
       gthumb           # image viewer, organizer
       jpegoptim        # Optimize JPEG files
       jpegrescan       # losslessly shring any JPEG file
       jpeginfo         # Prints information and tests integrity of JPEG/JFIF files
       imagemagick      # A software suite to create,edit,compose, or convert bitmap images
       ffmpeg           # A complete sol to record,convert and stream audio and video
       ffmpegthumbnailer   # A lightweight video thumbnailer
       playerctl        # Command-line utility for controlling media players implementing MPRIS
       jellyfin         # Jellyfin media server
       spotify          # Play music from the Spotify music service
       gnome.nautilus  # Nautilus GUI file manager
       gnome.sushi     # A quick previewer for Nautilus
       teams            # Microsoft teams meetings
       skypeforlinux    # Skype Desktop client
       zoom-us          # Zoom meetings
       slack            # Slack desktop
       calibre          # e-Library manager
       xbrightness      # X11 screen brightness controller
       haskellPackages.xmobar # A minimalistic Text Based Status Bar
       i3lock-color     # A simple screen locker like slock, enhanced version
       xorg.xkill       # xorg xkill utility 
       lxappearance     # Utility to set fonts, icon themes, cursor themes, etc
       # Themes
       # Icon themes
       hicolor-icon-theme          # Default fallback theme
       gnome.adwaita-icon-theme   # Many programs rely heavily on having an icon theme available
       moka-icon-theme
       numix-icon-theme
       numix-icon-theme-circle
       numix-icon-theme-square
       papirus-icon-theme
       # cursor themes
       bibata-cursors
       bibata-extra-cursors
       bibata-cursors-translucent
       # Security and sandboxing
     ];
   };

# Temporarily allow insecure packages
   nixpkgs.config.permittedInsecurePackages = [
   ];
 

  # security
  security.sudo = {
     enable = true;
  }; 
  security.apparmor.enable = true; 

  # Automatic Upgrades
  # If allowReboot is true, then the system will automatically reboot 
  # if the new generation contains a different kernel, initrd or kernel modules
  system.autoUpgrade.enable = true;
  system.autoUpgrade.allowReboot = false;
   
  # This value determines the NixOS release from which the default
  # settings for stateful data, like file locations and database versions
  # on your system were taken. It‘s perfectly fine and recommended to leave
  # this value at the release version of the first install of this system.
  # Before changing this value read the documentation for this option
  # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
  system.stateVersion = "20.09"; # Did you read the comment?

}

If --show-trace adds anything, it might help to update the first post with the extra detail.

hi

pynacl seems only supported now by python 3.8 or 3.9, so maybe add one of those 2?

https://search.nixos.org/packages?channel=21.11&from=0&size=50&sort=relevance&type=packages&query=pynacl

Thanks @M12 @abathur for the reply
but still after adding python39Packages.pynacl or python38Packages.pynacl
build is still failing
Posting stack trace here

[root@nixos:~]# nixos-rebuild build --upgrade --show-trace
unpacking channels...
building Nix...
building the system configuration...
error: while evaluating the attribute 'activationScript' of the derivation 'nixos-system-nixos-21.11.334684.1158f346391' at /nix/store/5plvj33p5hgx6bs2335ma5b896qlb5f8-nixos-21.11.334684.1158f346391/nixos/pkgs/stdenv/generic/make-derivation.nix:205:7:
while evaluating the attribute 'system.activationScripts.script' at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/activation-script.nix:136:9:
while evaluating 'systemActivationScript' at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/activation-script.nix:20:33, called from /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/activation-script.nix:136:18:
while evaluating 'textClosureMap' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/strings-with-deps.nix:75:35, called from /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/activation-script.nix:49:9:
while evaluating 'id' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/trivial.nix:14:5, called from undefined position:
while evaluating the attribute 'text' at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/activation-script.nix:9:5:
while evaluating the attribute 'text' at undefined position:
while evaluating 'g' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:301:19, called from undefined position:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:171:72, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:304:20:
while evaluating the attribute 'value' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:585:9:
while evaluating the option `system.activationScripts.etc.text':
while evaluating the attribute 'mergedValue' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:617:5:
while evaluating the attribute 'values' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:611:9:
while evaluating the attribute 'values' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:710:7:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:597:28, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:597:17:
while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/etc/etc.nix':
while evaluating 'dischargeProperties' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:669:25, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:598:137:
while evaluating the attribute 'value' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:452:44:
while evaluating the attribute 'buildCommand' of the derivation 'etc' at /nix/store/5plvj33p5hgx6bs2335ma5b896qlb5f8-nixos-21.11.334684.1158f346391/nixos/pkgs/stdenv/generic/make-derivation.nix:205:7:
while evaluating 'concatMapStringsSep' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/strings.nix:110:5, called from /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/etc/etc.nix:54:7:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/etc/etc.nix:54:33, called from undefined position:
while evaluating 'concatMapStringsSep' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/strings.nix:110:5, called from /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/etc/etc.nix:54:43:
while evaluating 'escapeShellArg' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/strings.nix:318:20, called from undefined position:
while evaluating the attribute 'source' at undefined position:
while evaluating 'g' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:301:19, called from undefined position:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:171:72, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:304:20:
while evaluating the attribute 'value' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:585:9:
while evaluating the option `environment.etc.profiles/per-user/akhilesh.source':
while evaluating the attribute 'mergedValue' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:617:5:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:619:17, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:619:12:
while evaluating 'check' at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/types.nix:362:15, called from /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:619:22:
while evaluating the attribute 'passAsFile' of the derivation 'user-environment' at /nix/store/5plvj33p5hgx6bs2335ma5b896qlb5f8-nixos-21.11.334684.1158f346391/nixos/pkgs/stdenv/generic/make-derivation.nix:205:7:
while evaluating the attribute 'passAsFile' at /nix/store/5plvj33p5hgx6bs2335ma5b896qlb5f8-nixos-21.11.334684.1158f346391/nixos/pkgs/build-support/buildenv/default.nix:77:5:
while evaluating the attribute 'buildInputs' of the derivation 'mysql-workbench-8.0.21' at /nix/store/5plvj33p5hgx6bs2335ma5b896qlb5f8-nixos-21.11.334684.1158f346391/nixos/pkgs/stdenv/generic/make-derivation.nix:205:7:
while evaluating the attribute 'out.outPath' at /nix/store/5plvj33p5hgx6bs2335ma5b896qlb5f8-nixos-21.11.334684.1158f346391/nixos/lib/customisation.nix:157:13:
while evaluating the attribute 'propagatedBuildInputs' of the derivation 'python2.7-paramiko-2.7.2' at /nix/store/5plvj33p5hgx6bs2335ma5b896qlb5f8-nixos-21.11.334684.1158f346391/nixos/pkgs/stdenv/generic/make-derivation.nix:205:7:
while evaluating 'getOutput' at /nix/store/5plvj33p5hgx6bs2335ma5b896qlb5f8-nixos-21.11.334684.1158f346391/nixos/lib/attrsets.nix:489:23, called from undefined position:
while evaluating anonymous function at /nix/store/5plvj33p5hgx6bs2335ma5b896qlb5f8-nixos-21.11.334684.1158f346391/nixos/pkgs/stdenv/generic/make-derivation.nix:170:13, called from undefined position:
while evaluating 'callPackageWith' at /nix/store/5plvj33p5hgx6bs2335ma5b896qlb5f8-nixos-21.11.334684.1158f346391/nixos/lib/customisation.nix:117:35, called from /nix/store/5plvj33p5hgx6bs2335ma5b896qlb5f8-nixos-21.11.334684.1158f346391/nixos/pkgs/top-level/python-packages.nix:6830:12:
while evaluating 'makeOverridable' at /nix/store/5plvj33p5hgx6bs2335ma5b896qlb5f8-nixos-21.11.334684.1158f346391/nixos/lib/customisation.nix:67:24, called from /nix/store/5plvj33p5hgx6bs2335ma5b896qlb5f8-nixos-21.11.334684.1158f346391/nixos/lib/customisation.nix:121:8:
while evaluating anonymous function at /nix/store/5plvj33p5hgx6bs2335ma5b896qlb5f8-nixos-21.11.334684.1158f346391/nixos/pkgs/development/python-modules/pynacl/default.nix:1:1, called from /nix/store/5plvj33p5hgx6bs2335ma5b896qlb5f8-nixos-21.11.334684.1158f346391/nixos/lib/customisation.nix:69:16:
while evaluating 'makeOverridablePythonPackage' at /nix/store/5plvj33p5hgx6bs2335ma5b896qlb5f8-nixos-21.11.334684.1158f346391/nixos/pkgs/top-level/python-packages.nix:32:37, called from /nix/store/5plvj33p5hgx6bs2335ma5b896qlb5f8-nixos-21.11.334684.1158f346391/nixos/pkgs/development/python-modules/pynacl/default.nix:13:1:
while evaluating 'makeOverridable' at /nix/store/5plvj33p5hgx6bs2335ma5b896qlb5f8-nixos-21.11.334684.1158f346391/nixos/lib/customisation.nix:67:24, called from /nix/store/5plvj33p5hgx6bs2335ma5b896qlb5f8-nixos-21.11.334684.1158f346391/nixos/pkgs/top-level/python-packages.nix:34:12:
while evaluating anonymous function at /nix/store/5plvj33p5hgx6bs2335ma5b896qlb5f8-nixos-21.11.334684.1158f346391/nixos/pkgs/development/interpreters/python/mk-python-derivation.nix:30:1, called from /nix/store/5plvj33p5hgx6bs2335ma5b896qlb5f8-nixos-21.11.334684.1158f346391/nixos/lib/customisation.nix:69:16:
pynacl-1.4.0 not supported for interpreter python2.7

Sorry for being not too clear, but I meant adding Python 3.8 or Python 3.9, if it is not installed

Your first error message says:

It did not like Python 2.7 anymore it seems!

It might be Python 3.8 or 3.9 it needs, depending on the version of the pynacl package you have installed

I don’t think adding python3 is the issue. From the stack, I assume mysql-workbench is using python2?

I’d comment it out and see if you can build.

Thanks @abathur
for pointing out that mysql-workbench was causing the build to fail
Closing the thread