summaryrefslogtreecommitdiff
path: root/home-manager/features/gui/desktops/niri/parts/scrap-maker.nix
diff options
context:
space:
mode:
Diffstat (limited to 'home-manager/features/gui/desktops/niri/parts/scrap-maker.nix')
-rw-r--r--home-manager/features/gui/desktops/niri/parts/scrap-maker.nix22
1 files changed, 22 insertions, 0 deletions
diff --git a/home-manager/features/gui/desktops/niri/parts/scrap-maker.nix b/home-manager/features/gui/desktops/niri/parts/scrap-maker.nix
new file mode 100644
index 0000000..19cce56
--- /dev/null
+++ b/home-manager/features/gui/desktops/niri/parts/scrap-maker.nix
@@ -0,0 +1,22 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}: let
+ cfg = config.features.gui.desktops.niri.parts.scrap-maker;
+
+ scrapDirectory = "~/Sync/vault/scraps";
+in {
+ options.features.gui.desktops.niri.parts.scrap-maker.enable = lib.mkEnableOption "scrap maker";
+ config = lib.mkIf cfg.enable {
+ home.packages = [
+ (pkgs.writers.writeNuBin "scrap-maker" ''
+ let scrap_text = fuzzel -d -l 0 -p "" -x 8 -y 8 -w 40
+ let scrap_name = date now | format date "%s"
+ let scrap_path = ("${scrapDirectory}" + "/" + $scrap_name + ".md") | path expand
+ $scrap_text | save $scrap_path
+ '')
+ ];
+ };
+}