I tried to update the packages and now it won't rebuild

I tried to install openjdk25 but it said that the variable wasn’t found. Turns out i have had an unupdated system/channel for some time now (25.05 instead of 26.05) even thougth I have ran sudo nix-channel --update and sudo nixos-rebuild switch --upgrade multiple times. Each time it just showed verison 25.05 again.

I have checked many topics on this site and tried a couple things:

First I changed the NIX_PATH variable to /nix/var/nix/profiles/per-user/root/channels as stated in this post (and tried many other variations that also didn’t work, both with and without export and many other things). I belive then it stopped rebuilding and throwing an error like this:

Error message
[francesccs@nixos:~]$ sudo nixos-rebuild switch
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error:
       … while calling the 'import' builtin
         at «string»:1:6:
            1| with import <nixpkgs/nixos> {}; config.system.build.nixos-rebuild
             |      ^

       … while realising the context of a path

       … while calling the 'findFile' builtin
         at «string»:1:13:
            1| with import <nixpkgs/nixos> {}; config.system.build.nixos-rebuild
             |             ^

       error: file 'nixpkgs/nixos' was not found in the Nix search path (add it using $NIX_PATH or -I)
building Nix...
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error: file 'nixpkgs/nixos' was not found in the Nix search path (add it using $NIX_PATH or -I)
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error: file 'nixpkgs/nixos/modules/installer/tools/nix-fallback-paths.nix' was not found in the Nix search path (add it using $NIX_PATH or -I)
/tmp/nixos-rebuild.10pRm0/nix
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)
building the system configuration...
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error: file 'nixpkgs/nixos' was not found in the Nix search path (add it using $NIX_PATH or -I)

(Note that this is the error that I get now so possibley a bit diferent to what I got then but I remeber it almost identical)

Then I tried updating the channels. This is what I did:

  1. Added the worng channel
  2. Deleted the wrong channel
  3. Added the 26.05 channel (with no name, wich idk if it causes issues)
  4. Removed the original 25.05 channel

When getting errors again trying to rebuild I visited the folders on the NIX_PATH and saw that the /nix/var/nix/profiles/per-user/root/channels was empty. There were also 3 other folders named “channels-number-link” with numbers 1 to 3. Number 1 and 2 were pretty simmilar except that 2 had a database file that 1 didn’t have. Number 3 had nothing but a license on it.

I then saw that folder channels-2-link had 36 nesting folders of nixpckgs containing a copy of it’s root folder. Then I visited a post that said it was normal so I kind of ignore it now, but I don’t know what to set the NIX_PATH variable anymore.

Now I have checked the /nix/var/nix/profiles/per-user/root/channels folder again and it now contains a folder named nixos-26.05. I tried rebuilding again but it still doesn’t work. Now there is also a new folder named channels-4-link.

what’s the output of nix-channel --list and sudo nix-channel --list?

Could you also share how you write your configuration? I’ve seen people make this mistake where they use flakes but try to “update” by using nix-channel, so I’d like to make sure that isn’t the case for you.

[francesccs@nixos:/]$ nix-channel --list

[francesccs@nixos:/]$ sudo nix-channel --list
[sudo] password for francesccs: 
nixos-26.05 https://channels.nixos.org/nixos-26.05

Without sudo it shows nothing and with it only the 26.05 channel that I added.

I don’t use flakes (unless I have accidentally turned them on or something). All I have done as far as I can recall is just installing stable packages and I once touched a port thing but that’s it.

Here is my configuration:

configuration.nix
# 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
    ];

  # Bootloader.
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;
  boot.kernelParams = ["amdgpu.sg_display=0"];

  networking.hostName = "nixos"; # Define your hostname.
  # networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.

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

  #nixpkgs.config.allowUnfree = true;

  # Enable networking
  networking.networkmanager.enable = true;

  networking.firewall = {
    allowedTCPPorts = [80 433 ];
  };

  # Set your time zone.
  time.timeZone = "Europe/Madrid";

  # Select internationalisation properties.
  i18n.defaultLocale = "en_US.UTF-8";

  i18n.extraLocaleSettings = {
    LC_ADDRESS = "es_ES.UTF-8";
    LC_IDENTIFICATION = "es_ES.UTF-8";
    LC_MEASUREMENT = "es_ES.UTF-8";
    LC_MONETARY = "es_ES.UTF-8";
    LC_NAME = "es_ES.UTF-8";
    LC_NUMERIC = "es_ES.UTF-8";
    LC_PAPER = "es_ES.UTF-8";
    LC_TELEPHONE = "es_ES.UTF-8";
    LC_TIME = "es_ES.UTF-8";
  };

  # Enable the X11 windowing system.
  # You can disable this if you're only using the Wayland session.
  services.xserver.enable = true;

  # Enable the KDE Plasma Desktop Environment.
  services.displayManager.sddm.enable = true;
  services.desktopManager.plasma6.enable = true;

  # Configure keymap in X11
  services.xserver.xkb = {
    layout = "es";
    variant = "";
  };

  # Configure console keymap
  console.keyMap = "es";

  # Enable CUPS to print documents.
  services.printing.enable = true;
  #services.printing.drivers = [
    #pkgs.brgenml1cupswrapper
    #pkgs.brgenml1lpr
  #];

  # Enable sound with pipewire.
  services.pulseaudio.enable = false;
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
    # If you want to use JACK applications, uncomment this
    #jack.enable = true;

    # use the example session manager (no others are packaged yet so this is enabled by default,
    # no need to redefine it in your config for now)
    #media-session.enable = true;
  };

  # Enable touchpad support (enabled default in most desktopManager).
  # services.xserver.libinput.enable = true;

  # Define a user account. Don't forget to set a password with ‘passwd’.
  users.users.francesccs = {
    isNormalUser = true;
    description = "Francesc Cantallops Sastre";
    extraGroups = [ "networkmanager" "wheel" ];
    packages = with pkgs; [
      kdePackages.kate
      kdePackages.kmail
      kdePackages.konqueror
      kdePackages.filelight
      kdePackages.ktorrent
      kdePackages.kruler
      #kdePackages.kamoso
      thunderbird
    ];
  };

  hardware.bluetooth.enable = true;

  # Install firefox.
  programs.firefox.enable = true;
  programs.kdeconnect.enable = true;
  # List packages installed in system profile. To search, run:
  # $ nix search wget
  environment.systemPackages = with pkgs; [
  #  vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
  #  wget
  brave
  tor-browser
  yt-dlp
  lynx

  vscodium
  git
  lapce
  zed-editor
  neovim
  netbeans

  nodePackages.nodejs
  rustup
  gcc
  typescript
  python314
  openjdk

  mysql84
  mysql-workbench
  dbeaver-bin
  
  libreoffice-qt
  dia
  hunspell
  hunspellDicts.es_ES

  texliveFull
  texstudio
  texlivePackages.fontspec
  octaveFull

  kdePackages.kdenlive
  audacity

  fastfetch
  htop
  btop
  fzf
  ripgrep
  # zoxide
  uget
  croc
  linuxquota
  taskwarrior3
  # framework-tool-tui
  yazi
  ranger

  zapzap
  mumble
  dino
  signal-desktop

  logseq
  nextcloud-client
  appflowy
  digikam
  qownnotes
  joplin-desktop

  vlc
  inkscape
  gimp
  imagemagick
  blender
  godot

  ani-cli
  freetube
  peertube

  mpd
  rmpc
  cava
  gnupg
  pinentry-qt
  paprefs
  qpwgraph
  pavucontrol

  digital
  freecad
  openscad
  kicad

  luanti
  mindustry-wayland
  prismlauncher
  colobot
  the-powder-toy
  #lincity-ng


  kvmtool
  iptables
  gparted
  lm_sensors
  nmap
  distrobox

  cmatrix
  cbonsai
  sl
  ];

  # 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;
  # };

  # List services that you want to enable:

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

  # Open ports in the firewall.
  # networking.firewall.allowedTCPPorts = [ ... ];
  # networking.firewall.allowedUDPPorts = [ ... ];
  # Or disable the firewall altogether.
  # networking.firewall.enable = 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 = "25.05"; # Did you read the comment?

}

I think your channel is named wrong:

Pretty sure you want nix-channel --add https://channels.nixos.org/nixos-26.05 nixos and you probably left off the nixos at the end so it took the name nixos-26.05 instead. Run as root or with sudo.

I’ll also add that this is a great time to evaluate adding some form of input pinning. Ergonomics with npins is pretty good and I’ve been eying nixtamal. That way you never have the type of issue you have been experiencing.

Thank you! I have done that successfully and now it produces a different error. (which is a very big step in the right direction).

[francesccs@nixos:/]$ sudo nix-channel --list
nixos https://channels.nixos.org/nixos-26.05

This is the error that I get now:

Errors
[francesccs@nixos:/etc/nixos]$ sudo nixos-rebuild switch --upgrade
unpacking 1 channels...
unpacking 1 channels...
building the system configuration...
error:
       … while calling the 'derivationStrict' builtin
         at «nix-internal»/derivation-internal.nix:37:12:
           36|
           37|   strict = derivationStrict drvAttrs;
             |            ^
           38|

       … while evaluating derivation 'nixos-system-nixos-26.05.10478.1bc55b9def81'
         whose name attribute is located at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/pkgs/stdenv/generic/make-derivation.nix:647:11

       … while evaluating attribute 'buildCommand' of derivation 'nixos-system-nixos-26.05.10478.1bc55b9def81'
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/nixos/modules/system/activation/top-level.nix:63:7:
           62|       allowSubstitutes = false;
           63|       buildCommand = systemBuilder;
             |       ^
           64|

       … while evaluating the option `environment.etc.dbus-1.source':

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

       error: Refusing to evaluate package 'electron-39.8.10' in /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/pkgs/development/tools/electron/binary/generic.nix:50 because it is marked as insecure

       Known issues:
        - Electron version 39.8.10 is EOL

       You can install it anyway by allowing this package, using the
       following methods:

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

            $ export NIXPKGS_ALLOW_INSECURE=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 add ‘electron-39.8.10’ to
          `nixpkgs.config.permittedInsecurePackages` in the configuration.nix,
          like so:

            {
              nixpkgs.config.permittedInsecurePackages = [
                "electron-39.8.10"
              ];
            }

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
          ‘electron-39.8.10’ to `permittedInsecurePackages` in
          ~/.config/nixpkgs/config.nix, like so:

            {
              permittedInsecurePackages = [
                "electron-39.8.10"
              ];
            }
Command 'nix-build '<nixpkgs/nixos>' --attr config.system.build.toplevel --no-out-link' returned non-zero exit status 1.

On the first error I guess I could do the “show trace” thing. On the second error I don’t know if I can somehow make it not use the unsafe package of electron (I do not have it in my config) or if I should just allow it as unsafe.

Here is the error with “–show-trace”:

Error with “–show-trace”
[francesccs@nixos:/etc/nixos]$ sudo nixos-rebuild switch --upgrade --show-trace
unpacking 1 channels...
unpacking 1 channels...
building the system configuration...
error:
       … while calling the 'derivationStrict' builtin
         at «nix-internal»/derivation-internal.nix:37:12:
           36|
           37|   strict = derivationStrict drvAttrs;
             |            ^
           38|

       … while evaluating derivation 'nixos-system-nixos-26.05.10478.1bc55b9def81'
         whose name attribute is located at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/pkgs/stdenv/generic/make-derivation.nix:647:11

       … while evaluating attribute 'buildCommand' of derivation 'nixos-system-nixos-26.05.10478.1bc55b9def81'
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/nixos/modules/system/activation/top-level.nix:63:7:
           62|       allowSubstitutes = false;
           63|       buildCommand = systemBuilder;
             |       ^
           64|

       … while calling the 'getAttr' builtin
         at «nix-internal»/derivation-internal.nix:50:17:
           49|     value = commonAttrs // {
           50|       outPath = builtins.getAttr outputName strict;
             |                 ^
           51|       drvPath = strict.drvPath;

       … while calling the 'derivationStrict' builtin
         at «nix-internal»/derivation-internal.nix:37:12:
           36|
           37|   strict = derivationStrict drvAttrs;
             |            ^
           38|

       … while evaluating derivation 'etc'
         whose name attribute is located at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/pkgs/stdenv/generic/make-derivation.nix:647:11

       … while evaluating attribute 'buildCommand' of derivation 'etc'
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/pkgs/build-support/trivial-builders/default.nix:81:17:
           80|         enableParallelBuilding = true;
           81|         inherit buildCommand name;
             |                 ^
           82|         passAsFile = [ "buildCommand" ] ++ (derivationArgs.passAsFile or [ ]);

       … from call site
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/nixos/modules/system/etc/etc.nix:56:11:
           55|         mkdir -p "$out/etc"
           56|         ${lib.concatMapStringsSep "\n" (
             |           ^
           57|           etcEntry:

       … while calling 'concatMapStringsSep'
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/strings.nix:262:13:
          261|   concatMapStringsSep =
          262|     sep: f: list:
             |             ^
          263|     concatStringsSep sep (map f list);

       … while calling the 'concatStringsSep' builtin
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/strings.nix:263:5:
          262|     sep: f: list:
          263|     concatStringsSep sep (map f list);
             |     ^
          264|

       … while calling anonymous lambda
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/nixos/modules/system/etc/etc.nix:57:11:
           56|         ${lib.concatMapStringsSep "\n" (
           57|           etcEntry:
             |           ^
           58|           lib.escapeShellArgs [

       … from call site
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/nixos/modules/system/etc/etc.nix:58:11:
           57|           etcEntry:
           58|           lib.escapeShellArgs [
             |           ^
           59|             "makeEtcEntry"

       … while calling 'concatMapStringsSep'
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/strings.nix:262:13:
          261|   concatMapStringsSep =
          262|     sep: f: list:
             |             ^
          263|     concatStringsSep sep (map f list);

       … while calling the 'concatStringsSep' builtin
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/strings.nix:263:5:
          262|     sep: f: list:
          263|     concatStringsSep sep (map f list);
             |     ^
          264|

       … while calling 'escapeShellArg'
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/strings.nix:1201:5:
         1200|   escapeShellArg =
         1201|     arg:
             |     ^
         1202|     let

       … while evaluating a branch condition
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/strings.nix:1205:5:
         1204|     in
         1205|     if match "[[:alnum:],._+:@%/-]+" string == null then
             |     ^
         1206|       "'${replaceString "'" "'\\''" string}'"

       … while calling the 'match' builtin
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/strings.nix:1205:8:
         1204|     in
         1205|     if match "[[:alnum:],._+:@%/-]+" string == null then
             |        ^
         1206|       "'${replaceString "'" "'\\''" string}'"

       … while evaluating the second argument passed to builtins.match

       … while calling the 'toString' builtin
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/strings.nix:1203:16:
         1202|     let
         1203|       string = toString arg;
             |                ^
         1204|     in

       … from call site
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/nixos/modules/system/etc/etc.nix:61:16:
           60|             # Force local source paths to be added to the store
           61|             "${etcEntry.source}"
             |                ^
           62|             etcEntry.target

       … while calling anonymous lambda
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/attrsets.nix:1192:17:
         1191|         mapAttrs (
         1192|           name: value:
             |                 ^
         1193|           if isAttrs value && cond value then recurse (path ++ [ name ]) value else f (path ++ [ name ]) value

       … from call site
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/attrsets.nix:1193:85:
         1192|           name: value:
         1193|           if isAttrs value && cond value then recurse (path ++ [ name ]) value else f (path ++ [ name ]) value
             |                                                                                     ^
         1194|         );

       … while calling anonymous lambda
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/modules.nix:283:71:
          282|           # For definitions that have an associated option
          283|           declaredConfig = mapAttrsRecursiveCond (v: !isOption v) (_: v: v.value) options;
             |                                                                       ^
          284|

       … while evaluating the attribute 'value'
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/modules.nix:1167:7:
         1166|     // {
         1167|       value = addErrorContext "while evaluating the option `${showOption loc}':" value;
             |       ^
         1168|       inherit (res.defsFinal') highestPrio;

       … while evaluating the option `environment.etc.dbus-1.source':

       … while evaluating the attribute 'mergedValue'
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/modules.nix:1264:5:
         1263|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
         1264|     mergedValue =
             |     ^
         1265|       if isDefined then

       … while evaluating a branch condition
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/modules.nix:1273:14:
         1272|             checkedAndMerged.value
         1273|         else if all (def: type.check def.value) defsFinal then
             |              ^
         1274|           type.merge loc defsFinal

       … while calling the 'all' builtin
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/modules.nix:1273:17:
         1272|             checkedAndMerged.value
         1273|         else if all (def: type.check def.value) defsFinal then
             |                 ^
         1274|           type.merge loc defsFinal

       … while calling anonymous lambda
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/modules.nix:1273:22:
         1272|             checkedAndMerged.value
         1273|         else if all (def: type.check def.value) defsFinal then
             |                      ^
         1274|           type.merge loc defsFinal

       … from call site
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/modules.nix:1273:27:
         1272|             checkedAndMerged.value
         1273|         else if all (def: type.check def.value) defsFinal then
             |                           ^
         1274|           type.merge loc defsFinal

       … while calling 'check'
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/types.nix:723:11:
          722|         check =
          723|           x:
             |           ^
          724|           let

       … in the right operand of the AND (&&) operator
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/types.nix:740:11:
          739|           && (inStore == null || inStore == isInStore)
          740|           && (absolute == null || absolute == isAbsolute);
             |           ^
          741|       };

       … in the right operand of the OR (||) operator
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/types.nix:740:32:
          739|           && (inStore == null || inStore == isInStore)
          740|           && (absolute == null || absolute == isAbsolute);
             |                                ^
          741|       };

       … while calling the 'substring' builtin
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/types.nix:733:26:
          732|             );
          733|             isAbsolute = substring 0 1 (toString x) == "/";
             |                          ^
          734|             isExpectedType = (

       … while calling the 'toString' builtin
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/types.nix:733:41:
          732|             );
          733|             isAbsolute = substring 0 1 (toString x) == "/";
             |                                         ^
          734|             isExpectedType = (

       … while calling the 'getAttr' builtin
         at «nix-internal»/derivation-internal.nix:50:17:
           49|     value = commonAttrs // {
           50|       outPath = builtins.getAttr outputName strict;
             |                 ^
           51|       drvPath = strict.drvPath;

       … while calling the 'derivationStrict' builtin
         at «nix-internal»/derivation-internal.nix:37:12:
           36|
           37|   strict = derivationStrict drvAttrs;
             |            ^
           38|

       … while evaluating derivation 'dbus-1'
         whose name attribute is located at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/pkgs/stdenv/generic/make-derivation.nix:647:11

       … while evaluating attribute 'serviceDirectories' of derivation 'dbus-1'
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/pkgs/by-name/ma/makeDBusConf/package.nix:19:13:
           18|   {
           19|     inherit serviceDirectories suidHelper apparmor;
             |             ^
           20|     preferLocalBuild = true;

       … while calling anonymous lambda
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/types.nix:781:26:
          780|             headError = checkDefsForError check loc defs;
          781|             value = map (x: x.optionalValue.value or x.mergedValue) evals;
             |                          ^
          782|             valueMeta.list = map (v: v.checkedAndMerged.valueMeta) evals;

       … while evaluating the attribute 'optionalValue.value'
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/modules.nix:1330:41:
         1329|
         1330|     optionalValue = if isDefined then { value = mergedValue; } else { };
             |                                         ^
         1331|   };

       (11 duplicate frames omitted)

       … while evaluating derivation 'system-path'
         whose name attribute is located at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/pkgs/stdenv/generic/make-derivation.nix:647:11

       … while evaluating attribute 'chosenOutputs' of derivation 'system-path'
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/pkgs/build-support/buildenv/default.nix:116:9:
          115|
          116|         chosenOutputs = map (drv: {
             |         ^
          117|           paths =

       … while evaluating list element at index 43

       … while evaluating attribute 'paths'
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/pkgs/build-support/buildenv/default.nix:117:11:
          116|         chosenOutputs = map (drv: {
          117|           paths =
             |           ^
          118|             # First add the usual output(s): respect if user has chosen explicitly,

       … while evaluating list element at index 0
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/pkgs/build-support/buildenv/default.nix:117:11:
          116|         chosenOutputs = map (drv: {
          117|           paths =
             |           ^
          118|             # First add the usual output(s): respect if user has chosen explicitly,

       … while calling the 'getAttr' builtin
         at «nix-internal»/derivation-internal.nix:50:17:
           49|     value = commonAttrs // {
           50|       outPath = builtins.getAttr outputName strict;
             |                 ^
           51|       drvPath = strict.drvPath;

       … while calling the 'derivationStrict' builtin
         at «nix-internal»/derivation-internal.nix:37:12:
           36|
           37|   strict = derivationStrict drvAttrs;
             |            ^
           38|

       … while evaluating derivation 'logseq-0.10.15'
         whose name attribute is located at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/pkgs/stdenv/generic/make-derivation.nix:647:11

       … while evaluating attribute 'installPhase' of derivation 'logseq-0.10.15'
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/pkgs/by-name/lo/logseq/package.nix:249:3:
          248|
          249|   installPhase = ''
             |   ^
          250|     runHook preInstall

       … from call site
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/pkgs/by-name/lo/logseq/package.nix:255:5:
          254|   ''
          255|   + lib.optionalString stdenv.hostPlatform.isLinux ''
             |     ^
          256|     install -Dm644 static/icons/logseq.png "$out/share/icons/hicolor/512x512/apps/logseq.png"

       … while calling 'optionalString'
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/strings.nix:766:26:
          765|   */
          766|   optionalString = cond: string: if cond then string else "";
             |                          ^
          767|

       … from call site
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/pkgs/by-name/lo/logseq/package.nix:261:19:
          260|
          261|     makeWrapper ${lib.getExe electron} $out/bin/logseq \
             |                   ^
          262|         --add-flags $out/share/logseq/resources/app \

       … while calling 'getExe'
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/meta.nix:527:5:
          526|   getExe =
          527|     x:
             |     ^
          528|     getExe' x (

       … from call site
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/meta.nix:528:5:
          527|     x:
          528|     getExe' x (
             |     ^
          529|       x.meta.mainProgram or (

       … while calling 'getExe''
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/meta.nix:573:8:
          572|   getExe' =
          573|     x: y:
             |        ^
          574|     assert assertMsg (isDerivation x)

       … in the condition of the assert statement
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/lib/customisation.nix:414:13:
          413|           outPath =
          414|             assert condition;
             |             ^
          415|             drv.${outputName}.outPath;

       … while evaluating the attribute 'handled'
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/pkgs/stdenv/generic/check-meta.nix:710:9:
          709|         valid = "no";
          710|         handled = handle {
             |         ^
          711|           inherit attrs meta;

       … from call site
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/pkgs/stdenv/generic/check-meta.nix:710:19:
          709|         valid = "no";
          710|         handled = handle {
             |                   ^
          711|           inherit attrs meta;

       … while calling 'handle'
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/pkgs/stdenv/generic/check-meta.nix:651:5:
          650|   handle =
          651|     {
             |     ^
          652|       attrs,

       … while calling the 'seq' builtin
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/pkgs/stdenv/generic/check-meta.nix:685:5:
          684|     # Give all warnings first, then error if any
          685|     builtins.seq (foldl' giveWarning null warnings) withError;
             |     ^
          686|

       … while calling the 'throw' builtin
         at /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/pkgs/stdenv/generic/check-meta.nix:673:13:
          672|           else
          673|             throw msg;
             |             ^
          674|

       error: Refusing to evaluate package 'electron-39.8.10' in /nix/store/16p5yr3m9p0y7ain2gin15rnnbbh0nyp-nixos-26.05/nixos/pkgs/development/tools/electron/binary/generic.nix:50 because it is marked as insecure

       Known issues:
        - Electron version 39.8.10 is EOL

       You can install it anyway by allowing this package, using the
       following methods:

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

            $ export NIXPKGS_ALLOW_INSECURE=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 add ‘electron-39.8.10’ to
          `nixpkgs.config.permittedInsecurePackages` in the configuration.nix,
          like so:

            {
              nixpkgs.config.permittedInsecurePackages = [
                "electron-39.8.10"
              ];
            }

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
          ‘electron-39.8.10’ to `permittedInsecurePackages` in
          ~/.config/nixpkgs/config.nix, like so:

            {
              permittedInsecurePackages = [
                "electron-39.8.10"
              ];
            }
Command 'nix-build '<nixpkgs/nixos>' --attr config.system.build.toplevel --no-out-link --show-trace' returned non-zero exit status 1.

Thanks to all of you so far for the help!

TL;DR: add this to your config or remove logseq.
Pro tip: grep the --show-trace output for while evaluating derivation to see an oftentimes more useful trace.
See:

After adding that and removing another problematic package, it has rebuild and updated successfully (even tho it showed some errors).

Thank you all for all of your help!