summary refs log tree commit diff
path: root/pkgs/tools/misc/pws/default.nix
blob: 0edec63c8c927c43751f40806e942049b1042441 (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
{ stdenv, lib, bundlerEnv, ruby, bundlerUpdateScript, xsel, makeWrapper }:

stdenv.mkDerivation rec {
  name = "pws-${(import ./gemset.nix).pws.version}";

  buildInputs = [ makeWrapper ];

  phases = ["installPhase"];

  installPhase = let
    env = bundlerEnv {
      name = "${name}-gems";

      inherit ruby;

      gemdir = ./.;
    };
  in ''
    mkdir -p $out/bin
    makeWrapper ${env}/bin/pws $out/bin/pws \
      --set PATH '"${xsel}/bin/:$PATH"'
  '';

  passthru.updateScript = bundlerUpdateScript "pws";

  meta = with lib; {
    description = "Command-line password safe";
    homepage    = "https://github.com/janlelis/pws";
    license     = licenses.mit;
    maintainers = with maintainers; [ swistak35 nicknovitski ];
    platforms   = platforms.unix;
  };
}