about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/wayland/swaycwd/default.nix
blob: d8fec3fd15c6cfd73a9e3c81c0efb6f64aff74f0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{ lib
, nimPackages
, fetchFromGitLab
, enableShells ? [ "bash" "zsh" "fish" "sh" "posh" ]
}:
nimPackages.buildNimPackage rec{

  name = "swaycwd";
  version = "0.0.2";

  src = fetchFromGitLab {
    owner = "cab404";
    repo = name;
    rev = "v${version}";
    hash = "sha256-OZWOPtOqcX+fVQCxWntrn98EzFu70WH55rfYCPDMSKk=";
  };

  preConfigure = ''
    {
      echo 'let enabledShells: seq[string] = @${builtins.toJSON enableShells}'
      echo 'export enabledShells'
    } > shells.nim
    cat << EOF > swaycwd.nimble
    srcDir = "."
    bin = "swaycwd"
    EOF
  '';

  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;
  };
}