From 2e2ecbe931dd800ca7374642583fc98ce19c42c6 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Mon, 1 May 2023 22:55:59 +0300 Subject: [PATCH] try_swap_workspace: nixify --- flake.nix | 1 + try_swap_workspace/default.nix | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 try_swap_workspace/default.nix diff --git a/flake.nix b/flake.nix index 3b014fe..0170323 100644 --- a/flake.nix +++ b/flake.nix @@ -17,6 +17,7 @@ hyprprop = prev.callPackage ./hyprprop {}; scratchpad = prev.callPackage ./scratchpad {hyprland = null;}; shellevents = prev.callPackage ./shellevents {hyprland = null;}; + try_swap_workspace = prev.callPackage ./try_swap_workspace {}; }; packages = genSystems (system: self.overlays.default null pkgsFor.${system}); diff --git a/try_swap_workspace/default.nix b/try_swap_workspace/default.nix new file mode 100644 index 0000000..7f3aed1 --- /dev/null +++ b/try_swap_workspace/default.nix @@ -0,0 +1,33 @@ +{ + lib, + stdenvNoCC, + coreutils, + scdoc, + makeShellWrapper, + libnotify, + bash, +}: +stdenvNoCC.mkDerivation { + pname = "try_swap_workspace"; + version = "0.1"; + src = ./.; + + buildInputs = [bash scdoc]; + makeFlags = ["PREFIX=$(out)"]; + nativeBuildInputs = [makeShellWrapper]; + + postInstall = '' + wrapProgramShell $out/bin/try_swap_workspace --prefix PATH ':' \ + "${lib.makeBinPath [ + coreutils + libnotify + ]}" + ''; + + meta = with lib; { + description = "Workspace switching helper for Hyprland"; + license = licenses.mit; + platforms = platforms.unix; + maintainers = with maintainers; [fufexan]; + }; +}