remove extraLib, replace mkScript with writeShellApplication

This commit is contained in:
Noah Masur 2023-07-01 20:40:48 -06:00
parent 1cf5f46adf
commit 53a8cc83ea
4 changed files with 6 additions and 23 deletions

View File

@ -121,7 +121,6 @@
inputs.nur.overlay
inputs.nix2vim.overlay
(import ./overlays/neovim-plugins.nix inputs)
(import ./overlays/lib.nix)
(import ./overlays/calibre-web.nix)
(import ./overlays/disko.nix inputs)
];

View File

@ -19,10 +19,10 @@
consul
noti # Create notifications programmatically
ipcalc # Make IP network calculations
(pkgs.extraLib.mkScript {
(writeShellApplication {
name = "ocr";
file = ../../modules/common/shell/bash/scripts/ocr.sh;
env = [ tesseract ];
runtimeInputs = [ tesseract ];
text = builtins.readFile ../../modules/common/shell/bash/scripts/ocr.sh;
})
];

View File

@ -167,10 +167,10 @@ in {
altTabCommand = "${rofi}/bin/rofi -show window -modi window";
calculatorCommand = "${rofi}/bin/rofi -modes calc -show calc";
audioSwitchCommand = "${
(pkgs.extraLib.mkScript {
(pkgs.writeShellApplication {
name = "switch-audio";
file = ./rofi/pulse-sink.sh;
env = [ pkgs.ponymix rofi ];
runtimeInputs = [ pkgs.ponymix rofi ];
text = builtins.readFile ./rofi/pulse-sink.sh;
})
}/bin/switch-audio";
};

View File

@ -1,16 +0,0 @@
_final: prev: {
extraLib = prev.lib // {
# Quickly package shell scripts with their dependencies
# From https://discourse.nixos.org/t/how-to-create-a-script-with-dependencies/7970/6
mkScript = { name, file, env ? [ ] }:
prev.pkgs.writeScriptBin name ''
for i in ${prev.lib.concatStringsSep " " env}; do
export PATH="$i/bin:$PATH"
done
exec ${prev.pkgs.bash}/bin/bash ${file} $@
'';
};
}