diff --git a/nixos/modules/services/hardware/udisks2.nix b/nixos/modules/services/hardware/udisks2.nix index c53dbf477742..5c058f1f0a6f 100644 --- a/nixos/modules/services/hardware/udisks2.nix +++ b/nixos/modules/services/hardware/udisks2.nix @@ -71,12 +71,16 @@ in environment.systemPackages = [ pkgs.udisks2 ]; - environment.etc = (mapAttrs' (name: value: nameValuePair "udisks2/${name}" { source = value; } ) configFiles) // { - # We need to make sure /etc/libblockdev/conf.d is populated to avoid + environment.etc = (mapAttrs' (name: value: nameValuePair "udisks2/${name}" { source = value; } ) configFiles) // ( + let + libblockdev = pkgs.udisks2.libblockdev; + majorVer = versions.major libblockdev.version; + in { + # We need to make sure /etc/libblockdev/@major_ver@/conf.d is populated to avoid # warnings - "libblockdev/conf.d/00-default.cfg".source = "${pkgs.libblockdev}/etc/libblockdev/conf.d/00-default.cfg"; - "libblockdev/conf.d/10-lvm-dbus.cfg".source = "${pkgs.libblockdev}/etc/libblockdev/conf.d/10-lvm-dbus.cfg"; - }; + "libblockdev/${majorVer}/conf.d/00-default.cfg".source = "${libblockdev}/etc/libblockdev/${majorVer}/conf.d/00-default.cfg"; + "libblockdev/${majorVer}/conf.d/10-lvm-dbus.cfg".source = "${libblockdev}/etc/libblockdev/${majorVer}/conf.d/10-lvm-dbus.cfg"; + }); security.polkit.enable = true; diff --git a/pkgs/os-specific/linux/udisks/2-default.nix b/pkgs/os-specific/linux/udisks/2-default.nix index 36f0963935bb..07a9ceaa5173 100644 --- a/pkgs/os-specific/linux/udisks/2-default.nix +++ b/pkgs/os-specific/linux/udisks/2-default.nix @@ -83,7 +83,10 @@ stdenv.mkDerivation rec { doCheck = true; - passthru.tests.vm = nixosTests.udisks2; + passthru = { + inherit libblockdev; + tests.vm = nixosTests.udisks2; + }; meta = with lib; { description = "A daemon, tools and libraries to access and manipulate disks, storage devices and technologies";