diff --git a/pkgs/os-specific/linux/lxc/default.nix b/pkgs/os-specific/linux/lxc/default.nix index a8668313465..e834a769c78 100644 --- a/pkgs/os-specific/linux/lxc/default.nix +++ b/pkgs/os-specific/linux/lxc/default.nix @@ -67,6 +67,17 @@ stdenv.mkDerivation rec { postInstall = '' wrapPythonPrograms + + completions=( + lxc-attach lxc-cgroup lxc-console lxc-destroy lxc-device lxc-execute + lxc-freeze lxc-info lxc-monitor lxc-snapshot lxc-stop lxc-unfreeze + ) + pushd $out/share/bash-completion/completions/ + mv lxc lxc-start + for completion in ''${completions[@]}; do + ln -sfn lxc-start $completion + done + popd ''; meta = { diff --git a/pkgs/tools/admin/lxd/default.nix b/pkgs/tools/admin/lxd/default.nix index 880ff331c93..9d55e6bdefa 100644 --- a/pkgs/tools/admin/lxd/default.nix +++ b/pkgs/tools/admin/lxd/default.nix @@ -3,6 +3,7 @@ , squashfsTools, iproute, iptables, ebtables, libcap, dqlite , sqlite-replication , writeShellScriptBin, apparmor-profiles, apparmor-parser +, criu , bash }: @@ -33,11 +34,14 @@ buildGoPackage rec { rm $bin/bin/{deps,macaroon-identity,generate} wrapProgram $bin/bin/lxd --prefix PATH : ${stdenv.lib.makeBinPath [ - acl rsync gnutar xz btrfs-progs gzip dnsmasq squashfsTools iproute iptables ebtables bash + acl rsync gnutar xz btrfs-progs gzip dnsmasq squashfsTools iproute iptables ebtables bash criu (writeShellScriptBin "apparmor_parser" '' exec '${apparmor-parser}/bin/apparmor_parser' -I '${apparmor-profiles}/etc/apparmor.d' "$@" '') ]} + + mkdir -p "$bin/share/bash-completion/completions/" + cp -av go/src/github.com/lxc/lxd/scripts/bash/lxd-client "$bin/share/bash-completion/completions/lxc" ''; nativeBuildInputs = [ pkgconfig makeWrapper ];