nixos/zfs: Fix references to zfs packages now that they are split

This commit is contained in:
William A. Kennington III 2015-02-07 15:07:30 -08:00
parent 15cf03a8ee
commit 0fa4c9d6d3

View file

@ -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}"
'';
};