From 53a8cc83ea1642e8c260cc82959d8a33ab84a41f Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Sat, 1 Jul 2023 20:40:48 -0600 Subject: [PATCH] remove extraLib, replace mkScript with writeShellApplication --- flake.nix | 1 - modules/darwin/utilities.nix | 6 +++--- modules/nixos/graphical/rofi.nix | 6 +++--- overlays/lib.nix | 16 ---------------- 4 files changed, 6 insertions(+), 23 deletions(-) delete mode 100644 overlays/lib.nix diff --git a/flake.nix b/flake.nix index df2924c..20ee91c 100644 --- a/flake.nix +++ b/flake.nix @@ -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) ]; diff --git a/modules/darwin/utilities.nix b/modules/darwin/utilities.nix index 1021ef6..db43292 100644 --- a/modules/darwin/utilities.nix +++ b/modules/darwin/utilities.nix @@ -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; }) ]; diff --git a/modules/nixos/graphical/rofi.nix b/modules/nixos/graphical/rofi.nix index 8d695b7..87911c7 100644 --- a/modules/nixos/graphical/rofi.nix +++ b/modules/nixos/graphical/rofi.nix @@ -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"; }; diff --git a/overlays/lib.nix b/overlays/lib.nix deleted file mode 100644 index 9e60c89..0000000 --- a/overlays/lib.nix +++ /dev/null @@ -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} $@ - ''; - }; - -}