]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - default.nix
Add mtop
[perso/Immae/Config/Nix.git] / default.nix
1 with import <nixpkgs> {};
2 let
3 nixpkgs = import <nixpkgs> {};
4 fetchedGithub = path:
5 let
6 json = lib.importJSON path;
7 in rec {
8 version = json.tag;
9 name = "${json.meta.name}-${version}";
10 src = fetchFromGitHub json.github;
11 };
12
13 fetchedGit = path:
14 let
15 json = lib.importJSON path;
16 in rec {
17 version = json.tag;
18 name = "${json.meta.name}-${version}";
19 src = fetchgit json.git;
20 };
21
22 ledger = (nixpkgs.ledger.override { boost = boost166; }).overrideAttrs (oldAttrs:
23 fetchedGithub ./fetched/ledger.json // {
24 postInstall = "";
25 }
26 );
27
28 taskwarrior = nixpkgs.taskwarrior.overrideAttrs (oldAttrs: rec {
29 postInstall = ''${oldAttrs.postInstall}
30 mkdir -p "$out/share/vim/vimfiles/ftdetect"
31 mkdir -p "$out/share/vim/vimfiles/syntax"
32 ln -s "../../../../share/doc/task/scripts/vim/ftdetect/task.vim" "$out/share/vim/vimfiles/ftdetect/"
33 ln -s "../../../../share/doc/task/scripts/vim/syntax/taskrc.vim" "$out/share/vim/vimfiles/syntax/"
34 ln -s "../../../../share/doc/task/scripts/vim/syntax/taskdata.vim" "$out/share/vim/vimfiles/syntax/"
35 ln -s "../../../../share/doc/task/scripts/vim/syntax/taskedit.vim" "$out/share/vim/vimfiles/syntax/"
36 '';
37 });
38
39 vit = (nixpkgs.vit.override { inherit taskwarrior; }).overrideAttrs (oldAttrs:
40 fetchedGithub ./fetched/vit.json // {
41 buildInputs = oldAttrs.buildInputs ++ [perlPackages.TryTiny perlPackages.TextCharWidth];
42 }
43 );
44
45 weboob = pythonPackages.weboob.overrideAttrs (oldAttrs: rec {
46 postInstall = ''${oldAttrs.postInstall or ""}
47 mkdir -p $out/share/bash-completion/completions/
48 cp tools/weboob_bash_completion $out/share/bash-completion/completions/weboob
49 '';
50 });
51
52 slrn = nixpkgs.slrn.overrideAttrs (oldAttrs: rec {
53 version = "1.0.3a";
54 name = "slrn-${version}";
55 src = fetchurl {
56 url = "http://www.jedsoft.org/releases/slrn/slrn-${version}.tar.bz2";
57 sha256 = "1b1d9iikr60w0vq86y9a0l4gjl0jxhdznlrdp3r405i097as9a1v";
58 };
59 configureFlags = oldAttrs.configureFlags ++ [ "--with-slrnpull" ];
60 });
61
62 ldapvi = nixpkgs.ldapvi.overrideAttrs (oldAttrs: fetchedGit ./fetched/ldapvi.json);
63
64 nixos = import ./nixos_tools.nix {};
65
66 pass = nixpkgs.pass.overrideAttrs (oldAttrs:
67 fetchedGit ./fetched/pass.json // {
68 patches = oldAttrs.patches ++ [ ./patches/pass-fix-pass-init.patch ];
69 }
70 );
71
72 profanity = (nixpkgs.profanity.override {
73 notifySupport = true;
74 inherit libnotify gpgme gdk_pixbuf;
75 python = python3;
76 }).overrideAttrs (oldAttrs: rec {
77 configureFlags = oldAttrs.configureFlags ++ [ "--enable-plugins" ];
78 });
79
80 weechat = nixpkgs.weechat.override {
81 configure = { availablePlugins, ... }: {
82 plugins = with availablePlugins; [
83 (python.withPackages (ps: with ps; [websocket_client emoji]))
84 perl
85 ];
86 };
87 };
88
89 buildPerlPackage = callPackage <nixpkgs/pkgs/development/perl-modules/generic> { };
90 note = buildPerlPackage rec {
91 name = "note-1.3.26";
92 src = fetchurl {
93 url = "mirror://cpan/authors/id/T/TL/TLINDEN/${name}.tar.gz";
94 sha256 = "1h645rnb5vpms48fcyzvp7cwwcbf9k5xq49w2bpniyzzgk2brjrq";
95 };
96 outputs = ["out" "man"];
97 buildInputs = [ perlPackages.YAML ];
98 meta = with stdenv.lib; {
99 description = "A perl script for maintaining notes";
100 homepage = http://www.daemon.de/NOTE;
101 license = licenses.gpl3;
102 maintainers = with maintainers; [ { name = "T.v.Dein"; email = "tlinden@cpan.org"; } ];
103 platforms = platforms.unix;
104 };
105 };
106
107 terminal_velocity = with python2Packages; buildPythonApplication rec {
108 pname = "terminal-velocity-git";
109 version = "0.2.0";
110
111 patches = [
112 # FIXME: update this patch when version changes
113 ./patches/terminal_velocity_fix_build.patch
114 ./patches/terminal_velocity_sort_found_notes.patch
115 ];
116
117 propagatedBuildInputs = [ chardet urwid sh pyyaml ];
118 buildInputs = [ m2r restructuredtext_lint pygments ];
119
120 src = fetchPypi {
121 inherit pname version;
122 sha256 = "13yrkcmvh5h5fwnai61sbmqkrjyisz08n62pq0ada2lyyqf7g6b9";
123 };
124 };
125
126 mtop = buildPerlPackage rec {
127 name = "mtop-${version}";
128 version = "0.6.6";
129 src = fetchurl {
130 url = "http://downloads.sourceforge.net/project/mtop/mtop/v${version}/mtop-${version}.tar.gz";
131 sha256 = "0x0x5300b1j9i0xxk8rsrki0pspyzj2vylhzv8qg3l6j26aw0zrf";
132 };
133 outputs = ["out"];
134 buildInputs = [ perlPackages.DBI perlPackages.DBDmysql perlPackages.Curses ];
135
136 postInstall = ''
137 cd "$out"
138 preConfigure || true
139 '';
140 meta = with stdenv.lib; {
141 description = "MySQL top (monitor and examine slow queries)";
142 homepage = http://mtop.sourceforge.net/;
143 license = licenses.gpl3;
144 maintainers = with maintainers; [ { name = "Marc Prewitt"; email = "mprewitt@chelsea.net"; } ];
145 platforms = platforms.unix;
146 };
147 };
148
149 # https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh
150 # https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks
151 in
152 {
153 inherit nix-prefetch-scripts;
154 inherit ledger;
155 inherit taskwarrior vit timewarrior;
156 inherit weboob;
157 inherit slrn;
158 inherit sc-im;
159 inherit ldapvi;
160 inherit pal;
161 inherit duplicity duply;
162 inherit pdftk;
163 inherit googler;
164 inherit jrnl;
165 inherit apg;
166 inherit newsboat;
167 inherit vcsh;
168 inherit xmr-stak;
169 inherit urlwatch;
170 inherit pass;
171 inherit ranger;
172 inherit profanity;
173 inherit weechat;
174 inherit note terminal_velocity;
175 inherit mtop;
176 #inherit nixos;
177 }