From 7565b364edc635b1aa964e9ecd33a7992790a6b0 Mon Sep 17 00:00:00 2001 From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> Date: Sun, 26 May 2024 17:17:30 +0200 Subject: [PATCH] add `run` binary --- custom-pkgs/default.nix | 1 + custom-pkgs/run/default.nix | 9 +++++++++ home-manager/desktop.nix | 1 + 3 files changed, 11 insertions(+) create mode 100644 custom-pkgs/run/default.nix diff --git a/custom-pkgs/default.nix b/custom-pkgs/default.nix index 9c38191..80ee30f 100644 --- a/custom-pkgs/default.nix +++ b/custom-pkgs/default.nix @@ -1,6 +1,7 @@ pkgs: { cargo-bisect-rustc = import ./cargo-bisect-rustc/default.nix pkgs; monaspace = import ./monaspace.nix pkgs; + run = import ./run { inherit pkgs; }; x = import ./x { inherit pkgs; }; } diff --git a/custom-pkgs/run/default.nix b/custom-pkgs/run/default.nix new file mode 100644 index 0000000..9c34413 --- /dev/null +++ b/custom-pkgs/run/default.nix @@ -0,0 +1,9 @@ +{ pkgs ? import { } }: pkgs.writeShellScriptBin "run" '' + first="$1" + if [ -z "$first" ]; then + echo "error: must provide package name" + exit 1 + fi + shift + nix run nixpkgs#"$first" -- "$@" +'' diff --git a/home-manager/desktop.nix b/home-manager/desktop.nix index 09f2176..f916a9d 100644 --- a/home-manager/desktop.nix +++ b/home-manager/desktop.nix @@ -30,6 +30,7 @@ in home.packages = with pkgs; [ audacity customPkgs.cargo-bisect-rustc + customPkgs.run discord jetbrains.idea-ultimate obs-studio