summary refs log tree commit diff stats
path: root/user
diff options
context:
space:
mode:
authorAlan Pearce2023-05-01 14:07:32 +0200
committerAlan Pearce2023-05-05 21:08:16 +0200
commit92300d2ac98dff3acea6d0b6c655c65f9917ffa3 (patch)
treebc35f749e63fd9453981bc9640f71fdeb69fac2b /user
parentd54df92c7446a2e3b62ede5645c313b75a188bfc (diff)
downloadnixfiles-92300d2ac98dff3acea6d0b6c655c65f9917ffa3.tar.lz
nixfiles-92300d2ac98dff3acea6d0b6c655c65f9917ffa3.tar.zst
nixfiles-92300d2ac98dff3acea6d0b6c655c65f9917ffa3.zip
dev/base: add `interactively` to run commands with a preview
Diffstat (limited to 'user')
-rw-r--r--user/overlays/extra-packages.nix1
-rw-r--r--user/packages/interactively/default.nix35
-rw-r--r--user/settings/development/base.nix1
3 files changed, 37 insertions, 0 deletions
diff --git a/user/overlays/extra-packages.nix b/user/overlays/extra-packages.nix
index 67867830..03b87d16 100644
--- a/user/overlays/extra-packages.nix
+++ b/user/overlays/extra-packages.nix
@@ -1,5 +1,6 @@
 self: super: {
   lumen = super.callPackage ../packages/lumen { };
+  interactively = super.callPackage ../packages/interactively { };
   emacsPackagesFor = emacs: (
     (super.emacsPackagesFor emacs).overrideScope' (
       eself: esuper:
diff --git a/user/packages/interactively/default.nix b/user/packages/interactively/default.nix
new file mode 100644
index 00000000..dc7885f5
--- /dev/null
+++ b/user/packages/interactively/default.nix
@@ -0,0 +1,35 @@
+{ stdenv
+, fetchFromGitHub
+, coreutils
+, fzf
+}:
+
+stdenv.mkDerivation {
+  pname = "interactively";
+  version = "unstable-2023-04-19";
+
+  src = fetchFromGitHub {
+    owner = "bigH";
+    repo = "interactively";
+    rev = "c09f14b4e572053eb8e1e8dfb0b74ee66a66c07f";
+    hash = "sha256-HFCTX9lHiLymSyJMiFYSKG+7TCSb9YpmtC+I7Jf+zUg=";
+  };
+
+  fixupPhase = ''
+    patchShebangs bin/interactively
+    substituteInPlace bin/interactively \
+      --replace fzf ${fzf}/bin/fzf \
+      --replace tac ${coreutils}/bin/tac
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp bin/interactively $out/bin/
+    chmod +x $out/bin/interactively
+  '';
+
+  meta = {
+    description = "";
+    homepage = "https://github.com/bigH/interactively";
+  };
+}
diff --git a/user/settings/development/base.nix b/user/settings/development/base.nix
index 3beac23d..51aa0447 100644
--- a/user/settings/development/base.nix
+++ b/user/settings/development/base.nix
@@ -18,6 +18,7 @@ in
       nodePackages.vscode-json-languageserver
       nodePackages.yaml-language-server
       multimarkdown
+      interactively
 
       mosh