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