2021-10-18 16:34:38 +02:00
|
|
|
{ lib
|
|
|
|
, nimPackages
|
|
|
|
, fetchFromGitLab
|
2022-09-06 06:31:51 +02:00
|
|
|
, enableShells ? [ "bash" "zsh" "fish" "sh" "posh" "codium" ]
|
2021-03-22 08:08:26 +01:00
|
|
|
}:
|
2021-10-18 16:34:38 +02:00
|
|
|
nimPackages.buildNimPackage rec{
|
2021-11-29 19:24:13 +01:00
|
|
|
pname = "swaycwd";
|
2022-09-06 06:31:51 +02:00
|
|
|
version = "0.2.1";
|
2021-03-22 08:08:26 +01:00
|
|
|
|
2021-10-18 16:34:38 +02:00
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "cab404";
|
2021-11-29 19:24:13 +01:00
|
|
|
repo = pname;
|
2021-10-18 16:34:38 +02:00
|
|
|
rev = "v${version}";
|
2022-09-06 06:31:51 +02:00
|
|
|
hash = "sha256-R/LnojbA0vBQVivGLaoM0+M4qVJ7vjf4kggB59i896w=";
|
2021-10-18 16:34:38 +02:00
|
|
|
};
|
2021-03-22 08:08:26 +01:00
|
|
|
|
2021-10-18 16:34:38 +02:00
|
|
|
preConfigure = ''
|
|
|
|
{
|
|
|
|
echo 'let enabledShells: seq[string] = @${builtins.toJSON enableShells}'
|
|
|
|
echo 'export enabledShells'
|
2022-08-27 07:41:01 +02:00
|
|
|
} > src/shells.nim
|
2021-10-18 16:34:38 +02:00
|
|
|
'';
|
2021-03-22 08:08:26 +01:00
|
|
|
|
2021-10-18 16:34:38 +02:00
|
|
|
nimFlags = [ "--opt:speed" ];
|
2021-03-22 08:08:26 +01:00
|
|
|
|
2021-10-18 16:34:38 +02:00
|
|
|
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;
|
|
|
|
};
|
2021-03-22 08:08:26 +01:00
|
|
|
}
|