mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
swaycwd: init at 0.0.1
Co-authored-by: zseri <zseri.devel@ytrizja.de> Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
parent
5bc2358f4b
commit
ed94d89967
2 changed files with 47 additions and 0 deletions
45
pkgs/tools/wayland/swaycwd/default.nix
Normal file
45
pkgs/tools/wayland/swaycwd/default.nix
Normal file
|
@ -0,0 +1,45 @@
|
|||
{ lib, nim, stdenv, fetchFromGitLab
|
||||
, enableShells ? [ "bash" "zsh" "fish" "sh" "posh" ]
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "swaycwd";
|
||||
version = "0.0.1";
|
||||
|
||||
src = fetchFromGitLab {
|
||||
owner = "cab404";
|
||||
repo = "swaycwd";
|
||||
rev = "aca81695ec2102b9bca6f5bae364f69a8b9d399f";
|
||||
hash = "sha256-MkyY3wWByQo0l0J28xKDfGtxfazVPRyZHCObl9Fszh4=";
|
||||
};
|
||||
|
||||
configurePhase = ''
|
||||
runHook preConfigure
|
||||
{
|
||||
echo 'let enabledShells: seq[string] = @${builtins.toJSON enableShells}'
|
||||
echo 'export enabledShells'
|
||||
} > shells.nim
|
||||
runHook postConfigure
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ nim ];
|
||||
|
||||
buildPhase = ''
|
||||
export HOME=$TMPDIR
|
||||
nim c --opt:speed -d:release swaycwd.nim
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
install -D -m555 -t $out/bin swaycwd
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://gitlab.com/cab404/swaycwd";
|
||||
description = "Returns cwd for shell in currently focused sway window, or home directory if cannot find shell";
|
||||
maintainers = with maintainers; [ cab404 ];
|
||||
platforms = platforms.linux;
|
||||
license = licenses.gpl3Only;
|
||||
};
|
||||
}
|
|
@ -2038,6 +2038,8 @@ in
|
|||
|
||||
swaykbdd = callPackage ../tools/wayland/swaykbdd { };
|
||||
|
||||
swaycwd = callPackage ../tools/wayland/swaycwd { };
|
||||
|
||||
wayland-utils = callPackage ../tools/wayland/wayland-utils { };
|
||||
|
||||
wev = callPackage ../tools/wayland/wev { };
|
||||
|
|
Loading…
Reference in a new issue