nixos/zfs: Fix references to zfs packages now that they are split
This commit is contained in:
parent
15cf03a8ee
commit
0fa4c9d6d3
@ -21,11 +21,12 @@ let
|
|||||||
|
|
||||||
kernel = config.boot.kernelPackages;
|
kernel = config.boot.kernelPackages;
|
||||||
|
|
||||||
splPkg = if cfgZfs.useGit then kernel.spl_git else kernel.spl;
|
splKernelPkg = if cfgZfs.useGit then kernel.spl_git else kernel.spl;
|
||||||
zfsPkg = if cfgZfs.useGit then kernel.zfs_git else kernel.zfs;
|
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 {
|
autosnapPkg = pkgs.zfstools.override {
|
||||||
zfs = zfsPkg;
|
zfs = zfsUserPkg;
|
||||||
};
|
};
|
||||||
|
|
||||||
zfsAutoSnap = "${autosnapPkg}/bin/zfs-auto-snapshot";
|
zfsAutoSnap = "${autosnapPkg}/bin/zfs-auto-snapshot";
|
||||||
@ -195,17 +196,17 @@ in
|
|||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
kernelModules = [ "spl" "zfs" ] ;
|
kernelModules = [ "spl" "zfs" ] ;
|
||||||
extraModulePackages = [ splPkg zfsPkg ];
|
extraModulePackages = [ splKernelPkg zfsKernelPkg ];
|
||||||
};
|
};
|
||||||
|
|
||||||
boot.initrd = mkIf inInitrd {
|
boot.initrd = mkIf inInitrd {
|
||||||
kernelModules = [ "spl" "zfs" ];
|
kernelModules = [ "spl" "zfs" ];
|
||||||
extraUtilsCommands =
|
extraUtilsCommands =
|
||||||
''
|
''
|
||||||
cp -v ${zfsPkg}/sbin/zfs $out/bin
|
cp -v ${zfsUserPkg}/sbin/zfs $out/bin
|
||||||
cp -v ${zfsPkg}/sbin/zdb $out/bin
|
cp -v ${zfsUserPkg}/sbin/zdb $out/bin
|
||||||
cp -v ${zfsPkg}/sbin/zpool $out/bin
|
cp -v ${zfsUserPkg}/sbin/zpool $out/bin
|
||||||
cp -pdv ${zfsPkg}/lib/lib*.so* $out/lib
|
cp -pdv ${zfsUserPkg}/lib/lib*.so* $out/lib
|
||||||
cp -pdv ${pkgs.zlib}/lib/lib*.so* $out/lib
|
cp -pdv ${pkgs.zlib}/lib/lib*.so* $out/lib
|
||||||
'';
|
'';
|
||||||
postDeviceCommands = concatStringsSep "\n" ([''
|
postDeviceCommands = concatStringsSep "\n" ([''
|
||||||
@ -228,12 +229,12 @@ in
|
|||||||
zfsSupport = true;
|
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
|
system.fsPackages = [ zfsUserPkg ]; # XXX: needed? zfs doesn't have (need) a fsck
|
||||||
environment.systemPackages = [ zfsPkg ];
|
environment.systemPackages = [ zfsUserPkg ];
|
||||||
services.udev.packages = [ zfsPkg ]; # to hook zvol naming, etc.
|
services.udev.packages = [ zfsUserPkg ]; # to hook zvol naming, etc.
|
||||||
systemd.packages = [ zfsPkg ];
|
systemd.packages = [ zfsUserPkg ];
|
||||||
|
|
||||||
systemd.services = let
|
systemd.services = let
|
||||||
getPoolFilesystems = pool:
|
getPoolFilesystems = pool:
|
||||||
@ -260,7 +261,7 @@ in
|
|||||||
RemainAfterExit = true;
|
RemainAfterExit = true;
|
||||||
};
|
};
|
||||||
script = ''
|
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}"
|
("$zpool_cmd" list "${pool}" >/dev/null) || "$zpool_cmd" import -N ${optionalString cfgZfs.forceImportAll "-f"} "${pool}"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user