2021-10-17 09:34:42 +00:00
|
|
|
{ lib
|
|
|
|
, nimPackages
|
|
|
|
, fetchFromGitLab
|
2021-03-20 04:20:00 +00:00
|
|
|
, enableShells ? [ "bash" "zsh" "fish" "sh" "posh" ]
|
|
|
|
}:
|
2021-10-17 09:34:42 +00:00
|
|
|
nimPackages.buildNimPackage rec{
|
2021-03-20 04:20:00 +00:00
|
|
|
|
2021-10-17 09:34:42 +00:00
|
|
|
name = "swaycwd";
|
|
|
|
version = "0.0.2";
|
2021-03-20 04:20:00 +00:00
|
|
|
|
2021-10-17 09:34:42 +00:00
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "cab404";
|
|
|
|
repo = name;
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-OZWOPtOqcX+fVQCxWntrn98EzFu70WH55rfYCPDMSKk=";
|
|
|
|
};
|
2021-03-20 04:20:00 +00:00
|
|
|
|
2021-10-17 09:34:42 +00:00
|
|
|
preConfigure = ''
|
|
|
|
{
|
|
|
|
echo 'let enabledShells: seq[string] = @${builtins.toJSON enableShells}'
|
|
|
|
echo 'export enabledShells'
|
|
|
|
} > shells.nim
|
|
|
|
cat << EOF > swaycwd.nimble
|
|
|
|
srcDir = "."
|
|
|
|
bin = "swaycwd"
|
|
|
|
EOF
|
|
|
|
'';
|
2021-03-20 04:20:00 +00:00
|
|
|
|
2021-10-17 09:34:42 +00:00
|
|
|
nimFlags = [ "--opt:speed" ];
|
2021-03-20 04:20:00 +00:00
|
|
|
|
2021-10-17 09:34:42 +00: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-20 04:20:00 +00:00
|
|
|
}
|