Can't update flake lock

I don’t think I changed anything special lately. But today I tried to run the `nix flake update’, which fails

nix flake update
error:
       … while updating the lock file of flake 'git+file:///home/thibaultmol/nix/Nixos-personal?ref=refs/heads/main&rev=fc8c58292cba9e8f1c862ad8ec509bca10d7e373'

       … while updating the flake input 'nixpkgs'

       … while fetching the input 'github:NixOS/nixpkgs/nixos-24.05'

       error: failed to extract archive (Can't create '/tmp/nix-19349-0/nixpkgs-706eef542dec88cc0ed25b9075d3037564b2d164/pkgs/development/python-modules/django-mailman3/default.nix')

my nix flake is located in a user owned folder, i’ve tried running it with sudo as well but same result.

Flake.nix
{
  description = "My NixOS configuration with flakes";

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

  outputs = {
    self,
    nixpkgs,
    unstable,
    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
                wget
                cifs-utils
                stress
                glmark2
                dig
                mkvtoolnix
                vdhcoapp
                mesa # This shouldn't be needed, but fuck me can I not figure out how to get mesa working without this
                # unstable.legacyPackages.${pkgs.system}.packagenamegoeshere # this is how to install unstable packages for the system
              ];

              # 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"];

              # 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
                  signal-desktop
                  telegram-desktop
                  tuba # Mastodon client
                  # teams  Microsoft Teams, might need to use an overlay or Flathub
                  thunderbird
                  mumble

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

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

                  # Gaming and Emulation
                  lutris
                  steam
                  bottles
                  prismlauncher # Kinda cringe ngl
                  lunar-client
                  protonup-qt

                  # File Management and Sharing
                  gnome.nautilus
                  filezilla
                  deluge
                  qbittorrent
                  # peazip
                  zip

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

                  # Torrents and Downloads
                  deluge
                  qbittorrent
                  unstable.legacyPackages.${pkgs.system}.yt-dlp

                  # Audio and Video Production
                  audacity
                  handbrake
                  obs-studio
                  qpwgraph

                  # Security and Passwords
                  bitwarden
                  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
                  cinnamon.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
                  libsForQt5.kamoso
                  libsForQt5.krdc
                  croc # file transfer cli tool
                  localsend
                  unstable.legacyPackages.${pkgs.system}.josm
                  docker-compose
                  aria
                  wireguard-tools
                  nomachine-client
                  exiftool
                  zint # qr code creator
                  calibre
                  anydesk
                ];
              };

              # 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";
            })
        ];
      };
  };
}

does --show-trace add info or even -vv ?

1 Like

Are you running out of /tmp space by any chance?

1 Like

show-trace didn’t output anything different from the normal command?
but vv did:

sudo nix flake update -vv
using revision fc8c58292cba9e8f1c862ad8ec509bca10d7e373 of repo '/home/thibaultmol/nix/Nixos-personal'
evaluating file '/nix/store/s2rqz276ccfn07v8x2dpja5ipnrd3rj8-source/flake.nix'
downloading 'https://api.github.com/repos/nix-community/home-manager/commits/release-24.05'...
evaluating file '/nix/store/hxhym8c5xz6dxkl3d9yppiwlnzk3khn7-source/flake.nix'
downloading 'https://api.github.com/repos/NixOS/nixos-hardware/commits/master'...
evaluating file '/nix/store/5cgvj5qnqjd0qhbiadyzd6m4jp8nvvm3-source/flake.nix'
downloading 'https://api.github.com/repos/NixOS/nixpkgs/commits/nixos-24.05'...
error:
       … while updating the lock file of flake 'git+file:///home/thibaultmol/nix/Nixos-personal?ref=refs/heads/main&rev=fc8c58292cba9e8f1c862ad8ec509bca10d7e373'

       … while updating the flake input 'nixpkgs'

       … while fetching the input 'github:NixOS/nixpkgs/nixos-24.05'

       error: failed to extract archive (Can't create '/tmp/nix-6019-0/nixpkgs-706eef542dec88cc0ed25b9075d3037564b2d164/pkgs/development/python-modules/dokuwiki/default.nix')

@polygon it’s low I guess, but still should work right?

df -h /tmp
Filesystem      Size  Used Avail Use% Mounted on
-               388G  379G  8.2G  98% /tmp

made some space, now that command says 19G available, but still same error

what is permissions situation in /tmp, nix-daemon can access it ?
maybe you also check if it is mounted readonly for some reason ?
systemd logs ?
are you by any chance running this in a vm of some kind, i. e. WSL ?

1 Like

permissions were ok,
wasn’t mounted read only
i think it might have been the usage anyway somehow?

I ran these commands and now it’s good again:

Clear Nix Fetch Cache

sudo nix-store --verify --repair
sudo nix-store --gc
sudo nix-collect-garbage -d