Error with safeeyes updating my system. How to debug and solve?

I just did a nix flake update followed by a sudo nixos-rebuild switch --flake .#nixos-dell, and I get this error:

➜  dotfiles-dell git:(master) ✗ ./apply-system.sh
warning: Git tree '/home/stian/devp/dotfiles-dell' is dirty
building the system configuration...
warning: Git tree '/home/stian/devp/dotfiles-dell' is dirty
error: safeeyes should use `buildPythonPackage` or `toPythonModule` if it is to be part of the Python packages set.
(use '--show-trace' to show detailed location information)

I can show the --show-trace output if that helps. The updated flake.lock looks like this:

{
  "nodes": {
    "home-manager": {
      "inputs": {
        "nixpkgs": [
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1667469118,
        "narHash": "sha256-2YrDEmeYKCDOCuDDrjHoaUOVO3hyh9cIrWAJET1HPg8=",
        "owner": "nix-community",
        "repo": "home-manager",
        "rev": "d78b3488a76d251701ab58a9b7f0dd092b806c1e",
        "type": "github"
      },
      "original": {
        "owner": "nix-community",
        "ref": "release-22.05",
        "repo": "home-manager",
        "type": "github"
      }
    },
    "nixpkgs": {
      "locked": {
        "lastModified": 1667482890,
        "narHash": "sha256-pua0jp87iwN7NBY5/ypx0s9L9CG49Ju/NI4wGwurHc4=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "a2a777538d971c6b01c6e54af89ddd6567c055e8",
        "type": "github"
      },
      "original": {
        "id": "nixpkgs",
        "ref": "nixos-unstable",
        "type": "indirect"
      }
    },
    "root": {
      "inputs": {
        "home-manager": "home-manager",
        "nixpkgs": "nixpkgs"
      }
    }
  },
  "root": "root",
  "version": 7
}

By looking in my nix store, I see these:

➜  dotfiles-dell git:(master) ✗ ll /nix/store | grep safeeyes
-r--r--r--     1 root root   5.6K Jan  1  1970 11ncfab368xckdgh0aqksazpa8sglfbj-safeeyes-2.1.3.drv
dr-xr-xr-x     6 root root   4.0K Jan  1  1970 6a45z09zf6f1mgg7r4f39pbx57cnyrzf-safeeyes-2.1.3
-r--r--r--     1 root root   2.8K Jan  1  1970 bn340bc19jyiznjj6ny6gs7mv088mbd7-safeeyes-2.1.3.tar.gz.drv
-r--r--r--     1 root root   2.8K Jan  1  1970 j5ipkdcdli6dmiy0rk889bizgrzpm03y-safeeyes-2.1.3.tar.gz.drv
-r--r--r--     1 root root   5.8K Jan  1  1970 wspmzmlknkdqzwh7n45lzn698gwkmilf-safeeyes-2.1.3.drv

From googling I found that there’s a command nix-store --query --referrers-close /nix/store/something which if I understand it correctly shows which other packages depend upon it. Trying that, I see this:

➜  dotfiles-dell git:(master) ✗ nix-store --query --referrers-closure /nix/store/6a45z09zf6f1mgg7r4f39pbx57cnyrzf-safeeyes-2.1.3 | cat
/nix/store/6a45z09zf6f1mgg7r4f39pbx57cnyrzf-safeeyes-2.1.3
/nix/store/x6r7wzba6sk6bdiqpyb0a08903yzc0i5-system-path
/nix/store/1z7202b0j50a3laikiyazdbk34wl5ps5-dbus-1
/nix/store/4fhn3sz5r3l8rqway9si0n9mi7akn006-unit-dbus.service
/nix/store/h7gdzzwiv3dldbcnmq1lv2yijjpzhh8s-unit-accounts-daemon.service
/nix/store/s8aflynwy2wmpw38cqgzzyxwwvhga82c-unit-systemd-fsck-.service
/nix/store/x0hzc85gfzil16s6mxaf29k2qzrc9nnw-unit-polkit.service
/nix/store/92y7vc0jva0am6a9v2pm0gq8sydk14gi-system-units
/nix/store/wz59bjxi5z2xjk0yfiyl62g71vkk1w80-unit-dbus.service
/nix/store/r51azry07bmz37cbba8yr44vqippq904-user-units
/nix/store/rg8bdfbic6qigsan3pgxn4laivhkapy5-system-units
/nix/store/rabx3iqx9nqabbv7q1gydg8zrf6jks2p-etc
/nix/store/a49maqasf1y07wc2bqvmck0wzzclcww3-nixos-system-nixos-dell-22.11.20221015.83b198a
/nix/store/c9xw3bnki85lpmzv3xy8ky90cwk8fqgb-etc
/nix/store/rac5rr43s04qnr7nf53ab2343dmf7m8m-nixos-system-nixos-dell-22.11.20221015.83b198a

By looking at my current system:

➜  dotfiles-dell git:(master) ✗ ll /run/current-system
lrwxrwxrwx 1 root root 90 Nov  5 13:01 /run/current-system -> /nix/store/rac5rr43s04qnr7nf53ab2343dmf7m8m-nixos-system-nixos-dell-22.11.20221015.83b198a

which is the same as the last line in the previous nix-store command, I’m convinced that my current system depends on safeeyes. And it seems to be due to the system itself, not some package that I have defined in in my configuration.nix.

My questions:

  1. Is my above analysis correct?
  2. How could I begin to solve this?
  3. Can I tell nix flake update to try a version that’s a bit older? So that I don’t get the very newest, which has this thing that fails, but a slightly older one?

Thanks!

Kind of, but “the system itself” is just all the packages you have defined in configuration.nix, so it’s a bit tautologous and doesn’t actually give you anything actionable.

I have to admit I’m not 100% on the differences between the commands, but could you try:

nix why-depends /run/current-system /nix/store/6a45z09zf6f1mgg7r4f39pbx57cnyrzf-safeeyes-2.1.3

It’s quite possible they just end up giving you the same information, but I’ve found that output much easier to grok in the past. Perhaps add --all if it’s still not clear where the dependency comes from.

I’d probably figure out what depends on it, and think really hard about whether I need it in the short term, and then remove it if I decide it’s not useful anymore.

Actually fixing the problem involves moving the package: I can't update my system due to buildPythonPackage - #11 by FRidh

You’d probably create an issue/PR to do that upstream, see if the maintainer wants to take it/is still active. And then go through the process of actually merging something upstream.

Another short term solution may also be to just copy the package definition and carry it downstream while the dust settles on upstream reshuffling. Or maybe consider switching to stable, packages aren’t allowed to just move/break like that without a release there, so it’s all still working.

Not with the command, but you can change your input to specify a specific revision with the ?rev syntax, see some examples here: nix flake

1 Like

Thank you very much for that detailed answer! :pray:

It’s great to learn about that why-depends command! Here’s the output:

➜  ~ nix why-depends /run/current-system /nix/store/6a45z09zf6f1mgg7r4f39pbx57cnyrzf-safeeyes-2.1.3 | cat
/nix/store/56dpkk5970k1bpzgwnjrf034c7rbkjya-nixos-system-nixos-dell-22.11.20221015.83b198a
└───/nix/store/x6r7wzba6sk6bdiqpyb0a08903yzc0i5-system-path
    └───/nix/store/6a45z09zf6f1mgg7r4f39pbx57cnyrzf-safeeyes-2.1.3

I don’t know what system-path is. From looking at ls -ahl /nix/store/x6r7wzba6sk6bdiqpyb0a08903yzc0i5-system-path/bin, It looks like it’s the collection of all the paths in my current system.

➜  ~ ls -ahl /nix/store/x6r7wzba6sk6bdiqpyb0a08903yzc0i5-system-path/bin | wc -l
1258

So maybe the nix-store --query --referrers-closure /nix/store/6a45z09zf6f1mgg7r4f39pbx57cnyrzf-safeeyes-2.1.3 | cat command gives me more information (just repeating the output from my first post):

➜  ~ nix-store --query --referrers-closure /nix/store/6a45z09zf6f1mgg7r4f39pbx57cnyrzf-safeeyes-2.1.3 | cat
/nix/store/6a45z09zf6f1mgg7r4f39pbx57cnyrzf-safeeyes-2.1.3
/nix/store/x6r7wzba6sk6bdiqpyb0a08903yzc0i5-system-path
/nix/store/1z7202b0j50a3laikiyazdbk34wl5ps5-dbus-1
/nix/store/4fhn3sz5r3l8rqway9si0n9mi7akn006-unit-dbus.service
/nix/store/h7gdzzwiv3dldbcnmq1lv2yijjpzhh8s-unit-accounts-daemon.service
/nix/store/s8aflynwy2wmpw38cqgzzyxwwvhga82c-unit-systemd-fsck-.service
/nix/store/x0hzc85gfzil16s6mxaf29k2qzrc9nnw-unit-polkit.service
/nix/store/8adyldxc7ny4vks2ishrwprjsj4gn3s2-system-units
/nix/store/wz59bjxi5z2xjk0yfiyl62g71vkk1w80-unit-dbus.service
/nix/store/r51azry07bmz37cbba8yr44vqippq904-user-units
/nix/store/r27s6xi99d4g0r2ycsj88frhq5mw1hnx-etc
/nix/store/56dpkk5970k1bpzgwnjrf034c7rbkjya-nixos-system-nixos-dell-22.11.20221015.83b198a
/nix/store/92y7vc0jva0am6a9v2pm0gq8sydk14gi-system-units
/nix/store/c9xw3bnki85lpmzv3xy8ky90cwk8fqgb-etc
/nix/store/rac5rr43s04qnr7nf53ab2343dmf7m8m-nixos-system-nixos-dell-22.11.20221015.83b198a

If I understand that output correctly, then something related to a systemd unit file (something with dbus?) is depending on safeeyes.

Kind of, but “the system itself” is just all the packages you have defined in configuration.nix , so it’s a bit tautologous and doesn’t actually give you anything actionable.

What I meant with “the system itself” was that it’s something related to NixOS itself, and not something I can remove. In other words: It doesn’t seem to me like this is something that I’ve added in my configuration.nix.

Even so: What I can try is to remove more and more things from my configuration.nix and see if the error ever disappears. I’ll try that now.

There are not many things like that, if any :slight_smile: Even the Linux kernel or the nix package manager aren’t “something related to NixOS itself”. After all, you can build docker images using NixOS.

Even if such things existed:

Protect your eyes from eye strain using this simple and beautiful, yet extensible break reminder. A Free and Open Source Linux alternative to EyeLeo

That doesn’t sound like some fundamental system package :wink:

Looking at it, it seems to basically be a GNOME plugin: Safe Eyes

Maybe some productivity suite thing you have enabled for it? Or maybe you have it in an environment.systemPackage and are just overlooking it.

For reference, I’m pretty sure /nix/store/x6r7wzba6sk6bdiqpyb0a08903yzc0i5-system-path does just mean anything included in environment.systemPackages, so some option directly adds it.

1 Like

Thanks! I just confirmed, by removing everything in my environment.systemPackages, that I was able to build :slight_smile: Now I need to figure out exactly which package it is that’s causing this. I was hoping that there was some variant of nix-store --query --referrers-closure or nix why-depends that would show me a dependency graph. What I’ll do right now though is to just comment some packages out and try to rebuild.

Well this is very embarrassing. I was actually depending upon safeeyes directly, in my environment.systemPackages. Removing that made it possible to build. I guess that nix-store --query --referrers-close and nix why-depends really do work the way I wanted :sweat_smile:

1 Like