nixos/kubeswitch: use 'runCommand' instead of 'phases'

This commit is contained in:
Felix Buehler
2024-04-30 23:01:23 +02:00
parent 7e151ba980
commit f498f8ef4a

View File

@@ -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 ];