diff --git a/nixos/modules/services/network-filesystems/ceph.nix b/nixos/modules/services/network-filesystems/ceph.nix index fa9c7955afde..c5d7e365fe67 100644 --- a/nixos/modules/services/network-filesystems/ceph.nix +++ b/nixos/modules/services/network-filesystems/ceph.nix @@ -45,8 +45,6 @@ let partOf = [ "ceph-${daemonType}.target" ]; wantedBy = [ "ceph-${daemonType}.target" ]; - path = [ pkgs.getopt ]; - # Don't start services that are not yet initialized unitConfig.ConditionPathExists = "/var/lib/${stateDirectory}/keyring"; startLimitBurst = diff --git a/pkgs/by-name/ce/ceph/package.nix b/pkgs/by-name/ce/ceph/package.nix index 4f8371cd7d2b..3003e8893957 100644 --- a/pkgs/by-name/ce/ceph/package.nix +++ b/pkgs/by-name/ce/ceph/package.nix @@ -52,6 +52,7 @@ cunit, e2fsprogs, doxygen, + getopt, gperf, graphviz, gnugrep, @@ -518,6 +519,10 @@ stdenv.mkDerivation { substituteInPlace src/client/fuse_ll.cc \ --replace-fail "mount -i -o remount" "${util-linux}/bin/mount -i -o remount" + substituteInPlace src/{ceph-osd-prestart.sh,ceph-post-file.in,init-ceph.in} \ + --replace-fail "GETOPT=/usr/local/bin/getopt" "GETOPT=${getopt}/bin/getopt" \ + --replace-fail "GETOPT=getopt" "GETOPT=${getopt}/bin/getopt" + # The install target needs to be in PYTHONPATH for "*.pth support" check to succeed export PYTHONPATH=$PYTHONPATH:$lib/${sitePackages}:$out/${sitePackages} patchShebangs src/ @@ -584,6 +589,10 @@ stdenv.mkDerivation { # silently drop it with misconfigurations. test -f $out/bin/ceph-volume + # Assert that getopt patch from preConfigure covered all instances + ! grep -F -r 'GETOPT=getopt' $out + ! grep -F -r 'GETOPT=/usr/local/bin/getopt' $out + mkdir -p $client/{bin,etc,${sitePackages},share/bash-completion/completions} cp -r $out/bin/{ceph,.ceph-wrapped,rados,rbd,rbdmap} $client/bin cp -r $out/bin/ceph-{authtool,conf,dencoder,rbdnamer,syn} $client/bin