depot/pkgs/by-name/sw/swaycwd/package.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

35 lines
902 B
Nix

{ lib
, buildNimPackage
, fetchFromGitLab
, enableShells ? [ "bash" "zsh" "fish" "sh" "posh" "codium" ]
}:
buildNimPackage (finalAttrs: {
pname = "swaycwd";
version = "0.2.1";
src = fetchFromGitLab {
owner = "cab404";
repo = "swaycwd";
rev = "v${finalAttrs.version}";
hash = "sha256-R/LnojbA0vBQVivGLaoM0+M4qVJ7vjf4kggB59i896w=";
};
preConfigure = ''
{
echo 'let enabledShells: seq[string] = @${builtins.toJSON enableShells}'
echo 'export enabledShells'
} > src/shells.nim
'';
nimFlags = [ "--opt:speed" ];
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;
mainProgram = "swaycwd";
};
})