summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkgs/default.nix1
-rw-r--r--pkgs/inbox-review.nix27
2 files changed, 28 insertions, 0 deletions
diff --git a/pkgs/default.nix b/pkgs/default.nix
index 892b6a5..9808154 100644
--- a/pkgs/default.nix
+++ b/pkgs/default.nix
@@ -8,4 +8,5 @@
custom-neovim = pkgs.callPackage ./custom-neovim {inherit inputs;};
old-custom-neovim = pkgs.callPackage ./old-custom-neovim {inherit inputs;};
dfmodsync = pkgs.callPackage ./dfmodsync.nix {};
+ inbox-review = pkgs.callPackage ./inbox-review.nix {};
}
diff --git a/pkgs/inbox-review.nix b/pkgs/inbox-review.nix
new file mode 100644
index 0000000..a65cd06
--- /dev/null
+++ b/pkgs/inbox-review.nix
@@ -0,0 +1,27 @@
+{
+ pkgs
+}: let
+ inbox = "~/Sync/vault/inbox";
+in pkgs.writers.writeNuBin "inboxreview" /*nu*/ ''
+ let inbox = "${inbox}" | path expand
+
+ let iota_paths = ls $inbox | get name
+
+ $iota_paths | each {|path|
+ let contents = $path | open
+
+ print $"\n(ansi purple)($contents)(ansi reset)\n"
+
+ let deletion_confirmation = match (input "Delete? [Y/n] ") {
+ "" => true,
+ "Y" => true,
+ "y" => true,
+ "n" => false,
+ _ => false,
+ }
+
+ if $deletion_confirmation {
+ rm $path
+ }
+ }
+''