"1 dependencies couldn't be built": how do you debug?

Hi everyone!

I’m new to the NixOS, and I hope to be part of its community… but not until I reach to install it :stuck_out_tongue:

I’ve used examples across the Internet to make my own configuration.nix. Here it is :

{ config, pkgs, ... }:

{
    imports = [
        ./hardware-configuration.nix  # Include the results of the hardware scan.
    ];

    nixpkgs.config.allowUnfree = true;

    boot = {
        cleanTmpDir = true; # Clean /tmp at boot time
        loader = {
            efi = {
                canTouchEfiVariables = true; # Allow EFI variable modifications
                efiSysMountPoint = "/boot";
            };
            grub = {
                enable = true;
                efiSupport = true;
                useOSProber = true; # Make other OSs available
                version = 2;
                device = "/dev/disk/by-label/boot";
                theme = pkgs.nixos-grub2-theme;
            };
        };
    };

    networking = {
        hostName = "Dauthdaert";
        networkmanager.enable = true;
        useDHCP = false; # global useDHCP flag is deprecated
        interfaces.enp5s0.useDHCP = true;


        firewall = {
            enable = true;
            /*
            allowedTCPPorts = [];
            allowedUDPPorts = [];
            */
        };
    };

    /* hardware.pulseaudio = {
        extraModules = [ pkgs.pulseaudio-modules-bt ];
        package = pkgs.pulseaudioFull; # support for bluetooth headsets
    };
    hardware.bluetooth.enable = true; */
    sound.enable = true;
    hardware.pulseaudio.enable = true;

    hardware.opengl.driSupport32Bit = true;
    hardware.pulseaudio.support32Bit = true;

    console = {
        keyMap = "fr";
        font = "Lat2-Terminus16";
        earlySetup = true;
    };

    i18n.defaultLocale = "fr_FR.UTF-8";

    time.timeZone = "Europe/Paris";
    time.hardwareClockInLocalTime = true;

    environment.variables = {
        XDG_CONFIG_HOME = "$HOME/.config";
        XDG_DATA_HOME = "$HOME/.local/share";
        XDG_CACHE_HOME = "$HOME/.cache";
        XDG_DESKTOP_DIR = "$HOME/board";
        XDG_DOWNLOAD_DIR = "$HOME/dl";
        XDG_TEMPLATES_DIR = "$HOME/layout";
        XDG_PUBLICSHARE_DIR = "$HOME/everyone";
        XDG_DOCUMENTS_DIR = "$HOME/files";
        XDG_MUSIC_DIR = "$HOME/zic";
        XDG_PICTURES_DIR = "$HOME/pic";
        XDG_VIDEOS_DIR = "$HOME/vid";

        TERMINAL = "alacritty";
    };

    users.defaultUserShell = pkgs.zsh;

    services = {
        xserver = {
            enable = true;
            exportConfiguration = true;       # symlink the config to /etc/X11/xorg.conf
            layout = "fr";

            displayManager = {
                sddm.enable = true;
                sddm.theme = "clairvoyance";
                defaultSession = "none+awesome";
            };

            windowManager.awesome = {
                enable = true;
                luaModules = with pkgs.luaPackages; [
                    luarocks # package manager for Lua modules
                    /* luadbi-mysql # Database abstraction layer #What for ? */
                ];
            };

            /* synaptics = {
                twoFingerScroll = true;         # Two finger scroll for touchpad
                horizTwoFingerScroll = true;    # Two finger horizontal scrolling
            }; */
        };

        avahi = {
            enable = true;
            nssmdns = true;
        };

        openssh = {
            enable = true;
            forwardX11 = true; # Allow Helgrind/Dauthdaert to connect to each other
            allowSFTP = false; # I have syncthing
        };

        picom = {
            enable = true;
            shadow = true;
            fade = true;
            fadeDelta = 2;
        };

        devmon.enable = true;               # Auto mount USBs

        syncthing = {
            enable = true;
            openDefaultPorts = true;
            /* relay.enable = true; */
            user = "sinux";
        };
    };

    security.sudo = {
        enable = true;
        wheelNeedsPassword = true;
    };

    users.users.sinux = {
        isNormalUser = true;
        uid = 1000;
        group = "sinux";
        shell = pkgs.zsh;
        extraGroups = [
            "wheel" #for sudo
            "video" # 2D/3D hardware acceleration & camera
            "audio" # Access sound hardware
            /* "libvirtd"
            "kvm"
            "adbusers" */
            "docker"
            "storage" # Access storage devices
        ];
    };

    /*
    fileSystems = [
        "/".label = "nixos";
        "/boot".label = "boot";
    ];
    */

    # LOCKING
    /* programs.slock.enable = true; */
    /* services.logind.extraConfig = ''
        HandlePowerKey=hibrid-sleep
        IdleAction=hybrid-sleep
        IdleActionSec=30min
    ''; */
    /* systemd.services.locking = { #Not with SSDM...
        description = "Lock screen before sleep with slock";
        wantedBy = "suspend.targer";
        before = "suspend.targer";
        serviceConfig.Type = "oneshot";
        User = "root";
        script = "slock";
    }; */

    programs = {
        zsh = {
            shellAliases = {
                ls = "exa";
                cat = "bat";
                vim = "nvr";
            };
            enableCompletion = true;
        };
    };

    virtualisation.docker.enable = true;

    environment.systemPackages = with pkgs; [
        ## COMMAND LINE

        docker-compose
        bat # Better cat
        fzf # Search through files
        feh # Image viewer
        git # Obvious
        gnumake # 'make' command to build executables
        htop # Better top
        neovim-remote # Remotely control neovim
        rofi # Window switcher & App launcher
        tree # Print file tree in terminal
        zip # Command to zip files
        unzip # Command to unzip files
        wget # Download web files

        ## APPLICATIONS
        arandr # GUI for xrandr
        filelight # View disk usage
        inkscape # Vector artwork
        vivaldi # Browser
        alacritty # Terminal
        vlc # Media player
        thunderbird # email client

        gparted # Partition manager
        libreoffice # More word processing
        pavucontrol # Pulse Audio controller

        minecraft # Minecraft
        openjdk # Java Development Kit for Java
        python3 # Python 3.6.8

        nodejs                              # Node.JS
        #nodePackages.vue-cli                # Vue.JS package

        ## SYSTEM TOOLS
        alsaUtils
        ntfs3g # NTFS support

        ##DICTIONARIES
        hunspell
        hunspellDicts.en-us
        hunspellDicts.en-gb-large
        hunspellDicts.fr-any
     ];

     fonts = {
        fonts = with pkgs; [
          #noto-fonts-emoji
          font-awesome_4                    # Fancy icons font
          ipafont                           # Japanese font
          siji                              # Iconic bitmap font
          symbola                           # Braille support for gotop command

          ### Programming ligatures ################################################
          # *This means that -> will look like an actual arrow and >= and <=       #
          # actually look like less than or equal and greater than or equal        #
          # symbols, as opposed to what they look like on a computer               #
          ##########################################################################

          #fira-code-symbols                 # Fancy font with programming ligatures
          #fira-code                         # Fancy font with programming ligatures
          powerline-fonts                   # Fonts for powerlines (Used in my tty)
        ];

        fontconfig.defaultFonts.monospace = [
          "Fira Code Medium"                # Set default font as Fira Code Medium
          "Symbola"                         # Use Symbola as fallback font
          "IPAGothic"                       # Use IPAGothic as fallback font
        ];

        fontconfig.defaultFonts.emoji = [
          "Noto Color Emoji"
          #"JoyPixels"
        ];
    };

    system.stateVersion = "21.05";
}

But I have multiple times the error “1 dependencies couldn’t be built”. Here is the full log : http://termbin.com/eemp

Just so you know, I’m installing in dual boot with Windows.

So first question: In this kind of situation, how would one debug which derivation is causing the issue?
Second: How do you fix it? :upside_down_face:

Thanks for the help and write to you soon!
Sinux.

The logs say

getting attributes of path '/nix/store/rya2s79k5ncqbas09rwhq43lrbr4s3m0-mailcap-2.1.52': No such file or directory

It looks like file system corruption. Maybe an FSCK should help?

Also, as a rule of thumb, try a minimal example.

Sounds as if you are affected by nixos-install fails with getting attributes of path /nix/store/...: No such file or directory · Issue #126141 · NixOS/nixpkgs · GitHub

Okey, so I looked at the issue and the following recommandation almost worked:

nix-build '<nixpkgs/nixos>' -A config.system.build.toplevel -I nixos-config=/mnt/etc/nixos/configuration.nix

When I run nixos-install after that previous command, I get :

building the configuration in /mnt/etc/nixos/configuration.nix...
/nix/store/skbzr1f0pp6xy7akxa6iafxkj28iyn42-nixos-system-Dauthdaert-21.05.1412.cf59fbd5396
copying channel...
installing the boot loader...
setting up /etc...
updating GRUB 2 menu...
Warning: os-prober will be executed to detect other bootable partitions.
It's output will be used to detect bootable binaries on them and create new boot entries.
lsblk: /dev/mapper/no*[0-9]: not a block device
lsblk: /dev/mapper/raid*[0-9]: not a block device
lsblk: /dev/mapper/disks*[0-9]: not a block device
installing the GRUB 2 boot loader on /dev/disk/by-label/boot...
Installing for i386-pc platform.
/nix/store/g6v6q3nrgiaxqa9p9zivykp8vqr3mazi-grub-2.06-rc1/sbin/grub-install: warning: cannot open directory `/nix/store/g6v6q3nrgiaxqa9p9zivykp8vqr3mazi-grub-2.06-rc1/share/locale': No such file or directory.
/nix/store/g6v6q3nrgiaxqa9p9zivykp8vqr3mazi-grub-2.06-rc1/sbin/grub-install: warning: File system `fat' doesn't support embedding.
/nix/store/g6v6q3nrgiaxqa9p9zivykp8vqr3mazi-grub-2.06-rc1/sbin/grub-install: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
/nix/store/g6v6q3nrgiaxqa9p9zivykp8vqr3mazi-grub-2.06-rc1/sbin/grub-install: error: will not proceed with blocklists.
/nix/store/nvycxmg4g2q5jyqdxfvkgi95sqs48iw3-install-grub.pl: installation of GRUB on /dev/disk/by-label/boot failed: No such file or directory

But even with nix-store --repair-path, I can’t fix grub-2.06-rc1: there is no /share/locale directory…

FSCK don’t seems to be the solution, but I keep your recommandation (trying a minimal example) in mind, thanks :smiley:

It definitely looks like your nix store is corrupted. --repair-path should normally fix that, but since it doesn’t, have you tried the nuclear option of --verify --repair, and naybe --verify --check-contents --repair? It’ll take a while but should make sure any problems are resolved, if there’s still something broken after that you’ve found a bug.

if this is not software failure, could be bad hardware, mabe ram. Installing an OS is high load, and punishes the system, if you system was ‘on the edge’, install an OS will push it over the edge.

Run some diagnostics, and memtest. Just because windows works on your system means very little… you got any other hardware you can install for ‘testing’, while you get to grips with things.

Last time i had a dual boot with windblow, windows decided to trash my unix boot, for no particular reason…i’m not sure if that was by design, or by accident…

only time will tell.

I won’t say it’s not hardware failure, there’s always a chance, but it seems unlikely that hardware failure would manifest as only specific paths in /nix/store disappearing, with no other symptoms and apparently normal function after using the restore command on a specific path.

Much more likely that the share directory just isn’t a direct part of that particular path.

I’d expect at least a complaint or two from the kernel on the tty accompanying this, and nothing of the sort is mentioned. Unless this was an ssh install, but still, these symptoms seem extremely unlikely for hardware failure. Let’s not call the computer broken because someone accidentally deleted a store path.

Okey, so I did nix-store --verify --check-contents --repair and I still get

/nix/store/g6v6q3nrgiaxqa9p9zivykp8vqr3mazi-grub-2.06-rc1/sbin/grub-install: warning: cannot open directory `/nix/store/g6v6q3nrgiaxqa9p9zivykp8vqr3mazi-grub-2.06-rc1/share/locale': No such file or directory.

I guess I’ll have to “feed” the issue @NobbZ mentioned ?

It would be really weird, I bought my computer on january, and it has 16 Go of RAM.

I’m actually installing on an external HDD, before installing on a NVMe in my computer.
I’m installing from a USB stick with nixos-minimal-21.05.1412.cf59fbd5396-x86_64-linux.iso. I tried with 2 different USB sticks with different methods (dd first, Ventoy second).

So I guess I could install NixOS on the same HDD but from a different computer, but I doubt it will change anything :worried:

external usb hhd’s can be garbage, some of the cheaper usb caddys are made of pure chinesium, and don’t work that well over sustained load.

usb disconnects are common problem, i’ve got a feeling install onto a ‘proper’ OS boot device might solve your problem.

1 Like

Okey, so I tried to install to my internal NVMe directly, and it failed again due to grub share/locale missing directory

I still have no solution to install NixOS, so I’d like to investigate why (and where) the folder is missing. I saw that all NixOS derivation are in a repo on github (pixpkgs) but when I look up for “grub”, a bunch of files are returned.
Which file should I look at to understand how g6v6q3nrgiaxqa9p9zivykp8vqr3mazi-grub-2.06-rc1 is made ?

very strange, post your configuration.nix

this might be some bios/EFI bugs, or something not quite playing ball with the bootloader nixos uses.

I wonder if it is related to secure boot, and missing keys which i’ve seen before.

You can look for packages here: grub2

Clicking on the “source” link will then take you to the derivation on GitHub.

GitHub also has two search menus, the one you used is basically grep. The useful one is “Go to file”. That, or just clone the repository and use find :wink:

2 Likes

My full config is available in the first post, here is the revelant part:

That’s an amazing tip, thank you ! :smiley:

Obvioulsy I meant “relevant”…

I tried to set boot.loader.efi.efiSysMountPoint to “/boot/efi” but without success. Maybe I forgot something in the grub configuration?