Once again stuck when updating flake

I’ve been stuck on this for a couple weeks, hoping it would somehow resolve it solve itself but it doesn’t.

What am I doing wrong this time?!

the output:

sudo nixos-rebuild switch --flake .#mySystem 
Place your finger on the fingerprint reader
warning: Git tree '/home/thibaultmol/nix/Nixos-personal' is dirty
building the system configuration...
warning: Git tree '/home/thibaultmol/nix/Nixos-personal' is dirty
error:
       … while calling the 'head' builtin
         at /nix/store/ab78nf3ad8ly49zfyd3igw3f2n5q7fz4-source/lib/attrsets.nix:1574:11:
         1573|         || pred here (elemAt values 1) (head values) then
         1574|           head values
             |           ^
         1575|         else

       … while evaluating the attribute 'value'
         at /nix/store/ab78nf3ad8ly49zfyd3igw3f2n5q7fz4-source/lib/modules.nix:816:9:
          815|     in warnDeprecation opt //
          816|       { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          817|         inherit (res.defsFinal') highestPrio;

       … while evaluating the option `system.build.toplevel':

       … while evaluating definitions from `/nix/store/ab78nf3ad8ly49zfyd3igw3f2n5q7fz4-source/nixos/modules/system/activation/top-level.nix':

       … while evaluating the option `system.systemBuilderArgs':

       … while evaluating definitions from `/nix/store/ab78nf3ad8ly49zfyd3igw3f2n5q7fz4-source/nixos/modules/system/activation/activatable-system.nix':

       … while evaluating the option `system.activationScripts.etc.text':

       … while evaluating definitions from `/nix/store/ab78nf3ad8ly49zfyd3igw3f2n5q7fz4-source/nixos/modules/system/etc/etc-activation.nix':

       … while evaluating definitions from `/nix/store/ab78nf3ad8ly49zfyd3igw3f2n5q7fz4-source/nixos/modules/system/etc/etc.nix':

       … while evaluating the option `environment.etc."profiles/per-user/thibaultmol".source':

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

       error: time-machine-2.15.0 not supported for interpreter python3.9
my flake
{
  description = "My NixOS configuration with flakes";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    nixos-hardware.url = "github:NixOS/nixos-hardware/master";
    home-manager.url = "github:nix-community/home-manager/master";
    home-manager.inputs.nixpkgs.follows = "nixpkgs";
  };

  outputs = {
    self,
    nixpkgs,
    nixos-hardware,
    home-manager,
    ...
  } @ inputs: {
    nixosConfigurations.mySystem =
      nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        modules = [
          ./hardware-configuration.nix
          nixos-hardware.nixosModules.framework-13-7040-amd
          home-manager.nixosModules.home-manager
          ({
              pkgs,
              lib,
              ...
            }: {
              environment.systemPackages = with pkgs; [
                htop
                git
                nodejs
                nodePackages.prettier
                wget
                cifs-utils
                jq
                xmlstarlet
                stress
                glmark2
                dig
                git-lfs
                cron
                mkvtoolnix
                libxml2
                vdhcoapp
                powertop
                vesktop
                google-fonts
                gcc # needed for panoramax cli
                stdenv.cc.cc.lib # needed for panoramax cli
                steam-run # used to run non-nixos executables easily
                mesa # This shouldn't be needed, but fuck me can I not figure out how to get mesa working without this
              ];

              # Use the systemd-boot EFI boot loader.
              boot.loader.systemd-boot.enable = true;
              boot.loader.efi.canTouchEfiVariables = true;

              boot.supportedFilesystems = ["ntfs"];

              # Custom initrd commands for Btrfs subvolume management
              boot.initrd.postDeviceCommands = lib.mkAfter ''
                mkdir /mnt
                mount -t btrfs /dev/mapper/enc /mnt
                btrfs subvolume delete /mnt/root
                btrfs subvolume snapshot /mnt/root-blank /mnt/root
              '';

              # Enable experimental features
              nix.settings.experimental-features = ["nix-command" "flakes"];

              # System-wide package and security settings
              nixpkgs.config.allowUnfree = true;
              nixpkgs.config.permittedInsecurePackages = [
                "electron-25.9.0"
                "jitsi-meet-1.0.8043"
                "cinny-4.2.3"
                "cinny-unwrapped-4.2.3"
              ];

              # Networking, time zone, locale, and desktop environment configuration
              networking.hostName = "Framework-THIB";
              networking.networkmanager.enable = true;
              networking.firewall.enable = true;
              networking.firewall.allowedTCPPorts = [
                5188 # http temp
                60096 # qbittorent
                22000 # syncthing
                5000 # Geovisio api
                3000 # Geovisio web
              ];
              networking.firewall.allowedUDPPorts = [
                60096 # qbittorent
                22000 # syncthing
                5000 # Geovisio api
                3000 # Geovisio web
              ];
              networking.firewall.allowedTCPPortRanges = [
                {
                  from = 1;
                  to = 1;
                }
              ];
              networking.firewall.allowedUDPPortRanges = [
                {
                  from = 1;
                  to = 1;
                }
              ];

              time.timeZone = "Europe/Brussels";
              i18n.defaultLocale = "en_GB.UTF-8";

              environment.variables.LANG = "en_GB.UTF-8";
              environment.variables.LC_TIME = "en_GB.UTF-8";

              console.font = "Lat2-Terminus16";
              console.keyMap = lib.mkForce "be-latin1";
              console.useXkbConfig = true;
              services.xserver.enable = true;
              services.displayManager.sddm.enable = true;
              services.displayManager.sddm.autoNumlock = true;
              services.displayManager.sddm.wayland.enable = true;
              services.desktopManager.plasma6.enable = true;

              xdg.portal = {
                enable = true;
                extraPortals = [pkgs.xdg-desktop-portal-kde pkgs.xdg-desktop-portal-wlr];
              };

              virtualisation.waydroid.enable = true;

              services.tailscale.enable = true;

              services.fwupd.enable = true;
              services.fwupd.daemonSettings = {
                OnlyTrusted = false;
              };

              services.avahi.enable = true; # auto discovere of network drives for ex

              virtualisation.docker.enable = true;
              virtualisation.docker.enableOnBoot = true;

              services.syncthing = {
                enable = true;
                user = "thibaultmol";
                group = "users";
              };

              # User configuration
              users.users.thibaultmol = {
                isNormalUser = true;
                extraGroups = ["wheel"];
                password = "REDACTED";
                packages = with pkgs; [
                  # Web Browsers and Privacy Tools
                  firefox
                  google-chrome
                  ungoogled-chromium
                  tor-browser-bundle-bin

                  # Communication and Social Media
                  element-desktop
                  discord
                  masterpdfeditor
                  gphoto2 # old gopro connect
                  kdePackages.kamera #neither this or gphoto2 seems to work
                  kdenlive
                  signalbackup-tools
                  signal-desktop
                  telegram-desktop
                  qgis
                  tuba # Mastodon client
                  # teams  Microsoft Teams, might need to use an overlay or Flathub
                  thunderbird
                  virt-viewer
                  mumble
                  syncplay
                  tmux
                  shell-gpt
                  _7zz

                  # Multimedia Players and Editors
                  vlc
                  mpv
                  jellyfin-media-player
                  audacity
                  android-tools
                  gimp
                  krita
                  inkscape
                  hugin
                  obsidian

                  nextcloud-client

                  distrobox
                  boxbuddy

                  # Text and Code Editors
                  kate # KDE text editor
                  gedit
                  vscodium

                  # Gaming and Emulation
                  lutris
                  sqlitebrowser
                  steam
                  discover-overlay
                  bottles
                  cinny-desktop
                  prismlauncher # Kinda cringe ngl
                  lunar-client
                  protonup-qt
                  gnome-disk-utility
                  gnome-usage
                  aegisub
                  diffpdf
                  sshfs
                  mission-center

                  detox # filename cleaner

                  # File Management and Sharing
                  nautilus
                  filezilla
                  deluge
                  qbittorrent
                  # peazip
                  zip
                  # msfconsole

                  # System and Network Utilities
                  gparted
                  partition-manager # KDE Partition Manager
                  btop
                  gwenview
                  filelight
                  virtualbox
                  droidcam
                  wayfarer
                  scrcpy

                  # Torrents and Downloads
                  deluge
                  qbittorrent
                  yt-dlp

                  python39
                  python39Packages.pip
                  python39Packages.virtualenv
                  uv # not using anymore?

                  # Audio and Video Production
                  audacity
                  handbrake
                  obs-studio
                  qpwgraph

                  # Security and Passwords
                  # bitwarden TEMP REMOVED
                  protonvpn-gui

                  # Cleaning and Maintenance
                  bleachbit # Assuming inclusion for system cleaning
                  czkawka

                  # Image and Graphics
                  gimp
                  inkscape
                  krita
                  hugin
                  ffmpeg

                  # Office and Documentation
                  libreoffice-fresh
                  onlyoffice-bin
                  obsidian

                  # Miscellaneous Tools
                  meld
                  galaxy-buds-client
                  alejandra
                  bcompare
                  trayscale
                  kooha
                  spectacle
                  remmina
                  warpinator
                  killall
                  ghostscript
                  pdftk
                  easyeffects
                  google-cloud-sdk
                  libsForQt5.kcalc
                  libsForQt5.kget
                  krename
                  libsForQt5.kfind
                  libsForQt5.kompare
                  libsForQt5.skanlite
                  libsForQt5.skanpage

                  # THESE WILL HAVE TO BE CHANGED kdePackages. ONCE QT6 DROPS
                  # kdePackages.kjournald wasn't shipped with qt5 yet so add this once switchen to qt6
                  kdePackages.sddm-kcm
                  imagemagick
                  snapshot
                  libsForQt5.krdc
                  croc # file transfer cli tool
                  localsend
                  josm
                  docker-compose
                  aria
                  wireguard-tools
                  #nomachine-client broken atm
                  exiftool
                  zint # qr code creator
                  calibre
                  anydesk
                  unzip
                ];
              };

              # Services
              services.printing.enable = true;
              hardware.bluetooth.enable = true;
              # somehow this fixes a bluetooth problem: https://github.com/bluez/bluez/issues/745#issuecomment-2160670429
              hardware.bluetooth.settings = {
                General = {
                  JustWorksRepairing = "always";
                };
              };
              # sound.enable = true;  #disabled because I've switched to pipewire
              services.libinput.enable = true;
              services.flatpak.enable = true;

              # Audio
              security.rtkit.enable = true;
              services.pipewire = {
                enable = true;
                alsa.enable = true;
                alsa.support32Bit = true;
                pulse.enable = true;
                wireplumber.enable = true;
                # Additional configurations for Pipewire...
              };

              hardware.pulseaudio.extraConfig = "
load-module module-switch-on-connect
";

              # Set the system state version
              system.stateVersion = "23.11";
            })
        ];
      };
  };
}

time-machine-2.15.0 not supported for interpreter python3.9

I’m new to Nix, but maybe find out which package introduces the time-machine dependency and remove it, or figure out how to have a supported Python version available? :thinking:

1 Like

The problem is with these three lines of your users packages (as the error message even indicates):

python39
python39Packages.pip
python39Packages.virtualenv

I suggest you to not install packages like these globally (either system or user level). Instead manage these project specific dependency using nix shell. See for example for Python: Nixpkgs Reference Manual. If you combine this with direnv, you get super fast project specific dependency management nearly for free.

Besides of this, I find you package list impressive. I personally would recommend to thin this out and use nix run nixpkgs#name for rare occasions.