]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - default.nix
Use tagged nixpkgs instead of last unstable version to control upgrades
[perso/Immae/Config/Nix.git] / default.nix
CommitLineData
b0d2cf8a
IB
1with import (builtins.fetchTarball {
2 # FIXME: upgrade to nixpkgs 19 when stable and stick to stable
3 # versions
4 name = "nixos-unstable-2018-12-08";
5 url = https://github.com/nixos/nixpkgs/archive/61c3169a0e17d789c566d5b241bfe309ce4a6275.tar.gz;
6 sha256 = "0qbycg7wkb71v20rchlkafrjfpbk2fnlvvbh3ai9pyfisci5wxvq";
7}) {};
177da38b 8let
b0d2cf8a 9 stable_nixpkgs = import <nixpkgs> {};
b7cb5556 10 mypkgs = {};
e8ac4a54
IB
11 postHook = ''
12 header() {
13 echo -ne "\033[1;36m"
14 echo -n "$1"
15 echo -e "\033[0m"
16 }
17
18 echoCmd() {
19 printf "\033[1;34m%s:\033[0m" "$1"
20 shift
21 printf ' %q' "$@"
22 echo
23 }
24 '';
25
177da38b
IB
26 fetchedGithub = path:
27 let
28 json = lib.importJSON path;
29 in rec {
30 version = json.tag;
31 name = "${json.meta.name}-${version}";
32 src = fetchFromGitHub json.github;
33 };
34
6b53d116
IB
35 fetchedGit = path:
36 let
37 json = lib.importJSON path;
38 in rec {
39 version = json.tag;
40 name = "${json.meta.name}-${version}";
41 src = fetchgit json.git;
42 };
43
90a37f5e 44 mypkgs.ledger = (ledger.override { boost = boost166; }).overrideAttrs (_old:
177da38b
IB
45 fetchedGithub ./fetched/ledger.json // {
46 postInstall = "";
47 }
48 );
49
90a37f5e 50 mypkgs.taskwarrior = taskwarrior.overrideAttrs (old: rec {
c7aeff7d 51 postInstall = ''${old.postInstall}
177da38b
IB
52 mkdir -p "$out/share/vim/vimfiles/ftdetect"
53 mkdir -p "$out/share/vim/vimfiles/syntax"
54 ln -s "../../../../share/doc/task/scripts/vim/ftdetect/task.vim" "$out/share/vim/vimfiles/ftdetect/"
55 ln -s "../../../../share/doc/task/scripts/vim/syntax/taskrc.vim" "$out/share/vim/vimfiles/syntax/"
56 ln -s "../../../../share/doc/task/scripts/vim/syntax/taskdata.vim" "$out/share/vim/vimfiles/syntax/"
57 ln -s "../../../../share/doc/task/scripts/vim/syntax/taskedit.vim" "$out/share/vim/vimfiles/syntax/"
58 '';
59 });
60
90a37f5e 61 mypkgs.vit = (vit.override { taskwarrior = mypkgs.taskwarrior; }).overrideAttrs (old:
177da38b 62 fetchedGithub ./fetched/vit.json // {
c7aeff7d 63 buildInputs = old.buildInputs ++ [perlPackages.TryTiny perlPackages.TextCharWidth];
177da38b
IB
64 }
65 );
66
b7cb5556 67 mypkgs.weboob = pythonPackages.weboob.overrideAttrs (old: rec {
c7aeff7d 68 postInstall = ''${old.postInstall or ""}
ac6bfec2
IB
69 mkdir -p $out/share/bash-completion/completions/
70 cp tools/weboob_bash_completion $out/share/bash-completion/completions/weboob
71 '';
72 });
73
90a37f5e 74 mypkgs.slrn = slrn.overrideAttrs (old: rec {
ac6bfec2
IB
75 version = "1.0.3a";
76 name = "slrn-${version}";
77 src = fetchurl {
78 url = "http://www.jedsoft.org/releases/slrn/slrn-${version}.tar.bz2";
79 sha256 = "1b1d9iikr60w0vq86y9a0l4gjl0jxhdznlrdp3r405i097as9a1v";
80 };
c7aeff7d 81 configureFlags = old.configureFlags ++ [ "--with-slrnpull" ];
ac6bfec2
IB
82 });
83
90a37f5e 84 mypkgs.ldapvi = ldapvi.overrideAttrs (old: fetchedGit ./fetched/ldapvi.json);
6b53d116
IB
85
86 nixos = import ./nixos_tools.nix {};
87
90a37f5e 88 mypkgs.pass = (pass.withExtensions (exts: [ exts.pass-otp ])).overrideAttrs (old:
6b53d116 89 fetchedGit ./fetched/pass.json // {
c7aeff7d 90 patches = old.patches ++ [ ./patches/pass-fix-pass-init.patch ];
6b53d116
IB
91 }
92 );
29120e77 93
90a37f5e 94 mypkgs.profanity = (profanity.override {
3936ddc5
IB
95 notifySupport = true;
96 inherit libnotify gpgme gdk_pixbuf;
97 python = python3;
c7aeff7d
IB
98 }).overrideAttrs (old: rec {
99 configureFlags = old.configureFlags ++ [ "--enable-plugins" ];
3936ddc5
IB
100 });
101
90a37f5e 102 mypkgs.weechat = weechat.override {
3936ddc5
IB
103 configure = { availablePlugins, ... }: {
104 plugins = with availablePlugins; [
105 (python.withPackages (ps: with ps; [websocket_client emoji]))
106 perl
107 ];
108 };
109 };
110
b0d2cf8a 111 buildPerlPackage = perlPackages.buildPerlPackage;
b7cb5556 112 mypkgs.note = buildPerlPackage rec {
d0f80881
IB
113 name = "note-1.3.26";
114 src = fetchurl {
115 url = "mirror://cpan/authors/id/T/TL/TLINDEN/${name}.tar.gz";
116 sha256 = "1h645rnb5vpms48fcyzvp7cwwcbf9k5xq49w2bpniyzzgk2brjrq";
117 };
118 outputs = ["out" "man"];
444be914 119 propragatedBuildInputs = [ perlPackages.YAML ];
d0f80881
IB
120 meta = with stdenv.lib; {
121 description = "A perl script for maintaining notes";
122 homepage = http://www.daemon.de/NOTE;
123 license = licenses.gpl3;
124 maintainers = with maintainers; [ { name = "T.v.Dein"; email = "tlinden@cpan.org"; } ];
125 platforms = platforms.unix;
126 };
127 };
128
b7cb5556 129 mypkgs.terminal_velocity = with python2Packages; buildPythonApplication rec {
d0f80881
IB
130 pname = "terminal-velocity-git";
131 version = "0.2.0";
132
133 patches = [
134 # FIXME: update this patch when version changes
135 ./patches/terminal_velocity_fix_build.patch
136 ./patches/terminal_velocity_sort_found_notes.patch
137 ];
138
139 propagatedBuildInputs = [ chardet urwid sh pyyaml ];
140 buildInputs = [ m2r restructuredtext_lint pygments ];
141
142 src = fetchPypi {
143 inherit pname version;
144 sha256 = "13yrkcmvh5h5fwnai61sbmqkrjyisz08n62pq0ada2lyyqf7g6b9";
145 };
146 };
45cb532f 147
b7cb5556 148 mypkgs.mtop = buildPerlPackage rec {
45cb532f
IB
149 name = "mtop-${version}";
150 version = "0.6.6";
151 src = fetchurl {
152 url = "http://downloads.sourceforge.net/project/mtop/mtop/v${version}/mtop-${version}.tar.gz";
153 sha256 = "0x0x5300b1j9i0xxk8rsrki0pspyzj2vylhzv8qg3l6j26aw0zrf";
154 };
155 outputs = ["out"];
156 buildInputs = [ perlPackages.DBI perlPackages.DBDmysql perlPackages.Curses ];
157
158 postInstall = ''
159 cd "$out"
160 preConfigure || true
161 '';
162 meta = with stdenv.lib; {
163 description = "MySQL top (monitor and examine slow queries)";
164 homepage = http://mtop.sourceforge.net/;
165 license = licenses.gpl3;
166 maintainers = with maintainers; [ { name = "Marc Prewitt"; email = "mprewitt@chelsea.net"; } ];
167 platforms = platforms.unix;
168 };
169 };
170
b7cb5556 171 mypkgs.tiv = buildPerlPackage rec {
9f7e0ed0
IB
172 name = "tiv-${version}";
173 version = "2015";
174 src = fetchurl {
175 url = "http://xyne.archlinux.ca/projects/tiv/src/tiv-${version}.tar.xz";
176 sha256 = "1vq073v7z7vmcd57lhs4rf4jasji69cpjgkz4dykp94a77p1qq90";
177 };
178 outputs = ["out"];
179 buildInputs = [ perlPackages.PerlMagick ];
180 perlPreHookScript = ./hooks/tiv_builder.sh;
181 perlPreHook = ''
182 source ${perlPreHookScript}
183 '';
184 installPhase = ''
185 install -Dm755 tiv "$out/bin/tiv"
186 '';
187 };
188
b7cb5556 189 mypkgs.cnagios = stdenv.mkDerivation (fetchedGithub ./fetched/cnagios.json // rec {
364c87ba
IB
190 configureFlags = [
191 "--with-etc-dir=/etc/cnagios"
192 "--with-var-dir=/var/lib/naemon"
193 "--with-nagios-data=4"
194 ];
195
196 prePatch = ''
197 sed -i -e "s/-lcurses/-lncurses/" Makefile.in
198 '';
199 installPhase = ''
200 install -dm755 $out/share/doc/cnagios
201 install -Dm644 cnagiosrc $out/share/doc/cnagios/
202 install -Dm644 cnagios.help $out/share/doc/cnagios/
203 install -Dm644 cnagios.pl $out/share/doc/cnagios/
204 install -dm755 $out/bin
205 install -Dm755 cnagios $out/bin/
206 '';
207 propagatedBuildInputs = [ perl ncurses ];
208 });
209
b7cb5556 210 mypkgs.nagios-cli = python2Packages.buildPythonApplication (fetchedGithub ./fetched/nagios-cli.json);
a54bdff3 211
b7cb5556 212 mypkgs.pg_activity = with python2Packages; buildPythonApplication (fetchedGithub ./fetched/pg_activity.json // rec {
86f4a644
IB
213 propagatedBuildInputs = [ psycopg2 psutil ];
214 });
b693a794 215
b7cb5556 216 mypkgs.pgloader = stdenv.mkDerivation (fetchedGithub ./fetched/pgloader.json // rec {
b693a794
IB
217 buildInputs = [ sbcl cacert sqlite freetds libzip curl git openssl makeWrapper ];
218 LD_LIBRARY_PATH = stdenv.lib.makeLibraryPath [ sqlite libzip curl git openssl freetds ];
219 buildPhase = ''
220 export PATH=$PATH:$out/bin
221 export HOME=$TMPDIR
222 make pgloader
223 '';
224 dontStrip = true;
225 enableParallelBuilding = false;
226 installPhase = ''
227 install -Dm755 build/bin/pgloader "$out/bin/pgloader"
228 wrapProgram $out/bin/pgloader --prefix LD_LIBRARY_PATH : "${LD_LIBRARY_PATH}"
229 '';
230 });
231
b7cb5556 232 mypkgs.pelican = python3Packages.pelican.overrideAttrs(old: fetchedGithub ./fetched/pelican.json // rec {
dab1955f
IB
233 propagatedBuildInputs = old.propagatedBuildInputs ++ [ python3Packages.pyyaml ];
234 });
235
107eeb7c
IB
236 mypkgs.elinks = elinks.overrideAttrs (old:
237 fetchedGithub ./fetched/elinks.json // rec {
238 preConfigure = ''sh autogen.sh'';
239 buildInputs = old.buildInputs ++ [ gettext automake autoconf ];
240 configureFlags = [
241 "--disable-smb" "--without-x" "--enable-cgi"
242 "--enable-leds" "--enable-256-colors"
243 "--enable-html-highlight" "--with-zlib"
244 ];
245 patches = [];
246 }
247 );
a98e2320
IB
248
249 mypkgs.neomutt = neomutt.overrideAttrs (old:
250 rec {
251 buildInputs = old.buildInputs ++ [ gdbm ];
252 configureFlags = old.configureFlags ++ [ "--gdbm" ];
253 }
254 );
255
256 # mypkgs.nagnu = stdenv.mkDerivation (fetchedGithub ./fetched/nagnu.json // rec {
257 # buildInputs = [ ncurses curl ];
258 # installPhase = ''
259 # mkdir -p $out/bin
260 # cp nagnu $out/bin
261 # mkdir -p $out/share/doc/nagnu
262 # cp nagnu.conf.sample $out/share/doc/nagnu
263 # mkdir -p $out/share/man/man8
264 # cp docs/nagnu.8 $out/share/man/man8
265 # '';
266 # });
3fe04d38
IB
267
268 mastodon = stdenv.mkDerivation (fetchedGithub ./fetched/mastodon.json // rec {
269 buildPhase = ''
270 export GIT_SSL_CAINFO=/etc/ssl/certs/ca-certificates.crt
271 export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
272
273 bundle install --deployment --without development test
274 yarn install --pure-lockfile
275 '';
276 installPhase = ''
277 cp -a . $out
278 '';
279 propagatedBuildInputs = [
280 zlib icu libchardet git bundler yarn
281 protobuf protobufc libidn libpqxx nodejs
282 imagemagick ffmpeg libxml2 libxslt pkgconfig
283 autoconf bison libyaml readline ncurses libffi gdbm
284 jemalloc which postgresql python3
285 ];
286 });
45cb532f
IB
287# https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh
288# https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks
177da38b 289in
b7cb5556 290 mypkgs // {
ac6bfec2 291 inherit nix-prefetch-scripts;
9f7e0ed0 292 inherit nix-generate-from-cpan;
b7cb5556 293 inherit timewarrior;
ac6bfec2 294 inherit sc-im;
6b53d116
IB
295 inherit pal;
296 inherit duplicity duply;
297 inherit pdftk;
298 inherit googler;
299 inherit jrnl;
300 inherit apg;
301 inherit newsboat;
302 inherit vcsh;
303 inherit xmr-stak;
304 inherit urlwatch;
3936ddc5 305 inherit ranger;
b7cb5556 306 inherit irssi;
9106eaf4
IB
307 inherit abook khard khal;
308 inherit graphicsmagick;
309 inherit youtube-dl;
892cb808
IB
310 inherit ncmpc;
311 inherit cadaver;
312 inherit mairix notmuch;
313 inherit ctags;
314 inherit s3cmd;
315 inherit solc; # solidity
316 inherit rtorrent;
317 inherit strace;
318 inherit vdirsyncer;
319 inherit w3m lynx links;
320 inherit gitRepo;
321 inherit valgrind;
dab1955f
IB
322 inherit iotop iperf;
323 inherit keybase;
324 inherit bogofilter;
a98e2320 325 inherit mtr;
c86e9776 326 inherit nixops;
3fe04d38 327 #inherit mastodon;
c7aeff7d
IB
328 # todo: lx* ?, unrar, unzip, zeromq?
329 #inherit nextcloud-client;
6b53d116 330 #inherit nixos;
177da38b 331 }