nixos/kubeswitch: use 'runCommand' instead of 'phases'
This commit is contained in:
parent
7e151ba980
commit
f498f8ef4a
@ -29,17 +29,13 @@ in
|
||||
|
||||
config =
|
||||
let
|
||||
shell_files = pkgs.stdenv.mkDerivation rec {
|
||||
name = "kubeswitch-shell-files";
|
||||
phases = [ "installPhase" ];
|
||||
installPhase = ''
|
||||
mkdir -p $out/share
|
||||
for shell in bash zsh; do
|
||||
${cfg.package}/bin/switcher init $shell | sed 's/switch(/${cfg.commandName}(/' > $out/share/${cfg.commandName}_init.$shell
|
||||
${cfg.package}/bin/switcher --cmd ${cfg.commandName} completion $shell > $out/share/${cfg.commandName}_completion.$shell
|
||||
done
|
||||
'';
|
||||
};
|
||||
shell_files = pkgs.runCommand "kubeswitch-shell-files" {} ''
|
||||
mkdir -p $out/share
|
||||
for shell in bash zsh; do
|
||||
${cfg.package}/bin/switcher init $shell | sed 's/switch(/${cfg.commandName}(/' > $out/share/${cfg.commandName}_init.$shell
|
||||
${cfg.package}/bin/switcher --cmd ${cfg.commandName} completion $shell > $out/share/${cfg.commandName}_completion.$shell
|
||||
done
|
||||
'';
|
||||
in
|
||||
lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
|
Loading…
Reference in New Issue
Block a user