From f498f8ef4a0142acacbe9b945f3939efb6670b58 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Tue, 30 Apr 2024 23:01:23 +0200 Subject: [PATCH] nixos/kubeswitch: use 'runCommand' instead of 'phases' --- nixos/modules/programs/kubeswitch.nix | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/nixos/modules/programs/kubeswitch.nix b/nixos/modules/programs/kubeswitch.nix index 304df48e3c11..9348540022f2 100644 --- a/nixos/modules/programs/kubeswitch.nix +++ b/nixos/modules/programs/kubeswitch.nix @@ -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 ];