From 0fa4c9d6d3bd453634d02438b60daebeeaa02a7b Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Sat, 7 Feb 2015 15:07:30 -0800 Subject: [PATCH] nixos/zfs: Fix references to zfs packages now that they are split --- nixos/modules/tasks/filesystems/zfs.nix | 29 +++++++++++++------------ 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix index ab5942b7945..1ac89c4c255 100644 --- a/nixos/modules/tasks/filesystems/zfs.nix +++ b/nixos/modules/tasks/filesystems/zfs.nix @@ -21,11 +21,12 @@ let kernel = config.boot.kernelPackages; - splPkg = if cfgZfs.useGit then kernel.spl_git else kernel.spl; - zfsPkg = if cfgZfs.useGit then kernel.zfs_git else kernel.zfs; + splKernelPkg = if cfgZfs.useGit then kernel.spl_git else kernel.spl; + zfsKernelPkg = if cfgZfs.useGit then kernel.zfs_git else kernel.zfs; + zfsUserPkg = if cfgZfs.useGit then pkgs.zfs_git else pkgs.zfs; autosnapPkg = pkgs.zfstools.override { - zfs = zfsPkg; + zfs = zfsUserPkg; }; zfsAutoSnap = "${autosnapPkg}/bin/zfs-auto-snapshot"; @@ -195,17 +196,17 @@ in boot = { kernelModules = [ "spl" "zfs" ] ; - extraModulePackages = [ splPkg zfsPkg ]; + extraModulePackages = [ splKernelPkg zfsKernelPkg ]; }; boot.initrd = mkIf inInitrd { kernelModules = [ "spl" "zfs" ]; extraUtilsCommands = '' - cp -v ${zfsPkg}/sbin/zfs $out/bin - cp -v ${zfsPkg}/sbin/zdb $out/bin - cp -v ${zfsPkg}/sbin/zpool $out/bin - cp -pdv ${zfsPkg}/lib/lib*.so* $out/lib + cp -v ${zfsUserPkg}/sbin/zfs $out/bin + cp -v ${zfsUserPkg}/sbin/zdb $out/bin + cp -v ${zfsUserPkg}/sbin/zpool $out/bin + cp -pdv ${zfsUserPkg}/lib/lib*.so* $out/lib cp -pdv ${pkgs.zlib}/lib/lib*.so* $out/lib ''; postDeviceCommands = concatStringsSep "\n" (['' @@ -228,12 +229,12 @@ in zfsSupport = true; }; - environment.etc."zfs/zed.d".source = "${zfsPkg}/etc/zfs/zed.d/*"; + environment.etc."zfs/zed.d".source = "${zfsUserPkg}/etc/zfs/zed.d/*"; - system.fsPackages = [ zfsPkg ]; # XXX: needed? zfs doesn't have (need) a fsck - environment.systemPackages = [ zfsPkg ]; - services.udev.packages = [ zfsPkg ]; # to hook zvol naming, etc. - systemd.packages = [ zfsPkg ]; + system.fsPackages = [ zfsUserPkg ]; # XXX: needed? zfs doesn't have (need) a fsck + environment.systemPackages = [ zfsUserPkg ]; + services.udev.packages = [ zfsUserPkg ]; # to hook zvol naming, etc. + systemd.packages = [ zfsUserPkg ]; systemd.services = let getPoolFilesystems = pool: @@ -260,7 +261,7 @@ in RemainAfterExit = true; }; script = '' - zpool_cmd="${zfsPkg}/sbin/zpool" + zpool_cmd="${zfsUserPkg}/sbin/zpool" ("$zpool_cmd" list "${pool}" >/dev/null) || "$zpool_cmd" import -N ${optionalString cfgZfs.forceImportAll "-f"} "${pool}" ''; };