Help using unstable networkmanager

#1

Hi i want to use the unstable version of networkmanager on my 19.03 release. I added the unstable channel and did the following

{ config, lib, pkgs, ... }:
let
  baseconfig = { allowUnfree = true; };
  unstable = import <unstable> { config= baseconfig; };
in
{
  imports =
    [ 
      <unstable/nixos/modules/services/networking/networkmanager.nix>
    ];
  disabledModules = [ "services/networking/networkmanager.nix" ];
  nixpkgs.config = baseconfig // {
    packageOverrides = pkgs: {
      networkmanager = unstable.networkmanager;
    }; 
  };
  networking.networkmanager.enable = true;
}

but it explodes when i try to nixos-rebuild switch

[99/249] Generating Tracker_C-2.0.gir with a custom command.
g-ir-scanner: link: gcc -o /build/tracker-2.1.8/build/tmp-introspectq804rl9b/Tracker_C-2.0 /build/tracker-2.1.8/build/tmp-introspectq804rl9b/Tracker_C-2.0.o -L. -Wl,-rpath,. -Wl,--no-as-needed -L/build/tracker-2.1.8/build/src/libtracker-sparql-backend -Wl,-rpath,/build/tracker-2.1.8/build/src/libtracker-sparql-backend -L/build/tracker-2.1.8/build/src/libtracker-sparql -Wl,-rpath,/build/tracker-2.1.8/build/src/libtracker-sparql -L/build/tracker-2.1.8/build/src/libtracker-common -Wl,-rpath,/build/tracker-2.1.8/build/src/libtracker-common -L/build/tracker-2.1.8/build/src/libtracker-remote -Wl,-rpath,/build/tracker-2.1.8/build/src/libtracker-remote -L/build/tracker-2.1.8/build/src/libtracker-bus -Wl,-rpath,/build/tracker-2.1.8/build/src/libtracker-bus -L/build/tracker-2.1.8/build/src/libtracker-direct -Wl,-rpath,/build/tracker-2.1.8/build/src/libtracker-direct -L/build/tracker-2.1.8/build/src/libtracker-data -Wl,-rpath,/build/tracker-2.1.8/build/src/libtracker-data -L/build/tracker-2.1.8/build/src/gvdb -Wl,-rpath,/build/tracker-2.1.8/build/src/gvdb -L/nix/store/vfbzpdwyiy0ygmc92af0zgj3m0s6shaw-glib-2.58.2/lib -Wl,-rpath,/nix/store/vfbzpdwyiy0ygmc92af0zgj3m0s6shaw-glib-2.58.2/lib -L/nix/store/ybscfsidg60dnc6gc3vp325xvnqp49za-libxml2-2.9.9/lib -Wl,-rpath,/nix/store/ybscfsidg60dnc6gc3vp325xvnqp49za-libxml2-2.9.9/lib -L/build/tracker-2.1.8/build/src/libtracker-sparql -Wl,-rpath,/build/tracker-2.1.8/build/src/libtracker-sparql -L/build/tracker-2.1.8/build/src/libtracker-common -Wl,-rpath,/build/tracker-2.1.8/build/src/libtracker-common -L/build/tracker-2.1.8/build/src/libtracker-remote -Wl,-rpath,/build/tracker-2.1.8/build/src/libtracker-remote -L/build/tracker-2.1.8/build/src/libtracker-bus -Wl,-rpath,/build/tracker-2.1.8/build/src/libtracker-bus -L/build/tracker-2.1.8/build/src/libtracker-direct -Wl,-rpath,/build/tracker-2.1.8/build/src/libtracker-direct -L/build/tracker-2.1.8/build/src/libtracker-data -Wl,-rpath,/build/tracker-2.1.8/build/src/libtracker-data -L/build/tracker-2.1.8/build/src/gvdb -Wl,-rpath,/build/tracker-2.1.8/build/src/gvdb -L/nix/store/vfbzpdwyiy0ygmc92af0zgj3m0s6shaw-glib-2.58.2/lib -Wl,-rpath,/nix/store/vfbzpdwyiy0ygmc92af0zgj3m0s6shaw-glib-2.58.2/lib -L/nix/store/ybscfsidg60dnc6gc3vp325xvnqp49za-libxml2-2.9.9/lib -Wl,-rpath,/nix/store/ybscfsidg60dnc6gc3vp325xvnqp49za-libxml2-2.9.9/lib -L/build/tracker-2.1.8/build/src/libtracker-sparql-backend -Wl,-rpath,/build/tracker-2.1.8/build/src/libtracker-sparql-backend -L/nix/store/vfbzpdwyiy0ygmc92af0zgj3m0s6shaw-glib-2.58.2/lib -Wl,-rpath,/nix/store/vfbzpdwyiy0ygmc92af0zgj3m0s6shaw-glib-2.58.2/lib -L/nix/store/xbx18r163cbd6jxfv0hcs1r1s5lgz2y7-json-glib-1.4.4/lib -Wl,-rpath,/nix/store/xbx18r163cbd6jxfv0hcs1r1s5lgz2y7-json-glib-1.4.4/lib -L/nix/store/cms59b8gnq1kh6kfxjvrf86xvr81q215-libsoup-2.64.2/lib -Wl,-rpath,/nix/store/cms59b8gnq1kh6kfxjvrf86xvr81q215-libsoup-2.64.2/lib -L/nix/store/ybscfsidg60dnc6gc3vp325xvnqp49za-libxml2-2.9.9/lib -Wl,-rpath,/nix/store/ybscfsidg60dnc6gc3vp325xvnqp49za-libxml2-2.9.9/lib -ltracker-sparql-2.0 -ltracker-sparql-2.0 -lglib-2.0 -lgio-2.0 -lgobject-2.0 -lm -lstemmer -ljson-glib-1.0 -lsoup-2.4 -lxml2 -L/nix/store/vfbzpdwyiy0ygmc92af0zgj3m0s6shaw-glib-2.58.2/lib -lgio-2.0 -lgobject-2.0 -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0
src/libtracker-sparql/tracker-namespace-manager.c:335: Warning: Tracker_C: tracker_namespace_manager_foreach: argument func: Missing (scope) annotation for callback without GDestroyNotify (valid: call, async)
./Tools/TestWebKitAPI/Tests/WebKitGLib/resources/generate-test-cert.sh: interpreter directive changed from "/bin/sh" to "/nix/store/cinw572b38aln37glr0zb8lxwrgaffl4-bash-4.4-p23/bin/sh"
autoreconf: running: /nix/store/xf963939s0zvpz1v8fzhh6gr4k37ikqm-autoconf-2.69/bin/autoheader --force
./Tools/gtkdoc/generate-gtkdoc: interpreter directive changed from "/usr/bin/env python" to "/nix/store/9kigl3bk51mfn0484y72w3zlm7d8ws76-python-2.7.16/bin/python"
./Tools/glib/generate-inspector-gresource-manifest.py: interpreter directive changed from "/usr/bin/env python" to "/nix/store/9kigl3bk51mfn0484y72w3zlm7d8ws76-python-2.7.16/bin/python"
./Tools/gtk/install-dependencies: interpreter directive changed from "/usr/bin/env bash" to "/nix/store/cinw572b38aln37glr0zb8lxwrgaffl4-bash-4.4-p23/bin/bash"
./Source/WebKit/Scripts/process-entitlements.sh: interpreter directive changed from "/bin/bash" to "/nix/store/cinw572b38aln37glr0zb8lxwrgaffl4-bash-4.4-p23/bin/bash"
./Source/WebKit/Scripts/generate-unified-sources.sh: interpreter directive changed from "/bin/sh" to "/nix/store/cinw572b38aln37glr0zb8lxwrgaffl4-bash-4.4-p23/bin/sh"
[100/249] Generating tracker-sparql-gir with a meson_exe.py custom command.
FAILED: src/libtracker-sparql-backend/Tracker-2.0.gir
/nix/store/0mz0dr57n65fdrzlxjm8sjl7acjf9kzh-meson-0.49.1/bin/meson --internal exe /build/tracker-2.1.8/build/meson-private/meson_exe_g-ir-merge_e772c1fc76fc49dbab9fb1f3b737cd1a11e34dbc.dat
Traceback (most recent call last):
  File "/nix/store/0mz0dr57n65fdrzlxjm8sjl7acjf9kzh-meson-0.49.1/bin/meson", line 11, in <module>
    sys.exit(main())
  File "/nix/store/0mz0dr57n65fdrzlxjm8sjl7acjf9kzh-meson-0.49.1/lib/python3.7/site-packages/mesonbuild/mesonmain.py", line 209, in main
    return run(sys.argv[1:], launcher)
  File "/nix/store/0mz0dr57n65fdrzlxjm8sjl7acjf9kzh-meson-0.49.1/lib/python3.7/site-packages/mesonbuild/mesonmain.py", line 198, in run
    return run_script_command(args[1], args[2:])
  File "/nix/store/0mz0dr57n65fdrzlxjm8sjl7acjf9kzh-meson-0.49.1/lib/python3.7/site-packages/mesonbuild/mesonmain.py", line 146, in run_script_command
    return module.run(script_args)
  File "/nix/store/0mz0dr57n65fdrzlxjm8sjl7acjf9kzh-meson-0.49.1/lib/python3.7/site-packages/mesonbuild/scripts/meson_exe.py", line 99, in run
    return run_exe(exe)
  File "/nix/store/0mz0dr57n65fdrzlxjm8sjl7acjf9kzh-meson-0.49.1/lib/python3.7/site-packages/mesonbuild/scripts/meson_exe.py", line 79, in run_exe
    stderr=subprocess.PIPE)
  File "/nix/store/0n8slcq8p5x31kc9hncabsqq9y3fpkzp-python3-3.7.3/lib/python3.7/subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "/nix/store/0n8slcq8p5x31kc9hncabsqq9y3fpkzp-python3-3.7.3/lib/python3.7/subprocess.py", line 1522, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/build/tracker-2.1.8/utils/g-ir-merge/g-ir-merge': '/build/tracker-2.1.8/utils/g-ir-merge/g-ir-merge'
ninja: build stopped: subcommand failed.
./Source/WebKit/Scripts/check-xcfilelists.sh: interpreter directive changed from "/bin/sh" to "/nix/store/cinw572b38aln37glr0zb8lxwrgaffl4-bash-4.4-p23/bin/sh"
builder for '/nix/store/isxq1rkakp11w282i6wz3dkylxd071pj-tracker-2.1.8.drv' failed with exit code 1
cannot build derivation '/nix/store/b2nwa3d7pwv5dbrwkclay8fnnm36jlqz-dbus-1.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/d663ld3zqnadjx8kgs38y67p4bkld94m-nautilus-3.30.5.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/xdvdyzp1y0czf88jc2kiqihkwi039dls-system-path.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/3fy5vr7m342g3fkbc8lwq2z5zyzxy40h-system-units.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/59h3fbd8pbv2l8nik875njqlhkyrspq2-user-units.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/5lxccfk3bkxhhyxvbhygbj4y6wm59vwi-nixos-system-ford-19.03.172500.aade6ded796.drv': 1 dependencies couldn't be built
error: build of '/nix/store/5lxccfk3bkxhhyxvbhygbj4y6wm59vwi-nixos-system-ford-19.03.172500.aade6ded796.drv' failed

any ideas on how to get around this?

#2

I would say the issue is being caused by the fact that running Tracker’s utils/g-ir-merge/g-ir-merge requires Python 3 but it is not listed in Tracker’s dependencies in release-19.03 – it gets there from NetworkManager’s propagated dependencies by accident. That was removed in unstable so by overriding NM, you are breaking something that was working by pure luck.

You can fix it by adding python3 to gnome3.tracker’s nativeBuildInputs.

#3

perfect thank you for advice. my working config

{ config, lib, pkgs, ... }:
let
  unstable = import <unstable> {};
in
{
  imports =
    [ # Include the results of the hardware scan.
      <unstable/nixos/modules/services/networking/networkmanager.nix>
    ];
   disabledModules = [ "services/networking/networkmanager.nix" ];
   nixpkgs.config = {} // {
    packageOverrides = pkgs: {
    networkmanager = unstable.networkmanager.overrideAttrs (o: { propagatedBuildInputs = [pkgs.python3Packages.pygobject3] ++ o.propagatedBuildInputs; } );
    };
  };
  networking.networkmanager.enable = true;
}