X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=default.nix;h=7bffebb292c9038b90770c878f962f9668b5bb44;hb=891200d6d95bed5a81ba5ee865eb9cf85b39a895;hp=b46403165988089d05ccdd8092c220ad7724bf6b;hpb=45cb532fb674aa09c4f3df228ace8b47268284e9;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/default.nix b/default.nix index b464031..7bffebb 100644 --- a/default.nix +++ b/default.nix @@ -1,6 +1,21 @@ with import {}; let nixpkgs = import {}; + postHook = '' + header() { + echo -ne "\033[1;36m" + echo -n "$1" + echo -e "\033[0m" + } + + echoCmd() { + printf "\033[1;34m%s:\033[0m" "$1" + shift + printf ' %q' "$@" + echo + } + ''; + fetchedGithub = path: let json = lib.importJSON path; @@ -63,7 +78,7 @@ let nixos = import ./nixos_tools.nix {}; - pass = nixpkgs.pass.overrideAttrs (oldAttrs: + pass = (nixpkgs.pass.withExtensions (exts: [ exts.pass-otp ])).overrideAttrs (oldAttrs: fetchedGit ./fetched/pass.json // { patches = oldAttrs.patches ++ [ ./patches/pass-fix-pass-init.patch ]; } @@ -146,11 +161,73 @@ let }; }; + tiv = buildPerlPackage rec { + name = "tiv-${version}"; + version = "2015"; + src = fetchurl { + url = "http://xyne.archlinux.ca/projects/tiv/src/tiv-${version}.tar.xz"; + sha256 = "1vq073v7z7vmcd57lhs4rf4jasji69cpjgkz4dykp94a77p1qq90"; + }; + outputs = ["out"]; + buildInputs = [ perlPackages.PerlMagick ]; + perlPreHookScript = ./hooks/tiv_builder.sh; + perlPreHook = '' + source ${perlPreHookScript} + ''; + installPhase = '' + install -Dm755 tiv "$out/bin/tiv" + ''; + }; + + cnagios = stdenv.mkDerivation (fetchedGithub ./fetched/cnagios.json // rec { + configureFlags = [ + "--with-etc-dir=/etc/cnagios" + "--with-var-dir=/var/lib/naemon" + "--with-nagios-data=4" + ]; + + prePatch = '' + sed -i -e "s/-lcurses/-lncurses/" Makefile.in + ''; + installPhase = '' + install -dm755 $out/share/doc/cnagios + install -Dm644 cnagiosrc $out/share/doc/cnagios/ + install -Dm644 cnagios.help $out/share/doc/cnagios/ + install -Dm644 cnagios.pl $out/share/doc/cnagios/ + install -dm755 $out/bin + install -Dm755 cnagios $out/bin/ + ''; + propagatedBuildInputs = [ perl ncurses ]; + }); + + nagios-cli = python2Packages.buildPythonApplication (fetchedGithub ./fetched/nagios-cli.json); + + pg_activity = with python2Packages; buildPythonApplication (fetchedGithub ./fetched/pg_activity.json // rec { + propagatedBuildInputs = [ psycopg2 psutil ]; + }); + + pgloader = stdenv.mkDerivation (fetchedGithub ./fetched/pgloader.json // rec { + buildInputs = [ sbcl cacert sqlite freetds libzip curl git openssl makeWrapper ]; + LD_LIBRARY_PATH = stdenv.lib.makeLibraryPath [ sqlite libzip curl git openssl freetds ]; + buildPhase = '' + export PATH=$PATH:$out/bin + export HOME=$TMPDIR + make pgloader + ''; + dontStrip = true; + enableParallelBuilding = false; + installPhase = '' + install -Dm755 build/bin/pgloader "$out/bin/pgloader" + wrapProgram $out/bin/pgloader --prefix LD_LIBRARY_PATH : "${LD_LIBRARY_PATH}" + ''; + }); + # https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh # https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks in { inherit nix-prefetch-scripts; + inherit nix-generate-from-cpan; inherit ledger; inherit taskwarrior vit timewarrior; inherit weboob; @@ -170,8 +247,14 @@ in inherit pass; inherit ranger; inherit profanity; - inherit weechat; + inherit weechat irssi; inherit note terminal_velocity; inherit mtop; + inherit tiv; + inherit cnagios nagios-cli; + inherit abook khard khal; + inherit graphicsmagick; + inherit youtube-dl; + inherit pg_activity pgloader; #inherit nixos; }