From 687c37c3bf1793256bbb979b4283da2b7425020b Mon Sep 17 00:00:00 2001 From: Mike Vink Date: Tue, 24 Jan 2023 14:54:49 +0000 Subject: fix kubeconfig-merge --- shell-scripts.nix | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'shell-scripts.nix') diff --git a/shell-scripts.nix b/shell-scripts.nix index 5cec1eb..32d77d0 100644 --- a/shell-scripts.nix +++ b/shell-scripts.nix @@ -1,11 +1,23 @@ -{pkgs, ...}: +{pkgs, config, ...}: with builtins; let script-names = attrNames (readDir ./shell-scripts); package = ( - filename: let - contents = readFile ./shell-scripts/${filename}; + filename: with pkgs; let in - pkgs.writeShellScriptBin filename contents + stdenv.mkDerivation { + name = filename; + + buildCommand = '' + install -Dm755 $script $out/bin/${filename} + ''; + + script = substituteAll { + src = ./shell-scripts/${filename}; + isExecutable = true; + inherit bash; + home = config.home.homeDirectory; + }; + } ); packages = map package script-names; in -- cgit v1.2.3