-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
84 lines (68 loc) · 2.62 KB
/
default.nix
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
let
bootstrap = import <nixpkgs> { };
nixpkgs = builtins.fromJSON (builtins.readFile ./nixpkgs.json);
src = bootstrap.fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs-channels";
inherit (nixpkgs) rev sha256;
};
pkgs = import src { };
packageOverrides = self: super: {
fuzzyfinder = super.buildPythonPackage rec {
pname = "fuzzyfinder";
version = "2.1.0";
src = self.fetchPypi {
sha256 = "0jzh68qr9nwgp9zchbzqq0qhihinf27m3iwhcsnyqsw623qqcvf5";
inherit pname version;
};
checkInputs = [ super.pytest ];
};
};
python = pkgs.python3.override { inherit packageOverrides; };
pythonPkgs = python.pkgs;
repoSrc = ./.;
ledger-clock = pythonPkgs.buildPythonApplication rec {
name = "ledger-clock";
version = "1.0";
src = repoSrc;
propagatedBuildInputs = [
pythonPkgs.pyxdg
pythonPkgs.fuzzyfinder
];
checkPhase = ''
PYLINTHOME="/tmp" pylint ledgerclock
mypy ledgerclock
'';
checkInputs = [ pythonPkgs.pylint pythonPkgs.mypy ];
buildInputs = [
pkgs.python3
pythonPkgs.ipython
pythonPkgs.pylint
pythonPkgs.mypy
pythonPkgs.yapf
];
};
in
pkgs.stdenv.mkDerivation rec {
name = "ledger-clock-helpers-${version}";
version = "1.0";
src = repoSrc;
buildInputs = [ ledger-clock pkgs.rofi pkgs.libnotify ];
#phases = [ "patchPhase" "unpackPhase" "installPhase" ];
patchPhase = ''
substituteInPlace ledger-rofi-start-clock.sh --replace 'ledgerclock_bin=ledgerclock' ledgerclock_bin=${ledger-clock}/bin/ledgerclock
substituteInPlace ledger-rofi-start-clock.sh --replace 'rofi_bin=rofi' rofi_bin=${pkgs.rofi}/bin/rofi
substituteInPlace ledger-rofi-start-clock.sh --replace 'notify_bin=notify-send' notify_bin=${pkgs.libnotify}/bin/notify-send
substituteInPlace ledger-rofi-stop-clock.sh --replace 'ledgerclock_bin=ledgerclock' ledgerclock_bin=${ledger-clock}/bin/ledgerclock
substituteInPlace ledger-rofi-stop-clock.sh --replace 'rofi_bin=rofi' rofi_bin=${pkgs.rofi}/bin/rofi
substituteInPlace ledger-rofi-stop-clock.sh --replace 'notify_bin=notify-send' notify_bin=${pkgs.libnotify}/bin/notify-send
substituteInPlace commit-clocks.sh --replace 'ledgerclock_bin=ledgerclock' ledgerclock_bin=${ledger-clock}/bin/ledgerclock
substituteInPlace commit-clocks.sh --replace 'notify_bin=notify-send' notify_bin=${pkgs.libnotify}/bin/notify-send
'';
installPhase = ''
mkdir -p $out/bin
cp ledger-rofi-start-clock.sh $out/bin
cp ledger-rofi-stop-clock.sh $out/bin
cp commit-clocks.sh $out/bin
'';
}