about summary refs log tree commit diff stats
path: root/pkgs/by-name/no
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--pkgs/by-name/no/notify-run/.envrc (renamed from modules/home.legacy/conf/alacritty/toml/font.toml)23
-rw-r--r--pkgs/by-name/no/notify-run/.gitignore (renamed from modules/by-name/yt/yt/config.toml)8
-rw-r--r--pkgs/by-name/no/notify-run/Cargo.lock25
-rw-r--r--pkgs/by-name/no/notify-run/Cargo.toml (renamed from modules/home.legacy/conf/alacritty/yaml/scrolling.yml)15
-rw-r--r--pkgs/by-name/no/notify-run/flake.lock27
-rw-r--r--pkgs/by-name/no/notify-run/flake.lock.license (renamed from modules/by-name/yt/yt/input.conf.license)0
-rw-r--r--pkgs/by-name/no/notify-run/flake.nix34
-rw-r--r--pkgs/by-name/no/notify-run/package.nix41
-rw-r--r--pkgs/by-name/no/notify-run/src/main.rs48
-rwxr-xr-x[-rw-r--r--]pkgs/by-name/no/notify-run/update.sh (renamed from modules/home.legacy/conf/alacritty/toml/mouse_bindings.toml)7
10 files changed, 204 insertions, 24 deletions
diff --git a/modules/home.legacy/conf/alacritty/toml/font.toml b/pkgs/by-name/no/notify-run/.envrc
index fd8b0b94..880b1809 100644
--- a/modules/home.legacy/conf/alacritty/toml/font.toml
+++ b/pkgs/by-name/no/notify-run/.envrc
@@ -1,3 +1,5 @@
+#!/usr/bin/env sh
+
 # nixos-config - My current NixOS configuration
 #
 # Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
@@ -8,18 +10,13 @@
 # You should have received a copy of the License along with this program.
 # If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
 
-[font]
-builtin_box_drawing = true
-size = 12.0
-
-[font.glyph_offset]
-x = -1
-y = -1
+use flake || use nix
+watch_file flake.nix
 
-[font.normal]
-family = "SauceCodePro Nerd Font Mono"
-style = "Regular"
+PATH_add ./target/debug
+PATH_add ./target/release
+PATH_add ./scripts
 
-[font.offset]
-x = -1
-y = -1
+if on_git_branch; then
+    echo && git status --short --branch
+fi
diff --git a/modules/by-name/yt/yt/config.toml b/pkgs/by-name/no/notify-run/.gitignore
index aecb74ba..8f29eabf 100644
--- a/modules/by-name/yt/yt/config.toml
+++ b/pkgs/by-name/no/notify-run/.gitignore
@@ -8,5 +8,9 @@
 # You should have received a copy of the License along with this program.
 # If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
 
-[download]
-max_cache_size = "5 GiB"
+# build
+/target
+/result
+
+# dev env
+.direnv
diff --git a/pkgs/by-name/no/notify-run/Cargo.lock b/pkgs/by-name/no/notify-run/Cargo.lock
new file mode 100644
index 00000000..1e065d25
--- /dev/null
+++ b/pkgs/by-name/no/notify-run/Cargo.lock
@@ -0,0 +1,25 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
+version = 4
+
+[[package]]
+name = "anyhow"
+version = "1.0.100"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61"
+
+[[package]]
+name = "notify-run"
+version = "0.1.0"
+dependencies = [
+ "anyhow",
+]
diff --git a/modules/home.legacy/conf/alacritty/yaml/scrolling.yml b/pkgs/by-name/no/notify-run/Cargo.toml
index 0d108f76..c4b9a659 100644
--- a/modules/home.legacy/conf/alacritty/yaml/scrolling.yml
+++ b/pkgs/by-name/no/notify-run/Cargo.toml
@@ -8,10 +8,13 @@
 # You should have received a copy of the License along with this program.
 # If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
 
-scrolling:
-  # Maximum number of lines in the scrollback buffer.
-  # Specifying '0' will disable scrolling.
-  history: 10000
+[package]
+name = "notify-run"
+description = "An safe way to run applications that might fail"
+version = "0.1.0"
+edition = "2024"
 
-  # Scrolling distance multiplier.
-  multiplier: 3
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+anyhow = "1.0.100"
diff --git a/pkgs/by-name/no/notify-run/flake.lock b/pkgs/by-name/no/notify-run/flake.lock
new file mode 100644
index 00000000..b67bb39a
--- /dev/null
+++ b/pkgs/by-name/no/notify-run/flake.lock
@@ -0,0 +1,27 @@
+{
+  "nodes": {
+    "nixpkgs": {
+      "locked": {
+        "lastModified": 1764230294,
+        "narHash": "sha256-Z63xl5Scj3Y/zRBPAWq1eT68n2wBWGCIEF4waZ0bQBE=",
+        "owner": "NixOS",
+        "repo": "nixpkgs",
+        "rev": "0d59e0290eefe0f12512043842d7096c4070f30e",
+        "type": "github"
+      },
+      "original": {
+        "owner": "NixOS",
+        "ref": "nixpkgs-unstable",
+        "repo": "nixpkgs",
+        "type": "github"
+      }
+    },
+    "root": {
+      "inputs": {
+        "nixpkgs": "nixpkgs"
+      }
+    }
+  },
+  "root": "root",
+  "version": 7
+}
diff --git a/modules/by-name/yt/yt/input.conf.license b/pkgs/by-name/no/notify-run/flake.lock.license
index eae6a84c..eae6a84c 100644
--- a/modules/by-name/yt/yt/input.conf.license
+++ b/pkgs/by-name/no/notify-run/flake.lock.license
diff --git a/pkgs/by-name/no/notify-run/flake.nix b/pkgs/by-name/no/notify-run/flake.nix
new file mode 100644
index 00000000..07be3258
--- /dev/null
+++ b/pkgs/by-name/no/notify-run/flake.nix
@@ -0,0 +1,34 @@
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
+{
+  description = "An safe way to run applications, that might fail";
+
+  inputs = {
+    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
+  };
+
+  outputs = {nixpkgs, ...}: let
+    system = "x86_64-linux";
+    pkgs = nixpkgs.legacyPackages."${system}";
+  in {
+    devShells."${system}".default = pkgs.mkShell {
+      packages = [
+        pkgs.cargo
+        pkgs.clippy
+        pkgs.rustc
+        pkgs.rustfmt
+
+        pkgs.cargo-edit
+      ];
+    };
+  };
+}
+# vim: ts=2
+
diff --git a/pkgs/by-name/no/notify-run/package.nix b/pkgs/by-name/no/notify-run/package.nix
new file mode 100644
index 00000000..1f9337be
--- /dev/null
+++ b/pkgs/by-name/no/notify-run/package.nix
@@ -0,0 +1,41 @@
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
+{
+  rustPlatform,
+  lib,
+  libnotify,
+  makeWrapper,
+}:
+rustPlatform.buildRustPackage (finalAttrs: {
+  pname = "notify-run";
+  version = "0.1.0";
+
+  buildInputs = [
+    libnotify
+  ];
+  nativeBuildInputs = [
+    makeWrapper
+  ];
+
+  src = ./.;
+  cargoLock = {
+    lockFile = ./Cargo.lock;
+  };
+
+  postInstall = ''
+    # NOTE: We cannot clear the path, because we need access to the programs to start. <2025-12-03>
+    wrapProgram $out/bin/notify-run \
+      --prefix PATH : ${lib.makeBinPath finalAttrs.buildInputs}
+  '';
+
+  meta = {
+    mainProgram = "notify-run";
+  };
+})
diff --git a/pkgs/by-name/no/notify-run/src/main.rs b/pkgs/by-name/no/notify-run/src/main.rs
new file mode 100644
index 00000000..de625627
--- /dev/null
+++ b/pkgs/by-name/no/notify-run/src/main.rs
@@ -0,0 +1,48 @@
+// nixos-config - My current NixOS configuration
+//
+// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+// This file is part of my nixos-config.
+//
+// You should have received a copy of the License along with this program.
+// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
+
+use std::{env::args, process::Command};
+
+use anyhow::{Context, Result};
+
+fn main() -> Result<()> {
+    let args = args().skip(1).collect::<Vec<_>>();
+
+    let mut cmd = Command::new(&args[0]);
+    if let Some(arguments) = args.get(1) {
+        cmd.args(arguments.split(" ").collect::<Vec<_>>().as_slice());
+    }
+
+    eprintln!("Spawning {:?}", cmd);
+
+    let output = cmd
+        .output()
+        .with_context(|| format!("Failed to spawn and await output of {:?}", cmd))?;
+
+    if !output.status.success() {
+        let mut notify_send = Command::new("notify-send");
+        notify_send.args([
+            format!("Command {:?} failed", cmd).as_str(),
+            &String::from_utf8_lossy(output.stderr.as_slice()),
+        ]);
+
+        notify_send.status().with_context(|| {
+            format!(
+                "Failed to run `notify-send` to tell about failed command ({:?}).",
+                cmd
+            )
+        })?;
+    } else {
+        print!("{}", String::from_utf8_lossy(&output.stdout));
+        eprint!("{}", String::from_utf8_lossy(&output.stderr));
+    }
+
+    Ok(())
+}
diff --git a/modules/home.legacy/conf/alacritty/toml/mouse_bindings.toml b/pkgs/by-name/no/notify-run/update.sh
index e566a452..23d90a86 100644..100755
--- a/modules/home.legacy/conf/alacritty/toml/mouse_bindings.toml
+++ b/pkgs/by-name/no/notify-run/update.sh
@@ -1,3 +1,5 @@
+#!/usr/bin/env sh
+
 # nixos-config - My current NixOS configuration
 #
 # Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
@@ -8,6 +10,5 @@
 # You should have received a copy of the License along with this program.
 # If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
 
-[[mouse.bindings]]
-action = "Copy"
-mouse = "Middle"
+[ "$1" = "upgrade" ] && cargo upgrade
+cargo update